PDA

View Full Version : Mod/Supermod/Admin Picture


CeleronXL
04-17-2002, 06:29 PM
Could someone please make a hack that adds this image: http://www.starcraftsector.com/fs/images/team.gif to the right of the username of a mod/supermod/admin? This was one of the features I enjoyed from Ikonboard; it made it much easier to tell exactly who was a mod. I attempted to do this, but couldn't figure out exaclty how. This should be a very easy hack for an experience hacker as all you probably have to do is something like $ifusergroup=XX or some stuff like that. An example of what I want for the hack is attatched. You can see the team pic next to me, starcraftsector, the admin.

Scott MacVicar
04-17-2002, 06:44 PM
global $mod_cache;
if(!$mod_cache[$post[userid]]) {
if(ismoderator(0,"",$post[userid])) {
eval("\$mod_cache[$post[userid]] = \"".gettemplate("moderator_icon")."\";");
}
}
$mod_logo = $mod_cache[$post[userid]];

put that in functions.php above

// do posts from ignored users
if (!$ignore[$post[userid]]) {

create a template called
moderator_icon
--------------
<img src="http://yourforums.com/mod_icon.gif">

then in your postbit template put $mod_logo after the username in the postbit template

Scott MacVicar
04-18-2002, 01:55 PM
I hope this worked for you, if you have a problem then just tell me.

CeleronXL
04-21-2002, 01:22 AM
Uh... It didn't work. No errors or anything, but it just didn't work....

CeleronXL
04-21-2002, 02:15 AM
Oops, NM, works perfectly. Thanks. :D

Scott MacVicar
04-21-2002, 09:15 AM
Cool no problem

TECK
04-21-2002, 10:44 AM
i think there is an easier way to do this.
in functions.php add:if (ismoderator(0,'',$post[userid])) {
$post[usergroupicon]='<img border="0" src="{ imagesfolder }/'.$post[usergroupid].'.gif">';
} else {
$post[usergroupicon]='';
}then add 5.gif, 6.gif and 7.gif in your images folder.
in your postbit, place $post[usergroupicon] where you want.

Scott MacVicar
04-21-2002, 11:08 AM
It wouldn't really be easier, for two reasons, say there is 25 posts per page and the same person posts 9 times then they're will be a query 9 times to check if he's a mod where you could get away with a temp cache system.

Though what you suggested is good.

$post[usergroupicon]='<img border="0" src="{ imagesfolder }/'.$post[usergroupid].'.gif">';

as the only code and create an icon for every usergroup, just make sure that some are either 0 x 0 pixels and others can be icons.

TECK
04-21-2002, 11:39 AM
thanks for teaching me PPN. :)
it makes alot of sense your query issue. i'm still a newbie remember?

Scott MacVicar
04-21-2002, 12:33 PM
Your not a newbie any more, you have a good grasp of the vBulletin layout and php functions.

TECK
04-21-2002, 11:00 PM
i wish to know only half of what you know. i never thought of the repetead query. but thanks for the nice words. :)

Crazy Mofo
04-21-2002, 11:35 PM
doesnt work 4 me followed all the instructions :(