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 Birthday MOD

If you installed the Birthday MOD, here are the directions to follow, so the members who are having a birthday today or shortly will be shown with their group color.

Get your Wordpad/Notepad++ ready !

OPEN

index.php

FIND

            $color = '';
            if ( $row['user_level'] == ADMIN )
            {
                $color = ' style="color:#' . $theme['fontcolor3'] . '"';
            }
            else if ( $row['user_level'] == MOD )
            {
                $color = ' style="color:#' . $theme['fontcolor2'] . '"';
            }

REPLACE WITH

            // COLOR GROUPS ADDON FOR BIRTHDAYS
            $color = ($user_color = color_groups_user($row['user_id'])) ? 'style="font-weight:bold;color: #' . $user_color . '" ' : '';
            $username = '<span ' . $color . '>' . $username . '</span>';
            // COLOR GROUPS END

FIND

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

IN LINE, FIND

href="

IN LINE, BEFORE, ADD

' . $color . '

FIND

                $color = '';
                if ( $row['user_level'] == ADMIN )
                {
                    $color = ' style="color:#' . $theme['fontcolor3'] . '"';
                }
                else if ( $row['user_level'] == MOD )
                {
                    $color = ' style="color:#' . $theme['fontcolor2'] . '"';
                }

REPLACE WITH

                // COLOR GROUPS ADDON FOR BIRTHDAYS
                $color = ($user_color = color_groups_user($row['user_id'])) ? 'style="font-weight:bold;color: #' . $user_color . '" ' : '';
                $username = '<span ' . $color . '>' . $username . '</span>';
                // COLOR GROUPS END

FIND

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

IN LINE, FIND

href="

IN LINE, BEFORE, ADD

' . $color . '

SAVE AND CLOSE FILE

Previous - 0 comments - Next