Report #69: Last visited bots bug

This commit is contained in:
Ice
2008-02-14 20:13:27 +00:00
parent 34a466657f
commit edd4e9326c

View File

@@ -27,11 +27,10 @@ $sql = 'SELECT username, user_colour, user_lastvisit
WHERE user_type = ' . USER_IGNORE . '
ORDER BY user_lastvisit DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_last_visited_bots_number']);
$first = true;
while ($row = $db->sql_fetchrow($result))
{
// if ($row['user_lastvisit'] == 0)
if (!$row['user_lastvisit'])
if (!$row['user_lastvisit'] && $first == TRUE)
{
$template->assign_vars(array(
'S_DISPLAY_LAST_BOTS' => false,
@@ -42,12 +41,16 @@ while ($row = $db->sql_fetchrow($result))
$template->assign_vars(array(
'S_DISPLAY_LAST_BOTS' => true,
));
$template->assign_block_vars('last_visited_bots', array(
'BOT_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']),
'LAST_VISIT_DATE' => $user->format_date($row['user_lastvisit']),
));
if( $row['user_lastvisit'] > 0 )
{
$template->assign_block_vars('last_visited_bots', array(
'BOT_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']),
'LAST_VISIT_DATE' => $user->format_date($row['user_lastvisit']),
));
}
}
$first = false;
}
$db->sql_freeresult($result);