Colorize Administrators and Moderators Usernames in Topic

Tutorials for <a href="http://www.phpbbstyles.com/viewtopic.php?t=356">eXtreme Styles mod</a> for phpBB 2.0.

Moderator: Moderators

Colorize Administrators and Moderators Usernames in Topic

Postby pentapenguin on Sun Jun 19, 2005 5:44 am

Hello.
If you like the phpBB3 way administrators' and moderators' usernames are colored when viewing a post (viewtopic.php), you can get this same effect too in phpBB2 with this very simple MOD, the Aphrodite style, and the eXtreme Styles MOD. With this MOD, admins and mods names will be red and green respectively in the posts and other users' usernames will be the normal link color. This will only take about 2 minutes to install. Please be sure to keep a backup just in case.
Enjoy! :)
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php


#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT u.username, u.user_id,


#
#-----[ IN-LINE FIND ]------------------------------------------
#
u.user_id,


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
u.user_level,


#
#-----[ FIND ]------------------------------------------
#
      'POSTER_NAME' => $poster,


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
      'USER_LEVEL' => $postrow[$i]['user_level'],


#
#-----[ OPEN ]------------------------------------------
#
templates/ca_aphrodite/xs/xs_topic.tpl


#
#-----[ FIND ]------------------------------------------
#
   if(!empty($postrow_item['PROFILE']) && strpos($postrow_item['POSTER_NAME'], '<') === false)
   {


#
#-----[ AFTER, ADD ]------------------------------------------
#
      $user_style = ( $postrow_item['USER_LEVEL'] == ADMIN ) ? ' style="color: #' . $theme['fontcolor3'] . '"' : ( ( $postrow_item['USER_LEVEL'] == MOD ) ? ' style="color: #' . $theme['fontcolor2'] . '"' : '' );


#
#-----[ FIND ]------------------------------------------
#
      $replace = array($postrow_item['POSTER_NAME'], '<a class="post-name" ');


#
#-----[ REPLACE WITH ]------------------------------------------
#
      $replace = array($postrow_item['POSTER_NAME'], "<a class=\"post-name\"$user_style ");

BTW: if anyone needs it, I can try making instructions for the memberlist and view profile too.
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA

Postby ewelin on Sun Jun 19, 2005 4:41 pm

Here is a mod that is very similar to that. It's called Advanced Username Color and allows you to make additional color groups and those colors appear whenever the user name appears basically.... i did have to tweak it a little for my needs but works pretty well... might be a good reference for what you're doing
ewelin
Registered User
Registered User
 
Posts: 679
Joined: Thu Apr 14, 2005 8:16 pm

Re: Colorize Administrators and Moderators Usernames in Topi

Postby whatusername on Sun Jun 19, 2005 5:03 pm

[quote user="pentapenguin" post="40176"]BTW: if anyone needs it, I can try making instructions for the memberlist and view profile too.[/quote]

Of course we would like the instructions for those pages :).
whatusername
Registered User
Registered User
 
Posts: 163
Joined: Thu Mar 31, 2005 3:14 pm
Location: China!

Postby pentapenguin on Mon Jun 20, 2005 9:52 pm

ewelin, this isn't a replacement for a real color groups MOD--just a "fix" for existing phpBB installs who like me don't need a big color groups MOD. ;)

whatusername, I'll see about getting that done soon.
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA

Postby ewelin on Tue Jun 21, 2005 12:27 am

ahhh gotcha... even still you could refernce it for your steps on editing the veiw profile and memberlist
ewelin
Registered User
Registered User
 
Posts: 679
Joined: Thu Apr 14, 2005 8:16 pm

Postby pentapenguin on Sat Jun 25, 2005 3:07 am

I'll see if I can get to it this weekend--schedule's pretty full though. :roll:
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA

Postby llj143 on Tue Jun 28, 2005 4:43 pm

hey nice work just use it.. and works nice..

please if you have time, hope you can work also for view profile, memberlist, and viewforum :)
llj143
Registered User
Registered User
 
Posts: 288
Joined: Mon May 09, 2005 1:31 am

Postby kvfb97 on Fri Dec 23, 2005 6:22 pm

This will add it to the memberlist page :D

Code: Select all

#-----[ OPEN ]------------------------------------------ 

memberlist.php


#-----[ FIND ]------------------------------------------ 
#
$sql = "SELECT username, user_id,


#-----[ IN-LINE FIND ]------------------------------------------ 
#
user_id,


#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 

user_level,


#-----[ FIND ]------------------------------------------ 
#
      $username = $row['username'];


#-----[ REPLACE WITH ]------------------------------------------ 
#
      $user_level = $row['user_level'];
      $user_style = ( $user_level == ADMIN ) ? '<span style="color: #' . $theme['fontcolor3'] . '">' : ( ( $user_level == MOD ) ? '<span style="color: #' . $theme['fontcolor2'] . '">' : '<span>' );
      
      $username = $user_style.$row['username'].'</span>';
Tip: Don't argue with idiots, they'll drag you down to their level and beat you with experience.
User avatar
kvfb97
Registered User
Registered User
 
Posts: 1774
Joined: Mon Aug 02, 2004 8:18 am
Location: Northern Ireland, UK


Return to eXtreme Styles mod tutorials

Who is online

Users browsing this forum: No registered users and 1 guest