You want to show all avatars of all logged in users on the frontpage?
Do this:
index.php, line 182:
$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());
change to
$result = $db->query('SELECT o.user_id,u.use_avatar, ident FROM '.$db->prefix.'online o, '.$db->prefix.'users u WHERE u.id=o.user_id and idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
Go to line 186
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>';
replace with
{
if ($pun_config['o_avatars'] == '1' && $pun_user_online['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
{
if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.gif'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.gif" '.$img_size[3].' alt="" />';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.jpg'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.jpg" '.$img_size[3].' alt="" />';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.png'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.png" '.$img_size[3].' alt="" />';
}
$users[] = "\n\t\t\t\t".'<dd>'.$user_avatar.'<a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
}
But it looks really ugly I think.....
The German PunBB Site:
PunBB-forum.de