![]() |
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:
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 |
In forumdisplay.php you need to change this:
Code:
$forumusers = $DB_site->query("SELECT username, invisible, userid Code:
$forumusers = $DB_site->query("SELECT username, invisible, userid, usergroupid |
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? |
to mak the changes in showthread you have to edit admin/functions.php
the getpostbit function |
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:
I guess this one is more complicated than the previous formating hacks I did. I might need a little more help with it. Thanks |
just before the } else { claus add this lines:
if($post[usergroupid]==6) $post[username]="<font color=red>".$post[username]."</font>"; can't be easier ;) |
Thanks a lot! It works like a charm.
|
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 :) |
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. |
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 :) |
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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|