Ishimaru-Design > Home > Tutorials > phpBB2 > Simple Colored Usergroups Add-ons for MODs

[phpBB2] Simple Colored Usergroups Add-ons for MODs

  • Author : Ishimaru Chiaki
  • Posted on : 2013-10-24 05:17:21
  • Updated on : 2013-10-27 08:13:03
  • Comments : 0
  • Type : MODs Add-ons
  • Level : Newbie

The "Simple Colored Usergroups" MOD developed by kkroo, and its SCU_global patch are quite popular among phpBB2 admins and it's often used with other MODs.  So several phpBB2 admins might have noticed the usernames aren't colored in blocks or pages added by MOD installations, such as subforums and birthdays.
For this reason, I wrote this tutorial years ago in order to propose patches to adapt Simple Colored Usergroups to frequently used MODs.  These addons have been tested on a local phpBB 2.0.22 board and were used on Ishimaru Design when it used to run phpBB2.

Summary

  1. Add-on for Simple Subforums
  2. Add-on for Birthday MOD
  3. Add-on for Watched topics MOD
  4. Add-on for Admin Userlist MOD

Add-on for Simple Subforums

If you installed this MOD, here are the directions to follow, so the usernames and groups will be colored in the subforums block in viewforum.php

Get your Wordpad/Notepad++ ready !

OPEN

viewforum.php

FIND

    $subforum_moderators[$row['forum_id']][] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';

BEFORE, ADD

    $mod_color = ($user_color = color_groups_user($row['user_id'])) ? 'style="font-weight:bold;color: #' . $user_color . '" ' : '';

IN LINE, FIND

href="

IN LINE, BEFORE, ADD

' . $mod_color . '

FIND

    $sql = "SELECT aa.forum_id, g.group_id, g.group_name 

IN LINE, FIND

g.group_name

IN LINE, AFTER, ADD

, g.group_colors

FIND

        $subforum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' .     $row['group_name'] . '</a>';

BEFORE, ADD

        // unserialize group color
        $row_group_colors = unserialize( $row['group_colors'] );

        // get color for current style
        if ( ! $userdata['session_logged_in'] )
        {
            $group_color = $row_group_colors[ $board_config['default_style'] ];
        }
        else
        {
            $group_color = $row_group_colors[ $userdata['user_style'] ];
        }

        $mod_group_color = ( !empty( $group_color ) ) ? 'style="font-weight:bold;color: #' . $group_color . '" ' : '';

IN LINE, FIND

href="

IN LINE, BEFORE, ADD

' . $mod_group_color . '

FIND

                $last_post .= ( $subforum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($subforum_data[$j]['post_username'] != '' ) ? $subforum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '='  . $subforum_data[$j]['user_id']) . '">' . $subforum_data[$j]['username'] . '</a> ';

BEFORE, ADD

                                $style_color = ($user_color = color_groups_user($subforum_data[$j]['user_id'])) ? 'style="font-weight:bold;color: #' . $user_color . '" ' : '';

IN LINE, FIND

href="

IN LINE, BEFORE, ADD

' . $style_color . '

SAVE AND CLOSE FILE

0 comments - Next