vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   colors staff on 'users browsing this forum' on forumdisplay.php (https://vborg.vbsupport.ru/showthread.php?t=41895)

Tim Wheatley 08-04-2002 02:35 PM

colors staff on 'users browsing this forum' on forumdisplay.php
 
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/foru...?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:
PHP Code:

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:
PHP Code:

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']==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

Code:

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:
PHP Code:

if ((!$bbuserinfo['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] <> 0) {
        
$userid $bbuserinfo['userid'];
        
$username $bbuserinfo['username']; 

after that add:
PHP Code:

if($bbuserinfo['usergroupid']==6$username="<font color='red'><b>".$username."</b></font>";
elseif(
$bbuserinfo['usergroupid']==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. :)


All times are GMT. The time now is 12:29 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.01285 seconds
  • Memory Usage 1,772KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete