forked from GithubBackups/tinyib
parent
6bcc978bc9
commit
586c0ae939
@ -398,7 +398,7 @@ function postsByHex($hex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function latestPosts($moderated = true) {
|
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);
|
return convertPostsToSQLStyle($rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ function postsByHex($hex) {
|
|||||||
|
|
||||||
function latestPosts($moderated = true) {
|
function latestPosts($moderated = true) {
|
||||||
$posts = array();
|
$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) {
|
if ($result) {
|
||||||
while ($post = mysql_fetch_assoc($result)) {
|
while ($post = mysql_fetch_assoc($result)) {
|
||||||
$posts[] = $post;
|
$posts[] = $post;
|
||||||
|
@ -279,7 +279,7 @@ function postsByHex($hex) {
|
|||||||
function latestPosts($moderated = true) {
|
function latestPosts($moderated = true) {
|
||||||
global $link;
|
global $link;
|
||||||
$posts = array();
|
$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) {
|
if ($result) {
|
||||||
while ($post = mysqli_fetch_assoc($result)) {
|
while ($post = mysqli_fetch_assoc($result)) {
|
||||||
$posts[] = $post;
|
$posts[] = $post;
|
||||||
|
@ -226,7 +226,7 @@ function postsByHex($hex) {
|
|||||||
|
|
||||||
function latestPosts($moderated = true) {
|
function latestPosts($moderated = true) {
|
||||||
$posts = array();
|
$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)) {
|
while ($row = $results->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$posts[] = $row;
|
$posts[] = $row;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ function postsByHex($hex) {
|
|||||||
|
|
||||||
function latestPosts($moderated = true) {
|
function latestPosts($moderated = true) {
|
||||||
$posts = array();
|
$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) {
|
foreach ($result as $post) {
|
||||||
$posts[] = $post;
|
$posts[] = $post;
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ function postsByHex($hex) {
|
|||||||
function latestPosts($moderated = true) {
|
function latestPosts($moderated = true) {
|
||||||
global $db;
|
global $db;
|
||||||
$posts = array();
|
$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()) {
|
while ($post = $result->fetchArray()) {
|
||||||
$posts[] = $post;
|
$posts[] = $post;
|
||||||
}
|
}
|
||||||
|
16
inc/html.php
16
inc/html.php
@ -148,8 +148,8 @@ function buildPostForm($parent, $staff_post = false) {
|
|||||||
$maxlen_message = TINYIB_MAXMESSAGE;
|
$maxlen_message = TINYIB_MAXMESSAGE;
|
||||||
}
|
}
|
||||||
if ($staff_post) {
|
if ($staff_post) {
|
||||||
$txt_options = __('Options');
|
|
||||||
$txt_raw_html = __('Raw HTML');
|
$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_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>".');
|
$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
|
$input_extra = <<<EOF
|
||||||
<tr>
|
<tr>
|
||||||
<td class="postblock">
|
<td class="postblock">
|
||||||
$txt_options
|
$txt_raw_html
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label><input type="checkbox" name="raw" value="1" accesskey="r"> $txt_raw_html</label><br>
|
<label>
|
||||||
<small>$txt_raw_html_info_1</small><br>
|
<input type="checkbox" name="raw" value="1" accesskey="r"> $txt_enable<br>
|
||||||
<small>$txt_raw_html_info_2</small>
|
<small>$txt_raw_html_info_1</small><br>
|
||||||
|
<small>$txt_raw_html_info_2</small>
|
||||||
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -879,7 +881,9 @@ function adminBar() {
|
|||||||
$output .= '<a href="?manage&staffpost">' . __('Staff Post') . '</a>] [';
|
$output .= '<a href="?manage&staffpost">' . __('Staff Post') . '</a>] [';
|
||||||
if ($isadmin) {
|
if ($isadmin) {
|
||||||
$output .= '<a href="?manage&rebuildall">' . __('Rebuild All') . '</a>] [';
|
$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()) {
|
if ($isadmin && installedViaGit()) {
|
||||||
$output .= '<a href="?manage&update">' . __('Update') . '</a>] [';
|
$output .= '<a href="?manage&update">' . __('Update') . '</a>] [';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user