PDA

View Full Version : colors staff on 'users browsing this forum' on forumdisplay.php


Tim Wheatley
08-04-2002, 02:35 PM
Hi,

I'd like staff names to be red (admin) and green (mods/sup-mods) on this:

(Users Browsing this Forum: (44 members) Ed Clark, pegas77, Herb, BillK, Meik Thiemann, Kieron, David Biggs, David Wright Lo67, Jamnut*, tenmantaylor, Bmod, Peter O'Connor, WilliamsBMW3, Mark Levoe, TheoF.......

which shows under the mod list here:
http://forum.racesimcentral.com/forumdisplay.php?s=&forumid=36

I have coloured the names inside the postbit and on who's online, I'd like them to be on there or (if possible) everywhere on the whole board???

Xenon
08-04-2002, 02:44 PM
in forumdisplay.php
find:if ($showforumusers) {
$datecut = $ourtimenow - $cookietimeout;
$browsers = '';
$comma = '';
$forumusers = $DB_site->query("SELECT username, invisible, userid
FROM user
WHERE inforum = $foruminfo[forumid]
AND lastactivity > $datecut
AND lastvisit <> lastactivity");
while ($forumuser = $DB_site->fetch_array($forumusers)) {
if ((!$forumuser['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] != $forumuser['userid']) {
$userid = $forumuser['userid'];
$username = $forumuser['username'];
if ($forumuser['invisible'] == 1) { // Invisible User but show to Admin
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
eval("\$browsers .= \"".$comma.gettemplate('forumdisplay_loggedinuser')."\";");
$comma = ', ';
}
}

replace it with:if ($showforumusers) {
$datecut = $ourtimenow - $cookietimeout;
$browsers = '';
$comma = '';
$forumusers = $DB_site->query("SELECT username, invisible, userid, usergroupid
FROM user
WHERE inforum = $foruminfo[forumid]
AND lastactivity > $datecut
AND lastvisit <> lastactivity");
while ($forumuser = $DB_site->fetch_array($forumusers)) {
if($forumuser['usergroupid']==6) $forumuser['username'] = "<font color=red>".$forumuser['username']."</font>";
elseif($forumuser['usergroupid']==5 or $forumuser['usergroupid']==7) $forumuser['username'] = "<font color=green>".$forumuser['username']."</font>";
if ((!$forumuser['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] != $forumuser['userid']) {
$userid = $forumuser['userid'];
$username = $forumuser['username'];
if ($forumuser['invisible'] == 1) { // Invisible User but show to Admin
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
eval("\$browsers .= \"".$comma.gettemplate('forumdisplay_loggedinuser')."\";");
$comma = ', ';
}
}

should work

Tim Wheatley
08-04-2002, 06:54 PM
Thank you. :) I had to modify it to this to exist with current hacks (plus I added bold tags), but it only shows the mods as green, doesn't show the admins (namely me when I was viewing it) as red. So any idea how to get the red functioning? I have an understanding of PHP but don't know how to write my own - but I can't see anything wrong as it's logically the same as the one underneath (the mod-sup.mod line).

Tim Wheatley
08-04-2002, 06:57 PM
if ($showforumusers) {
$datecut = $ourtimenow - $cookietimeout;
$browsers = '';
$comma = '';
$forumusers = $DB_site->query("SELECT username, invisible, userid, usergroupid
FROM user
WHERE inforum = $foruminfo[forumid]
AND lastactivity > $datecut
AND lastvisit <> lastactivity");
while ($forumuser = $DB_site->fetch_array($forumusers)) {
if($forumuser['usergroupid']==6) $forumuser['username'] = "<font color='red'><b>".$forumuser['username']."</b></font>";
elseif($forumuser['usergroupid']==5 or $forumuser['usergroupid']==7) $forumuser['username'] = "<font color='green'><b>".$forumuser['username']."</b></font>";
if ((!$forumuser['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] != $forumuser['userid']) {
$userid = $forumuser['userid'];
$username = $forumuser['username'];
if ($forumuser['invisible'] == 1) { // Invisible User but show to Admin
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
eval("\$browsers .= \"".$comma.gettemplate('forumdisplay_loggedinuser')."\";");
$comma = ', ';
$usercount++;
}
}

Xenon
08-04-2002, 07:33 PM
i don't see a bug in this code

are you sure your adminusergroup is 6?

Tim Wheatley
08-04-2002, 07:46 PM
I'm guessing that it's something to do with admin invisibility??

Yeah it's the default 5, 6, 7.

Xenon
08-04-2002, 07:58 PM
no it has to do with yourself: the code of showing yourself at the browsing list is another part of code:

below the code above, find this:
if ((!$bbuserinfo['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] <> 0) {
$userid = $bbuserinfo['userid'];
$username = $bbuserinfo['username'];

after that add:if($bbuserinfo['usergroupid']==6) $username="<font color='red'><b>".$username."</b></font>";
elseif($bbuserinfo['usergroupid']==5 or $bbuserinfo['usergroupid']==7) $username="<font color='green'><b>".$username."</b></font>";

now it should work

Tim Wheatley
08-04-2002, 08:16 PM
Nearly there! :D

I am red, so are the mods. Other admins are normal... Any further clues for the dunce of php we all call Tim Wheatley? :D

Tim Wheatley
08-04-2002, 08:20 PM
The mods are green I mean. :)

Tim Wheatley
08-05-2002, 09:35 PM
*bump* This still isn't working. :)

Keyser S?ze
08-09-2002, 02:34 PM
installed this hack and got a error, so i uploaded the old forumdisplay.php file and now im getting this error
Parse error: parse error, unexpected $ in /home/virtual/site61/fst/var/www/html/forums/forumdisplay.php on line 640

any help pls?

this is the error i get with it installed

Parse error: parse error, unexpected $ in /home/virtual/site61/fst/var/www/html/forums/forumdisplay.php on line 590

Xenon
08-09-2002, 02:57 PM
posting the codelines which produce the errors would help ^^

Tim Wheatley
08-09-2002, 10:36 PM
The only thing working is that admins show red to themselves, they don't show red to others or mods down't show as green. :(

natralis
04-12-2004, 07:46 AM
so how would you do the same for RC4 as the forumdisplay.php looks different ? in RC4.......

i tried hard and looked at the code but didnt want to chance editing it

so how could i add staff colours in RC4?

thankyou

Zachery
04-12-2004, 07:50 AM
This was for vB2 and is over 2 years old, vBulletin 3 already does this by default... with HTML markup

natralis
04-12-2004, 07:57 AM
how do i do that please m8 ?

Zachery
04-12-2004, 07:58 AM
try

AdminCP > Usergroups > Usergroup MAnager > Edit a usergroup, edit the HTML markup box.

natralis
04-12-2004, 08:01 AM
Username HTML Markup
(Specify an opening and closing HTML tag with which to display the names of users in this group. This applies to names that appear on Logged-in Users, Who's Online, Users Browsing Forum, Users Browsing Thread, Posts, Member List etc.)

yeah i see it and it has 2 boxes to the side of it which are empty so what goes in the boxes ?

Zachery
04-12-2004, 08:19 AM
first box (stuff before the name) second box, stuff after the name

box1 name box2

<b><i> name </i></b>

natralis
04-12-2004, 08:31 AM
lol :) im still lost ? so staff colours yeah admin=red , super = orange , mod = green

so in first box what would i put ? =
2nd box what would i put ?

aplogies for annoying you with simple explanations

natralis
04-12-2004, 08:58 AM
all sorted.......................................

thankyou for your assistance m8 :) appreciated