Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Phpbb3 custom user group

Frug edited this page Oct 18, 2012 · 1 revision

How to display members of a custom user group in a custom color (phpBB3)

Note: Before adding this MOD you should back up all AJAX Chat files related to this MOD.

OPEN

chat/lib/config.php

FIND

// Define AJAX Chat user roles:

ADD AFTER
Tip: Add this line on a new blank line after the preceding line to find.

if(!defined('AJAX_CHAT_VIP')) define('AJAX_CHAT_VIP', 5);

OPEN

chat/lib/class/CustomAJAXChat.php

FIND

            if($auth->acl_get('a_'))
                $userData['userRole'] = AJAX_CHAT_ADMIN;
            elseif($auth->acl_get('m_'))
                $userData['userRole'] = AJAX_CHAT_MODERATOR;
            else
                $userData['userRole'] = AJAX_CHAT_USER;

REPLACE WITH
Tip: Replace the preceding lines to find with the following lines.

            if($auth->acl_get('a_')) {
                $userData['userRole'] = AJAX_CHAT_ADMIN;
            } elseif($auth->acl_get('m_')) {
                $userData['userRole'] = AJAX_CHAT_MODERATOR;
            }    else {
                // Check if we have a member of our custom user group
                if($userData['groupID'] == 7)
                    $userData['userRole'] = AJAX_CHAT_VIP;
                else
                    $userData['userRole'] = AJAX_CHAT_USER;
            }
Note: You may have to replace the groupID 7 with the id number of your custom user group.

OPEN

chat/lib/class/AJAXChat.php

FIND

                    ($this->getUserRole() == AJAX_CHAT_MODERATOR || $this->getUserRole() == AJAX_CHAT_USER))

REPLACE WITH
Tip: Replace the preceding line to find with the following line.

                    ($this->getUserRole() == AJAX_CHAT_MODERATOR || $this->getUserRole() == AJAX_CHAT_VIP || $this->getUserRole() == AJAX_CHAT_USER))

FIND

            if($userData['userRole'] == AJAX_CHAT_USER || $userData['userRole'] == AJAX_CHAT_MODERATOR || $userData['userRole'] == AJAX_CHAT_ADMIN) {

REPLACE WITH
Tip: Replace the preceding line to find with the following line.

            if($userData['userRole'] == AJAX_CHAT_USER || $this->getUserRole() == AJAX_CHAT_VIP || $userData['userRole'] == AJAX_CHAT_MODERATOR || $userData['userRole'] == AJAX_CHAT_ADMIN) {

FIND

            } else if($this->getUserRole() == AJAX_CHAT_USER && $this->getConfig('allowUserMessageDelete')) {

REPLACE WITH
Tip: Replace the preceding line to find with the following line.

            } else if(($this->getUserRole() == AJAX_CHAT_USER || $this->getUserRole() == AJAX_CHAT_VIP) && $this->getConfig('allowUserMessageDelete')) {

OPEN

chat/js/chat.js

FIND

            if(this.userRole == 1 || this.userRole == 2 || this.userRole == 3) {

REPLACE WITH
Tip: Replace the preceding line to find with the following line.

            if(this.userRole == 1 || this.userRole == 2 || this.userRole == 3 || this.userRole == 5) {

FIND

        if((((this.userRole == 1 && this.allowUserMessageDelete && (userID == this.userID ||

REPLACE WITH
Tip: Replace the preceding line to find with the following line.

        if(((((this.userRole == 1 || this.userRole == 5) && this.allowUserMessageDelete && (userID == this.userID ||

FIND

                return 'chatBot';

ADD AFTER
Tip: Add these lines on a new blank line after the preceding line to find.

            case 5:
                return 'vip';

OPEN

chat/css/font.css

FIND

#content #chatList span.moderator {

ADD BEFORE
Tip: Add these lines on a new blank line before the preceding line to find.

#content #chatList span.vip {
    font-weight:bold;
}

OPEN

chat/css/[STYLE_NAME].css

FIND

    #content .moderator {

ADD BEFORE
Tip: Add these lines on a new blank line before the preceding line to find.

    #content .vip {
        color: #660099;
    }
Note: Do this change on all related .css files (incl. print.css). Specify the color you want to use.

OPEN

chat/css/shoutbox.css

FIND

#ajaxChatContent #ajaxChatList span.moderator {

ADD BEFORE
Tip: Add these lines on a new blank line before the preceding line to find.

#ajaxChatContent #ajaxChatList span.vip {
    font-size: 0.9em;
    font-weight: bold;
}

FIND

#ajaxChatContent .moderator {

ADD BEFORE
Tip: Add these lines on a new blank line before the preceding line to find.

#ajaxChatContent .vip {
    color: #660099;
}
Note: Specify the color you want to use.

EOM

Save all changed files and upload them to your website! It might be essential to purge the browsers
cache after all, just do it! If the installation went bad, simply restore your backed up files.