Topic: Users online with pictures, newest 5 users with pictures
How can I show the users online with pictures? Has anyone else done that?
I have a picture upload/resize script that I'm going to integrate in PunBB's registration. The thumbnail profile picture link will be based on the username - probably not the way to do it, but it works.
I don't even see the "users online" in my current installation, but that's probably because I have no users yet ;-)
What code produces this?
Online: bobitt, falconflyz, guardian34, Peter
The index.php has this:
if ($pun_config['o_users_online'] == '1')
{
// Fetch users online info and generate strings for output
$num_guests = 0;
$users = array();
$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
while ($pun_user_online = $db->fetch_assoc($result))
{
if ($pun_user_online['user_id'] > 1)
$users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
else
++$num_guests;
}
$num_users = count($users);
echo "\t\t\t\t".'<dd>'. $lang_index['Users online'].': <strong>'.$num_users.'</strong></dd>'."\n\t\t\t\t".'<dd>'.$lang_index['Guests online'].': <strong>'.$num_guests.'</strong></dd>'."\n\t\t\t".'</dl>'."\n";
if ($num_users > 0)
echo "\t\t\t".'<dl id="onlinelist" class= "clearb">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online'].': </strong></dt>'."\t\t\t\t".implode(',</dd> ', $users).'</dd>'."\n\t\t\t".'</dl>'."\n";
else
echo "\t\t\t".'<div class="clearer"></div>'."\n";
}
else
echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";
?>
So that must be it, right? How can I modify or expand this to include picture links or data from other database fields, besides just the username? Any other fun things I could do with this?
Also, is there a way to show the latest 5 or 10 new users, instead of just the one newest registered user?