mChat Color text for founder or administrator

Support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Forum rules
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
User avatar
FranckTH
Member
Member
Posts: 68
Joined: 29 Jul 2011, 16:06

mChat Color text for founder or administrator

Post by FranckTH »

Hi,

Just a question... it's possible to change the text color for admin and founder on mChat with red color, and all members in black ?

thanls for help :beer: ;)
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Post by RMcGirr83 »

You can try within the mchat.php file, within the case 'add', replacing this

Code: Select all

$message = utf8_normalize_nfc(request_var('message', '', true));


with this

Code: Select all

$message = utf8_normalize_nfc(request_var('message', '', true));
$message = ($auth->acl_get('a_') || $user->data['user_type'] == USER_FOUNDER) ? '[color=#BF0000]' . $message . '[/color]' : $message;
User avatar
FranckTH
Member
Member
Posts: 68
Joined: 29 Jul 2011, 16:06

Re: mChat Color text for founder or administrator

Post by FranckTH »

very nice thanks so more :beer: ;)
User avatar
FranckTH
Member
Member
Posts: 68
Joined: 29 Jul 2011, 16:06

Re: mChat Color text for founder or administrator

Post by FranckTH »

Code: Select all

$message = ($auth->acl_get('m_') || $user->data['user_type'] == USER_MODERATOR) ? '[color=#346600]' . $message . '[/color]' : $message;


it's ok for moderator ? (not error) ? ;)
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Post by RMcGirr83 »

For moderators and admins and founders, probably something like this

Code: Select all

$message = ($auth->acl_get('a_') || $user->data['user_type'] == USER_FOUNDER) ? '[color=#BF0000]' . $message . '[/color]' : (($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? '[color=green]' . $message . '[/color]' : $message);


There is no definition for USER_MODERATOR. USER_FOUNDER is retrieved from includes/constants.php

Code: Select all

define('USER_FOUNDER', 3);
User avatar
FranckTH
Member
Member
Posts: 68
Joined: 29 Jul 2011, 16:06

Re: mChat Color text for founder or administrator

Post by FranckTH »

ok thanks for your knowledge ;) :beer:
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: mChat Color text for founder or administrator

Post by Sniper_E »

Man, you programmers always have to do things the technical way.

I would edit the mchat_avatars.html

Code: Select all

<div class="avatarMessage mChatMessage" style="color: #{mchatrow.MCHAT_USERNAME_COLOR}">{mchatrow.MCHAT_MESSAGE}</div>
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Post by RMcGirr83 »

One doesn't have to be in the moderator group set as default to have moderator permissions. Same is said for administrators.
User avatar
FranckTH
Member
Member
Posts: 68
Joined: 29 Jul 2011, 16:06

Re: mChat Color text for founder or administrator

Post by FranckTH »

i'm testing snippet to color for admin the text in mChat

but i've got a little problem when i click on pseudo to respond to user...

example :

Code: Select all

@ [b][color=#660099]nataniel[/color][/b], welcome ;)
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Post by RMcGirr83 »

You have to do the same/similar for the case 'edit' before it is saved back to the database.
stonecityboys
New member
New member
Posts: 5
Joined: 22 Aug 2012, 06:46

Re: mChat Color text for founder or administrator

Post by stonecityboys »

Hi there,

I had the same problem with the members , admins color and i found the solution from here, BUT i get another issue with the bbcode.

When i add a bbcode lets say :beer: in the chat writes : beer : (without the space) :beer:

What must i do about it?
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Post by RMcGirr83 »

it is a bbcode and not a smiley?
stonecityboys
New member
New member
Posts: 5
Joined: 22 Aug 2012, 06:46

Re: mChat Color text for founder or administrator

Post by stonecityboys »

Yes my friend you are right.There are smilies....Any solution for these?

What must i do?
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Post by RMcGirr83 »

Sorry without space turns this

: beer :

into this

:beer: which if there is a smiley setup for that will parse as :beer:
stonecityboys
New member
New member
Posts: 5
Joined: 22 Aug 2012, 06:46

Re: mChat Color text for founder or administrator

Post by stonecityboys »

Do you mean to make it manual when i type it?
The problem is that when i press a smile in text area typed normal but when i press enter the first smile txt appears as it is and the second, third etc appears as it must be...
Post Reply