I don't know ;( probably fixing some notices
This commit is contained in:
@@ -69,7 +69,7 @@ function getLastPost()
|
||||
|
||||
function getLastPosts($showlatestcount)
|
||||
{
|
||||
global $scripturl, $txt, $db_prefix, $user_info, $modSettings;
|
||||
global $scripturl, $txt, $db_prefix, $user_info, $modSettings, $settings;
|
||||
|
||||
// Find all the posts. Newer ones will have higher IDs. (assuming the last 4 * number are accessable...)
|
||||
$request = db_query("
|
||||
@@ -89,6 +89,12 @@ function getLastPosts($showlatestcount)
|
||||
$posts = array();
|
||||
while ($row = mysql_fetch_assoc($request))
|
||||
{
|
||||
if (empty($row)) break;
|
||||
|
||||
// Some sanity check for empty values
|
||||
//if (! isset ($row['icon'])) $row['icon'] = 'xx';
|
||||
//if (! isset ($row['numReplies'])) $row['numReplies'] = 0;
|
||||
|
||||
// Censor the subject and post for the preview ;).
|
||||
censorText($row['subject']);
|
||||
censorText($row['body']);
|
||||
@@ -106,9 +112,9 @@ function getLastPosts($showlatestcount)
|
||||
'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bName'] . '</a>'
|
||||
),
|
||||
'topic' => $row['ID_TOPIC'],
|
||||
'icon' => file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? $settings['images_url'] . '/post/' . $row['icon'] . '.gif' : $settings['default_images_url'] . '/post/' . $row['icon'] . '.gif',
|
||||
'views' => $row['numViews'],
|
||||
'replies' => $row['numReplies'],
|
||||
#'icon' => file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? $settings['images_url'] . '/post/' . $row['icon'] . '.gif' : $settings['default_images_url'] . '/post/' . $row['icon'] . '.gif',
|
||||
#'views' => $row['numViews'],
|
||||
#'replies' => $row['numReplies'],
|
||||
'poster' => array(
|
||||
'id' => $row['ID_MEMBER'],
|
||||
'name' => $row['posterName'],
|
||||
|
||||
Reference in New Issue
Block a user