TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

July 21, 2024, 08:50:22 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,333
  • Total Topics: 21,233
  • Online today: 103
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 48
  • Total: 49
  • @rjen

Adding Icon For Admin/Mod

Started by alhaudhie, November 01, 2009, 05:22:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alhaudhie

How can i add icon like crown for admin? How can i context user profile and put icon image after their name in this code?

   // add online users           
            echo '<hr /><img src="'.$settings['images_url'].'/icons/bullet11.gif" style="margin: 0;" align="bottom" alt="" />                 
               <a href="'.$scripturl.'?action=who"><b>'.$txt[158].'</b></a><br />';
           
          $online = ssi_whosOnline('array');    
           echo $bullet.$txt['tp-users'].': '.$online['num_users'];    
           echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];    
           echo '<br />'.$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />
<div style="width: 100%; ' , $online['num_users']>5 ? 'height: 30ex;overflow: auto;' : '' ,'">';       

     foreach($online['users'] as $user){
                echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo '<br />';
         }
echo '</div>';
         }
echo '</div>';
}

alhaudhie

i have find the mod for that.. but dont know how to put it running in tp side online users block.

http://custom.simplemachines.org/mods/index.php?mod=1801

Freddy


Freddy

Ok this should work with the code you posted above and with the TP side block.

You need to make a few changes to your SSI.php which is in your forum root (next to index.php).

Please make a backup of SSI.php before you do anything.

Find (around line 652) :

global $scripturl, $db_prefix, $user_info, $txt;

Change to :

global $scripturl, $db_prefix, $user_info, $txt, $boardurl;


Find (around line 656 - 658) :

SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP


Change to :

SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.crown



Find (around line 681 - 686) :

// Bold any buddies.
if ($show_buddies && in_array($row['ID_MEMBER'], $user_info['buddies']))
{
$return['buddies']++;
$link = '<b>' . $link . '</b>';
}


Add AFTER :

// Do they have a crown ?
if (!empty($row['crown']))
$link = '<img src="' . $boardurl . '/Themes/default/images/' . $row['crown'] . '" alt="" />' . $link;



I think that is all you should need.  Let me know how that goes.

alhaudhie

heyyyy///   :up: :up: :up:

soo niceeee... tq soo much..   ;D

Freddy