Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Help: Customise the poster name formating in regard to usergroupid Details »»
Help: Customise the poster name formating in regard to usergroupid
Version: , by skerjean skerjean is offline
Developer Last Online: Feb 2007 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-17-2002 Last Update: Never Installs: 0
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-18-2002, 06:15 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 05-28-2002, 01:42 PM
skerjean skerjean is offline
 
Join Date: Jan 2002
Location: Sherbrooke (Qc), Canada
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 05-28-2002, 01:45 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

the getpostbit function
Reply With Quote
  #5  
Old 05-28-2002, 02:44 PM
skerjean skerjean is offline
 
Join Date: Jan 2002
Location: Sherbrooke (Qc), Canada
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 05-28-2002, 04:35 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just before the } else { claus add this lines:

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

can't be easier
Reply With Quote
  #7  
Old 05-28-2002, 05:33 PM
skerjean skerjean is offline
 
Join Date: Jan 2002
Location: Sherbrooke (Qc), Canada
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot! It works like a charm.
Reply With Quote
  #8  
Old 05-28-2002, 09:52 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 05-29-2002, 02:43 PM
skerjean skerjean is offline
 
Join Date: Jan 2002
Location: Sherbrooke (Qc), Canada
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 05-29-2002, 03:36 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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:35 PM.


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.07047 seconds
  • Memory Usage 2,298KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (9)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_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