vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Colored usernames in postbit? (https://vborg.vbsupport.ru/showthread.php?t=46169)

snyx 11-27-2002 09:41 PM

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

Xenon 11-27-2002 09:49 PM

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 ;)

Velocd 11-27-2002 09:51 PM

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.

Brian Briscoe 01-07-2003 11:06 PM

what file do you insert the PHP code into?

Xenon 01-08-2003 04:10 PM

functions.php getpostbit section

Brian Briscoe 01-08-2003 08:55 PM

ok i found a section called buildpostbut but no getpostbit, I tried entering that code into that section and that did not work either.

Xenon 01-09-2003 11:36 AM

the function ist called getpostbit, if you don't find it, you have a corrupted file and your board wouldn't work

Brian Briscoe 01-09-2003 12:22 PM

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.

Brian Briscoe 01-09-2003 12:23 PM

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.

Xenon 01-09-2003 01:24 PM

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, :)


All times are GMT. The time now is 03:16 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.01418 seconds
  • Memory Usage 1,755KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_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