vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Mod/Supermod/Admin Picture (https://vborg.vbsupport.ru/showthread.php?t=37559)

CeleronXL 04-17-2002 06:29 PM

Mod/Supermod/Admin Picture
 
1 Attachment(s)
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

PHP Code:

        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

PHP Code:

        // 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:
PHP Code:

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.

PHP Code:

$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.


All times are GMT. The time now is 10:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01148 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete