Add avatars to index Who's Online list of names
#1
I haven't seen this so I thought I'd share it.  If it's already been posted by someone else, please disregard.

   
click image for larger view

Go to Forum root and edit index.php

Search for (line 61):
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup

Change to this:
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.avatar, u.displaygroup

-------------

Search for (line 78):
$botkey = my_strtolower(str_replace('bot=', '', $user['sid']));

After, add this:
if($user['avatar']){
     $avatar = $user['avatar'];
}else{
     $avatar = 'images/default_avatar.png';
}
if($spiders[$botkey]['name']){
     $avatar = "images/online/".strtolower($spiders[$botkey]['name']).".png";
}

Save your changes.

Please save your bot avatars in a folder named "online" within the "images" folder.  These images should match the name you have identified in your Administrative Control Panel > Configuration > Spiders/Bots list.

For example, if I named a bot "Google", the image should be named "google.png"

-------------

Now, in your template "index_whosonline_memberbit" . . .

Change it from this:
{$user['profilelink']}{$invisiblemark}

To this:
<img src="{$avatar}" style="width: 20px; height: 20px; border-radius: 50px; border: 1px solid #D8DFEA; padding: 1px; margin-top: 4px; margin-right: 0; margin-bottom: -8px; margin-left: 4px" alt="" /> {$user['profilelink']}{$invisiblemark}

Save your changes.


That's all it is to it.  Hope this helps  Smile
Reply


Messages In This Thread
Add avatars to index Who's Online list of names - by Skyon Archer - 2019-12-25, 05:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)