Latest Plugins
Buy Quality Themes - Check it out!
Post Reply 
Thread Tools
#1

Yaldaram Offline
Manager
Posts: 10,768
Reputation:
Trophies: 156
Go to: ACP > Templates > Your theme's templates > Who's Online Templates > online > and find;
Code:
<td class="thead" colspan="3">
and Change it into;
Code:
<td class="thead" colspan="4">

Within the same template, find;
Code:
<td class="tfoot" colspan="3"
and Change 3 to 4 like this;
Code:
<td class="tfoot" colspan="4"

Within the same template, find;
Code:
<td class="tcat" align="center"><a href="online.php?sortby=username"><span class="smalltext"><strong>{$lang->on_username}</strong></span></a></td>
and Add the following code just Before that;
Code:
<td class="tcat" align="center" width="5%"></td>

Save template.

Now, Go to: ACP > Templates > Your theme's templates > Who's Online Templates > online_row > and find;
Code:
<tr>
and Add the following code just After that;
Code:
<td align="center" class="trow1">{$user_avatar}</td>

Save template.

Now open ./inc/functions_online.php and find;
PHP Code:
function build_wol_row($user)
{
    global 
$mybb$lang$templates$theme$session;

    
// We have a registered user
    
if($user['uid'] > 0)
    {
        
// Only those with "canviewwolinvis" permissions can view invisible users
        
if($user['invisible'] != || $mybb->usergroup['canviewwolinvis'] == || $user['uid'] == $mybb->user['uid'])
        {
            
// Append an invisible mark if the user is invisible
            
if($user['invisible'] == 1)
            {
                
$invisible_mark "*";
            }
            else
            {
                
$invisible_mark '';
            }

            
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
            
$online_name build_profile_link($user['username'], $user['uid']).$invisible_mark;
        }
    } 
and Change it into;
PHP Code:
function build_wol_row($user)
{
    global 
$db$mybb$lang$templates$theme$session;
    
    if (!
$user['uid'])
    {
        
$user_avatar '<img src="images/default_avatar.gif" alt="Avatar" title="Guest \'s Avatar" width="35px" height="35px">';
    }

    
// We have a registered user
    
if($user['uid'] > 0)
    {
        
// Only those with "canviewwolinvis" permissions can view invisible users
        
if($user['invisible'] != || $mybb->usergroup['canviewwolinvis'] == || $user['uid'] == $mybb->user['uid'])
        {
            
// Append an invisible mark if the user is invisible
            
if($user['invisible'] == 1)
            {
                
$invisible_mark "*";
            }
            else
            {
                
$invisible_mark '';
            }

            
$query $db->simple_select("users""*""uid='{$user['uid']}'");
            
$us $db->fetch_array($query);

            if (
$us['avatar'] != "")
            {
                
$user_avatar '<img src="'.$us['avatar'].'" alt="Avatar" title="'.$user['username'].' \'s Avatar" width="35px" height="35px">';
            }
            else
            {
                
$user_avatar '<img src="images/default_avatar.gif" alt="Avatar" title="'.$user['username'].' \'s Avatar" width="35px" height="35px">';
            }

            
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
            
$online_name build_profile_link($user['username'], $user['uid']).$invisible_mark;
        }
    } 

Now it'll look like this;
   
10 November 2011 11:58 AM
(This post was last modified: 2 November 2012 05:10 PM by Yaldaram.) |
Reply
#2

Tecca Offline
Posts: 6
Reputation:
Trophies: 1
Hey Yaldaram, great tutorial as usual. How would I go about using the default avatar for guests/spiders as well?
1 November 2012 07:54 PM
Reply
#3

Yaldaram Offline
Manager
Posts: 10,768
Reputation:
Trophies: 156
Hi Tecca, Thank you.

In the above code, find;
PHP Code:
else
            {
                
$user_avatar '<img src="images/default_avatar.gif" alt="Avatar" title="'.$user['username'].' \'s Avatar" width="35px" height="35px">';
            } 
and Add the following code just after that line;
PHP Code:
    if (!$user['uid'])
    {
        
$user_avatar '<img src="images/default_avatar.gif" alt="Avatar" title="Guest \'s Avatar" width="35px" height="35px">';
    } 
Let me know if it works there?
1 November 2012 08:00 PM
Reply
#4

Tecca Offline
Posts: 6
Reputation:
Trophies: 1
Ah, thanks for the quick answer. I tried the above, but it didn't work.
2 November 2012 08:43 AM
Reply
#5

Yaldaram Offline
Manager
Posts: 10,768
Reputation:
Trophies: 156
Right, I've updated the first post with the new php code. It should work. Re-edit the ./inc/functions_online.php file with the new php code provided.
2 November 2012 05:11 PM
Reply
#6

Tecca Offline
Posts: 6
Reputation:
Trophies: 1
Works great, thank you, Yaldaram!
3 November 2012 04:04 AM
Reply
#7

Yaldaram Offline
Manager
Posts: 10,768
Reputation:
Trophies: 156
You're welcome Smile
3 November 2012 04:34 AM
Reply
#8

KingCupid Offline
Silver Subscriber
Posts: 150
Reputation:
Trophies:
I did all edits..but showing only default avatar....any solution Sir? How to add avatar for bots and guest?

Edit: Fixed it...Thanx for nice tricks!!!

Any way to assign avatar to guest and bots?
8 November 2012 03:14 PM
(This post was last modified: 8 November 2012 03:24 PM by KingCupid.) |
Reply
#9

Yaldaram Offline
Manager
Posts: 10,768
Reputation:
Trophies: 156
It does add avatar for guests and bots.
8 November 2012 04:21 PM
Reply
#10

KingCupid Offline
Silver Subscriber
Posts: 150
Reputation:
Trophies:
Is there any way to assign bots and guest different avatar than default one....like one for yahoo, one for guest, one for google....
8 November 2012 05:09 PM
Reply


Forum Jump:


User(s) browsing this thread: 2 Guest(s)


Community Software By MyBB
Theme Designed By Yaldaram.com