PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 Change Admin and Moderator Colors in Who Is Online Table.... 
Description: Learn how to change the Admin and Moderator colors under the Who is Online table in the main forum index.
Author: Zoltrix
Date: Wed Jan 29, 2003 8:00 pm
Type: HowTo
Keywords: Change, Admin, Mod, Moderator, Colours, Colors, Who Is Online
Category: Styles
How do I change the Admin and Moderator colors on my forum index?


Well, we can change the admin and moderator colors through our admin control panel, go to Styles Admin ---> Management ---> Edit your current template ---> Scroll down to Font Colour 2: and Font Colour 3:

Change the hex code of this to reflect your desired colors
Font Colour 2: == Moderator
Font Colour 3: == Admin

Problems
When you do this, you have just changed all fonts that use the font colour 2 and 3. It probably wont look attractive, nor will it be exactly what you want.

The best way.
Edit Page Header file
What we need to do is to edit phpbb manually. Pretty simple. We need to do the fallowing

Download the page_header.php file from the phpBB2/includes/ folder

Make an extra copy, just incase

Open it in your favorite text editor (WordPad.. notepad.... ect.)

For the Admin...
Code:


#######
##Find## Line 114
######
         if ( $row['user_level'] == ADMIN )
         {
            $username = '<b style="color:#' . $theme['fontcolor3'] . '">' . $username . '</b>';
         }


Notice the fallowing code
Code:

' . $theme['fontcolor3'] . '

This is what we need to replace. We need to replace it with our own code. We want a hex code.

Replace that section with your hex code of choice. Mine is going to look like this

Code:

000000


We should replace our new code with something that looks like
Code:
 

##########
##Replace## Line 114
#########
         if ( $row['user_level'] == ADMIN )
         {
            $username = '<b style="color:#000000">' . $username . '</b>';
         }

Notice the Hex Code? That?s the only change. Now we need to do the same to our Moderator. Scroll down about 4 lines to?

Code:


#######
##Find## Line 126
######
         if ( $row['user_level'] == MOD )
         {
            $username = '<b style="color:#' . $theme['fontcolor2'] . '">' . $username . '</b>';
         }


And replace it with your desired hex code for the MOD as above,
Code:


##########
##Replace## Line 126
#########
         if ( $row['user_level'] == ADMIN )
         {
            $username = '<b style="color:#ffffff">' . $username . '</b>';
         }




One more set we need to change.
Code:
 

#######
##Find## Line 363
######

L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),



We need to change add the hex code to reflect our ADMIN color above.
Code:
 

##########
##Replace## Line 363
#########
L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#000000">', '</span>'),



Now we need to change the MOD Colors.
Code:
 

#######
##Find## Line 364
#######
   'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),


We need to change add the hex code to reflect our ADMIN color above.

Code:
 

##########
##Replace## Line 364
#########
   'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#ffffff ">', '</span>'),





Now we are done, Save and upload the new file over the old one.

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.