Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2002, 06:29 PM
CeleronXL's Avatar
CeleronXL CeleronXL is offline
 
Join Date: Nov 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Mod/Supermod/Admin Picture

Could someone please make a hack that adds this image: 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.
Attached Images
File Type: jpg modpic.jpg (96.0 KB, 0 views)
Reply With Quote
  #2  
Old 04-17-2002, 06:44 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 04-18-2002, 01:55 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I hope this worked for you, if you have a problem then just tell me.
Reply With Quote
  #4  
Old 04-21-2002, 01:22 AM
CeleronXL's Avatar
CeleronXL CeleronXL is offline
 
Join Date: Nov 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uh... It didn't work. No errors or anything, but it just didn't work....
Reply With Quote
  #5  
Old 04-21-2002, 02:15 AM
CeleronXL's Avatar
CeleronXL CeleronXL is offline
 
Join Date: Nov 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops, NM, works perfectly. Thanks.
Reply With Quote
  #6  
Old 04-21-2002, 09:15 AM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool no problem
Reply With Quote
  #7  
Old 04-21-2002, 10:44 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 04-21-2002, 11:08 AM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 04-21-2002, 11:39 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for teaching me PPN.
it makes alot of sense your query issue. i'm still a newbie remember?
Reply With Quote
  #10  
Old 04-21-2002, 12:33 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your not a newbie any more, you have a good grasp of the vBulletin layout and php functions.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:51 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.04315 seconds
  • Memory Usage 2,277KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete