vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Help: Customise the poster name formating in regard to usergroupid (https://vborg.vbsupport.ru/showthread.php?t=38748)

skerjean 05-17-2002 05:54 PM

Help: Customise the poster name formating in regard to usergroupid
 
I've hacked the formating of in 'who's online', 'member list', and homepage's 'currently active users' so moderators and admins are shown in a different color.

I now which to do the same in the forum vies and tread view but I can't find where I need to edit the code.

As an example, in forumdisplay.php I changed
Quote:

$username = $forumuser['username'];
with the following:
Quote:

if ($forumuser['usergroupid'] == 6 or $forumuser['usergroupid'] == 9) {
$username = "<b><font color=\"EED500\">$forumuser[username]</font></b>";
} else if ($forumuser['usergroupid'] == 5 or $forumuser['usergroupid'] == 7) {
$username = "<b><font color=\"A0A0A0\">$forumuser[username]</font></b>";
} else {
$username = "<b><font color=\"FFFFFF\">$forumuser[username]</font></b>";
}

(Sorry for the lack of indentation but I don't know how you guys do to make formating in a quote...)

Can anyone help me with this?
And by the way, I do not require a complete hack, I just need a hint on where I should look to insert my modifications.

Thanks

Admin 05-18-2002 06:15 AM

In forumdisplay.php you need to change this:
Code:

        $forumusers = $DB_site->query("SELECT username, invisible, userid
To this:
Code:

        $forumusers = $DB_site->query("SELECT username, invisible, userid, usergroupid
usergroupid wasn't selected.

skerjean 05-28-2002 01:42 PM

I already made that change in forumdisplay.php. I only included this code example to illustrate what I'm trying to do. This code already works for 'users browsing this forum' in forumdisplay.php. What I want to do now is apply the same customization to each post's poster name in showthread.php.

Any clue on that?

Xenon 05-28-2002 01:45 PM

to mak the changes in showthread you have to edit admin/functions.php

the getpostbit function

skerjean 05-28-2002 02:44 PM

I see nowhere to edit the username formating in admin/functions.php.

The only thing I found that look a little like it is the following (from line 225):
PHP Code:

} else {
        
$postsperday=0;
        
$post[username]=$post[postusername];
        
$post[usertitle]="Guest";
        
$post[joindate]="Not Yet";
        
$post[posts]="N/A";
        ... 

which defines the formating for guest users.

I guess this one is more complicated than the previous formating hacks I did. I might need a little more help with it.

Thanks

Xenon 05-28-2002 04:35 PM

just before the } else { claus add this lines:

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

can't be easier ;)

skerjean 05-28-2002 05:33 PM

Thanks a lot! It works like a charm.

Xenon 05-28-2002 09:52 PM

np :)

i knew it, because this special thing has been asked two days ago, and i'll wrote this few lines to test it :)

can i give you an advice:
don't make the colors hardcoded. Better get it out from the database from the usergrouptable. so you can change it easier :)

skerjean 05-29-2002 02:43 PM

I agree, but I think this might be a little beyond my very small programming skills.

In fact, I can't code a thing on my own. I'm barely able to understand some parts of the actual code and make some small modifications to it using cut&paste and some small inputs.

Playing with the database and modifying the admin control panel worries me a lot more than adding a hardcoded text formating line in a couple of places in the code.

So unless you have an easy way to get this done, I'll stick with hardcoded modifications which I understand.

Anyway, thanks a lot for your help.

Xenon 05-29-2002 03:36 PM

i knew that procedure, but it's the best way to learn coding i think.
thast the way i learned the coding, and sometimes i have to do so once more ;)

but keep it in mind, and try to do it on a local board once you have little more experience.
just think of: the best way to learn is to correct own errors

:)

skerjean 05-29-2002 03:50 PM

Already got to try this technique a couple of time. I must be on the good track. :)


All times are GMT. The time now is 02:41 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.01184 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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