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 Color in View Online Page 
Description: Learn how to Change Admin and Moderator Color in View Online Page
Author: Zoltrix
Date: Wed Jan 29, 2003 8:04 pm
Type: HowTo
Keywords: Change, Moderator, Admin, Color, Colour, Colors, colours, View online
Category: Styles
So,
You want to change the Admin and Moderator link colors in the Who’s Online page (example: http://www.phpbb.com/phpBB/viewonline.php). Well, there is two ways of going about this. I will address both of them.


Change Template Colors...

You can edit the admin color by using phpbb’s template system, log into your admin control panel, and go 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 View Online file
What needs to happen is we need to change the admin colors by hand, Its pretty simple. Just fallow these steps.

Download viewonline.php from your phpBB2 folder on your website. Save another copy (just incase).

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

For the Admin...
Code:

#######
##Find## Line 113
#######

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



Notice "theme['fontcolor3']" This tells phpbb to use fontcolor3 from the template. We don’t want it, we want it to use our own color. We are going to need to replace that with a nice new hex code (you may use whatever you want, I’m going to use black and white for this demo)

I want my Admin color links to be black, So I’m going to replace "theme['fontcolor3']" with the hex code #000000.

You should now have some code that looks like the fallowing,

Code:

#########
##Replace## Line 113
#########

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


Note: Remove the single quotes

Ok, Now you need to do the exact same with the Mod colors. Look about 4 lines down and follow the above steps.


And your done!





Question
Great!, I got the view online page changed, but what about on my forum index? The Admin and MOD colors never changed at all.
Answer
You only changed the colors in the View Online page, to change the index, http://www.phpbb.com/kb/article.php?article_id=52

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