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

Postby FranckTH » 24 May 2012, 13:14

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
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Postby RMcGirr83 » 24 May 2012, 14:03

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

Postby FranckTH » 24 May 2012, 17:57

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

Postby FranckTH » 24 May 2012, 18:28

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
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Postby RMcGirr83 » 24 May 2012, 18:32

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

Postby FranckTH » 24 May 2012, 18:35

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

Re: mChat Color text for founder or administrator

Postby Sniper_E » 24 May 2012, 18:42

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
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Postby RMcGirr83 » 24 May 2012, 18:54

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

Postby FranckTH » 24 May 2012, 20:10

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
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Postby RMcGirr83 » 24 May 2012, 21:01

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

Postby stonecityboys » 22 Aug 2012, 11:10

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
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Postby RMcGirr83 » 22 Aug 2012, 15:49

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

Postby stonecityboys » 22 Aug 2012, 16:27

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

What must i do?

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: mChat Color text for founder or administrator

Postby RMcGirr83 » 22 Aug 2012, 16:52

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

Postby stonecityboys » 22 Aug 2012, 17:14

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...


Return to “Modders MOD support”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 1 guest