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 11-27-2002, 09:41 PM
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
Location: Vancouver (whistler.2010)
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Colored usernames in postbit?

werd, I have been trying to get this to work for ages now, but I cant seem to on 228/229 its werid.

anyone help shed some light on this? I wanna set my users postbit username to a color based on their usergroup. (admins red, mods green, users blue)

I tried this code.. but it just didnt change anything.
no errors, just didnt work.

PHP Code:
// ###################### Start coloredusers #######################
    
$post[specialusername] = $post[username];
    
$userid=$post[userid];

    if (
$userid == 6) { $post[specialusername] = "<span color=\"#cc0000\"><i><b>$post[username]</b></i></span>"; }
    if (
$userid == 11) { $post[specialusername] = "<span color=\"#000000\"><b>$post[username]</b></span>"; }
    if (
$userid == 10) { $post[specialusername] = "<span color=\"#0000ff\"><b>$post[username]</b></span>"; }
    if (
$userid == 7) { $post[specialusername] = "<span color=\"green\"><b>$post[username]</b></span>"; }
    if (
$userid == 2) { $post[specialusername] = "<span color=\"#0000ff\">$post[username]</span>"; }
    if (
$userid == 5) { $post[specialusername] = "<span color=\"green\"><b><i>$post[username]</i></b></span>"; }
    
// ###################### End coloredusers ####################### 
any help anyone can lend me would be huge!
thanks..

-myles
Reply With Quote
  #2  
Old 11-27-2002, 09:49 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you should use this:

PHP Code:
// ###################### Start coloredusers #######################
    
$post[specialusername] = $post[username];

    if (
$post[usergroupid] == 6) { $post[specialusername] = "<span color=\"#cc0000\"><i><b>$post[username]</b></i></span>"; }
    if (
$post[usergroupid] == 11) { $post[specialusername] = "<span color=\"#000000\"><b>$post[username]</b></span>"; }
    if (
$post[usergroupid] == 10) { $post[specialusername] = "<span color=\"#0000ff\"><b>$post[username]</b></span>"; }
    if (
$post[usergroupid] == 7) { $post[specialusername] = "<span color=\"green\"><b>$post[username]</b></span>"; }
    if (
$post[usergroupid] == 2) { $post[specialusername] = "<span color=\"#0000ff\">$post[username]</span>"; }
    if (
$post[usergroupid] == 5) { $post[specialusername] = "<span color=\"green\"><b><i>$post[username]</i></b></span>"; }
    
// ###################### End coloredusers ####################### 
and be sure you use $post[specialusername] in your postbit
Reply With Quote
  #3  
Old 11-27-2002, 09:51 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Make sure in your postbit template the code you have listed is not $post[username] but $post[specialusername].

There isn't really any point in creating a new variable, just re-use $post[username] for all the if statements. The code seems to be correct, but you might have just forgot to place something in..

edit: gah, Xenon replies out of no-where :ninja:
Ignore my post, skipped the part referring to usergroup, not userid.
Reply With Quote
  #4  
Old 01-07-2003, 11:06 PM
Brian Briscoe Brian Briscoe is offline
 
Join Date: Aug 2002
Location: United States
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what file do you insert the PHP code into?
Reply With Quote
  #5  
Old 01-08-2003, 04:10 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

functions.php getpostbit section
Reply With Quote
  #6  
Old 01-08-2003, 08:55 PM
Brian Briscoe Brian Briscoe is offline
 
Join Date: Aug 2002
Location: United States
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok i found a section called buildpostbut but no getpostbit, I tried entering that code into that section and that did not work either.
Reply With Quote
  #7  
Old 01-09-2003, 11:36 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the function ist called getpostbit, if you don't find it, you have a corrupted file and your board wouldn't work
Reply With Quote
  #8  
Old 01-09-2003, 12:22 PM
Brian Briscoe Brian Briscoe is offline
 
Join Date: Aug 2002
Location: United States
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well my board is working becuase im testing it on my home server right now. I am Using ArieSoft WinSyntax as my editor and I did a search through a couple of file for it including admin/functions.php and nothing came up, I even manually searched the file and found nothing. All I can find in 2.2.9 is buildpostbit.
Reply With Quote
  #9  
Old 01-09-2003, 12:23 PM
Brian Briscoe Brian Briscoe is offline
 
Join Date: Aug 2002
Location: United States
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xenon
the function ist called getpostbit, if you don't find it, you have a corrupted file and your board wouldn't work
Well I guess I could try downloading vBulletin 2.2.9 again, let me do that and ill post again and tell ya if I find anything.
Reply With Quote
  #10  
Old 01-09-2003, 01:24 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lin 57-63 on a unhacked 229 functions.php:

PHP Code:
// ###################### Start buildpostbit #######################
$firstnew 0;
function 
getpostbit($post) {
// sorts through all the stuff to return the postbit template

    // user
    
global $bbuserinfo,$session,$ignore,$cookietimeout
there you can see function getpostbit...

and you have to put the code into this function,
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 02:51 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07532 seconds
  • Memory Usage 2,280KB
  • Queries Executed 13 (?)
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
  • (3)bbcode_php
  • (1)bbcode_quote
  • (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
  • (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_postinfo_query
  • fetch_postinfo
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete