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 within thread? (https://vborg.vbsupport.ru/showthread.php?t=38847)

ehjay 05-20-2002 06:48 PM

Colored usernames within thread?
 
I've seen the colored who's online hack, and it's additional colored buddylist hack, but I've searched but couldn't find a hack to allow for the usernames within a thread to be color coded as well, based on a similiar idea as the who's online hack.

1 color for admins, 1 for supermods, etc.

so instead of AJ.. you'd see AJ or something like that.

does this exist? if so, where? if not, i'd think it to be a hack someone could make.

Xenon 05-20-2002 11:28 PM

have answered already to your PM :)

if it worked so, i'll post it into the small releases ^^

if not, like i've said in the pm tell me, i'll work on it :)

ehjay 05-21-2002 12:18 AM

the code you gave me I got to work, but I can't seem to implement this for multiple usergroups correctly.

any idea how i might set this up for the other user groups as well?

Xenon 05-21-2002 08:21 AM

humm, it should work, for all usergroups if it works for one....

sure you have implemented the other groups correctly?

ehjay 05-21-2002 09:53 AM

eh.. i think so.
what code would you use?

Xenon 05-21-2002 10:02 AM

hmm like this way:
PHP Code:

if ($post[usergroupid]==6) { 
$post[username]="<font color=red>".$post[username]."</font>"

if (
$post[usergroupid]==|| $post[usergroupid]==7) { 
$post[username]="<font color=blue>".$post[username]."</font>"

if (
$post[usergroupid]==9) { 
$post[username]="<font color=gray>".$post[username]."</font>"


and so on for all of your usergroups you want to change the color.
just directly below if($post[userid]!=0) {
...

ehjay 05-21-2002 07:50 PM

see when i try to run that, it gives me a parse error on that first line.

but if i try it with just an if statement, converting admin users to red, it'll work.. ?

Xenon 05-21-2002 08:11 PM

1 Attachment(s)
hmm, i have tested it now on my board, and all works perfect

i just copied the lines i have written directliy after
PHP Code:

if ($post[userid]!=0) { 

and there is no parse error...

look at the attached screeny

can you please post 5 lines before and after the lines i have said you should add?

ehjay 05-21-2002 08:28 PM

humm, still won't work..

before:
PHP Code:

 if (!$forum[allowicons] or $post[iconid]==0) {
        if (
$showdeficon) {
            
$post[icon]='<img src="{imagesfolder}/icons/icon1.gif" border="0" alt="">';
        }
    } else {
        
/*
        unset ($iconwidth);
        unset($iconheight);
        $imginfo=@getimagesize($post[iconpath]);
        if ($imginfo[2]==1 or $imginfo[2]==2) { // We have a .gif or .jpg
        $iconwidth = "width=\"$imginfo[0]\"";
        $iconheight = "height=\"$imginfo[1]\"";
        }
        */
        
$post[icon]="<img src=\"$post[iconpath]\" alt=\"$post[icontitle]\" border=\"0\">";
    } 

after:
PHP Code:

 unset($onlinestatus);
        if (
$post['lastactivity'] > $datecut and !$post['invisible'] and $post['lastvisit'] != $post['lastactivity']) {
            eval(
"\$onlinestatus = \"".gettemplate("postbit_online")."\";");
        } else {
            eval(
"\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
        } 


Xenon 05-21-2002 08:34 PM

hmm, its exactly the same as my lines:

PHP Code:

    if (!$forum[allowicons] or $post[iconid]==0) {
        if (
$showdeficon) {
            
$post[icon]='<img src="{imagesfolder}/icons/icon1.gif" border="0" alt="">';
        }
    } else {
        
/*
        unset ($iconwidth);
        unset($iconheight);
        $imginfo=@getimagesize($post[iconpath]);
        if ($imginfo[2]==1 or $imginfo[2]==2) { // We have a .gif or .jpg
        $iconwidth = "width=\"$imginfo[0]\"";
        $iconheight = "height=\"$imginfo[1]\"";
        }
        */
        
$post[icon]="<img src=\"$post[iconpath]\" alt=\"$post[icontitle]\" border=\"0\">";
    }

    if (
$post[userid]!=0) {
    
if (
$post[usergroupid]==6) { 
$post[username]="<font color=red>".$post[username]."</font>"

if (
$post[usergroupid]==|| $post[usergroupid]==7) { 
$post[username]="<font color=blue>".$post[username]."</font>"

if (
$post[usergroupid]==9) { 
$post[username]="<font color=gray>".$post[username]."</font>"
}
        unset(
$onlinestatus);
        if (
$post['lastactivity'] > $datecut and !$post['invisible'] and $post['lastvisit'] != $post['lastactivity']) {
            eval(
"\$onlinestatus = \"".gettemplate("postbit_online")."\";");
        } else {
            eval(
"\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
        } 

this are the lines, where the hack is integrated....

can you please post also the exact errormessage?

ehjay 05-21-2002 10:53 PM

Parse error: parse error, unexpected T_STRING in /home/virtual/site3/fst/var/www/html/admin/functions.php on line 147

Fatal error: Call to undefined function: getuserinfo() in /home/virtual/site3/fst/var/www/html/admin/sessions.php on line 108

Xenon 05-22-2002 07:47 PM

sounds like a forgotten " or something...

can't tell you more

hmm, attaching full vb-php-files isn't allowed, so i can't take a look at your file. just try to crosschek every line with my part of the functions.php

ehjay 05-22-2002 08:25 PM

I don't know what to say.. i've checked my functions.php against yours ten times... it's identical.

and yet, i still get the same errors.

Xenon 05-23-2002 08:19 AM

Send me your functions.php an your e-mail and i'll check it. :)

ok?

ehjay 05-24-2002 10:21 PM

sent.

Xenon 05-27-2002 12:10 PM

got it to work now?

ehjay 05-29-2002 12:23 AM

It all works now, but I'd sort of like this to carry into the Forum Leaders page as well, so people can relate the colors to the ranks more clearly.

Is this as easily done? ;)

Xenon 05-29-2002 10:54 AM

shouldn't be a problem too
open showgroups.php

line 175:
while ($user = $DB_site->fetch_array($users)) {
below add: $user[username]="<font color=red>".$username."</font>";

this are the moderators

line 108:
if ($usergroupid == 6) { // Admins
below add: $user[username]="<font color=red>".$username."</font>";

this is for the admins

then find
} else if ($usergroupid == 5) { // Super Mods
below add: $user[username]="<font color=blue>".$username."</font>";

this for supermods.


not tested but should work :)


All times are GMT. The time now is 12:45 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.01621 seconds
  • Memory Usage 1,779KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete