mirror of
https://code.rocketnine.space/tslocum/tinyib.git
synced 2025-01-17 16:08:15 +01:00
parent
6bcc978bc9
commit
586c0ae939
@ -398,7 +398,7 @@ function postsByHex($hex) {
|
||||
}
|
||||
|
||||
function latestPosts($moderated = true) {
|
||||
$rows = $GLOBALS['db']->selectWhere(POSTS_FILE, NULL, 10, new OrderBy(POST_TIMESTAMP, DESCENDING, INTEGER_COMPARISON));
|
||||
$rows = $GLOBALS['db']->selectWhere(POSTS_FILE, new SimpleWhereClause(POST_MODERATED, $moderated ? '>' : '=', 0, INTEGER_COMPARISON), 10, new OrderBy(POST_TIMESTAMP, DESCENDING, INTEGER_COMPARISON));
|
||||
return convertPostsToSQLStyle($rows);
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ function postsByHex($hex) {
|
||||
|
||||
function latestPosts($moderated = true) {
|
||||
$posts = array();
|
||||
$result = mysql_query("SELECT * FROM `" . TINYIB_DBPOSTS . "` WHERE `moderated` = " . ($moderated ? '1' : '0') . " ORDER BY `timestamp` DESC LIMIT 10");
|
||||
$result = mysql_query("SELECT * FROM `" . TINYIB_DBPOSTS . "` WHERE `moderated` " . ($moderated ? '>' : '=') . " 0 ORDER BY `timestamp` DESC LIMIT 10");
|
||||
if ($result) {
|
||||
while ($post = mysql_fetch_assoc($result)) {
|
||||
$posts[] = $post;
|
||||
|
@ -279,7 +279,7 @@ function postsByHex($hex) {
|
||||
function latestPosts($moderated = true) {
|
||||
global $link;
|
||||
$posts = array();
|
||||
$result = mysqli_query($link, "SELECT * FROM `" . TINYIB_DBPOSTS . "` WHERE `moderated` = " . ($moderated ? '1' : '0') . " ORDER BY `timestamp` DESC LIMIT 10");
|
||||
$result = mysqli_query($link, "SELECT * FROM `" . TINYIB_DBPOSTS . "` WHERE `moderated` " . ($moderated ? '>' : '=') . " 0 ORDER BY `timestamp` DESC LIMIT 10");
|
||||
if ($result) {
|
||||
while ($post = mysqli_fetch_assoc($result)) {
|
||||
$posts[] = $post;
|
||||
|
@ -226,7 +226,7 @@ function postsByHex($hex) {
|
||||
|
||||
function latestPosts($moderated = true) {
|
||||
$posts = array();
|
||||
$results = pdoQuery("SELECT * FROM " . TINYIB_DBPOSTS . " WHERE moderated = ? ORDER BY timestamp DESC LIMIT 10", array($moderated ? '1' : '0'));
|
||||
$results = pdoQuery("SELECT * FROM " . TINYIB_DBPOSTS . " WHERE moderated " . ($moderated ? '>' : '=') . " 0 ORDER BY timestamp DESC LIMIT 10");
|
||||
while ($row = $results->fetch(PDO::FETCH_ASSOC)) {
|
||||
$posts[] = $row;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ function postsByHex($hex) {
|
||||
|
||||
function latestPosts($moderated = true) {
|
||||
$posts = array();
|
||||
$result = sqlite_fetch_all(sqlite_query($GLOBALS["db"], "SELECT * FROM " . TINYIB_DBPOSTS . " ORDER BY timestamp DESC LIMIT 10"), SQLITE_ASSOC);
|
||||
$result = sqlite_fetch_all(sqlite_query($GLOBALS["db"], "SELECT * FROM " . TINYIB_DBPOSTS . " WHERE `moderated` " . ($moderated ? '>' : '=') . " 0 ORDER BY timestamp DESC LIMIT 10"), SQLITE_ASSOC);
|
||||
foreach ($result as $post) {
|
||||
$posts[] = $post;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ function postsByHex($hex) {
|
||||
function latestPosts($moderated = true) {
|
||||
global $db;
|
||||
$posts = array();
|
||||
$result = $db->query("SELECT * FROM " . TINYIB_DBPOSTS . " ORDER BY timestamp DESC LIMIT 10");
|
||||
$result = $db->query("SELECT * FROM " . TINYIB_DBPOSTS . " WHERE `moderated` " . ($moderated ? '>' : '=') . " 0 ORDER BY timestamp DESC LIMIT 10");
|
||||
while ($post = $result->fetchArray()) {
|
||||
$posts[] = $post;
|
||||
}
|
||||
|
16
inc/html.php
16
inc/html.php
@ -148,8 +148,8 @@ function buildPostForm($parent, $staff_post = false) {
|
||||
$maxlen_message = TINYIB_MAXMESSAGE;
|
||||
}
|
||||
if ($staff_post) {
|
||||
$txt_options = __('Options');
|
||||
$txt_raw_html = __('Raw HTML');
|
||||
$txt_enable = __('Enable');
|
||||
$txt_raw_html_info_1 = __('Text entered in the Message field will be posted as is with no formatting applied.');
|
||||
$txt_raw_html_info_2 = __('Line-breaks must be specified with "<br>".');
|
||||
|
||||
@ -161,12 +161,14 @@ function buildPostForm($parent, $staff_post = false) {
|
||||
$input_extra = <<<EOF
|
||||
<tr>
|
||||
<td class="postblock">
|
||||
$txt_options
|
||||
$txt_raw_html
|
||||
</td>
|
||||
<td>
|
||||
<label><input type="checkbox" name="raw" value="1" accesskey="r"> $txt_raw_html</label><br>
|
||||
<small>$txt_raw_html_info_1</small><br>
|
||||
<small>$txt_raw_html_info_2</small>
|
||||
<label>
|
||||
<input type="checkbox" name="raw" value="1" accesskey="r"> $txt_enable<br>
|
||||
<small>$txt_raw_html_info_1</small><br>
|
||||
<small>$txt_raw_html_info_2</small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -879,7 +881,9 @@ function adminBar() {
|
||||
$output .= '<a href="?manage&staffpost">' . __('Staff Post') . '</a>] [';
|
||||
if ($isadmin) {
|
||||
$output .= '<a href="?manage&rebuildall">' . __('Rebuild All') . '</a>] [';
|
||||
$output .= '<a href="?manage&reports">' . __('Reports') . '</a>] [';
|
||||
if (TINYIB_REPORT) {
|
||||
$output .= '<a href="?manage&reports">' . __('Reports') . '</a>] [';
|
||||
}
|
||||
}
|
||||
if ($isadmin && installedViaGit()) {
|
||||
$output .= '<a href="?manage&update">' . __('Update') . '</a>] [';
|
||||
|
Loading…
x
Reference in New Issue
Block a user