Default Post Colour

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Get Involved
User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Default Post Colour

Post by Netframe »

I'm on a roll with questions today, and I apologize...

I'm seeking a way to make it so admins and moderators have a post colour by default, so when they post, their text is a different colour.. I'm unsure on how to do this..

As an example.. on Blizzard Entertainment's battle.net, their mods, and admins post in blue text by default, with out having to use the font colour.

Thanks! :)
Pit$Bull
Former Team Member
Posts: 23099
Joined: Sat Dec 02, 2006 4:08 pm
Name: Can't Remember

Re: Default Post Colour

Post by Pit$Bull »

User avatar
Mick
Support Team Member
Support Team Member
Posts: 26829
Joined: Fri Aug 29, 2008 9:49 am

Re: Default Post Colour

Post by Mick »

Moved to "MOD Requests" at user request.
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: Default Post Colour

Post by Ather »

i've made a quick and dirty hack, maybe it can be useful

with my code, you can either colorize your posts by the poster's rank or his rank color

for prosilver, open styles/prosilver/templates/viewtopic_body.html

find : <div class="content">{postrow.MESSAGE}</div>
replace with :
<div class="content"><!-- IF postrow.RANK_TITLE eq 'Site Admin' --><font color="red">{postrow.MESSAGE}</font><!-- ELSE -->{postrow.MESSAGE}<!-- ENDIF --></div>
the above code is based on User's rank, e.g if the rank is Site Admin, it will show red color, else normal black message

Option 2:
<div class="content"><!-- IF postrow.POST_AUTHOR eq 'admin' --><font color="red">{postrow.MESSAGE}</font><!-- ELSE -->{postrow.MESSAGE}<!-- ENDIF --></div>
this code is based on username, if the poster is a user named admin, color will be red

screenshot: (click to enlarge)
Image
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets
User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Default Post Colour

Post by Netframe »

Ather wrote:i've made a quick and dirty hack, maybe it can be useful

with my code, you can either colorize your posts by the poster's rank or his rank color

for prosilver, open styles/prosilver/templates/viewtopic_body.html

find : <div class="content">{postrow.MESSAGE}</div>
replace with :
<div class="content"><!-- IF postrow.RANK_TITLE eq 'Site Admin' --><font color="red">{postrow.MESSAGE}</font><!-- ELSE -->{postrow.MESSAGE}<!-- ENDIF --></div>
the above code is based on User's rank, e.g if the rank is Site Admin, it will show red color, else normal black message

Option 2:
<div class="content"><!-- IF postrow.POST_AUTHOR eq 'admin' --><font color="red">{postrow.MESSAGE}</font><!-- ELSE -->{postrow.MESSAGE}<!-- ENDIF --></div>
this code is based on username, if the poster is a user named admin, color will be red

screenshot: (click to enlarge)
Image
You're the best!!!! Thank you so much!

Oh! One more thing... can I add 2 of those? One for my moderators, and the admins? I set up the Admins, but I'd like my mods to post in other colors too :)
Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: Default Post Colour

Post by Ather »

yes its possible, if your mod's rank is for example called : Moderators, then you can alter the code as follows :

Code: Select all

<div class="content"><!-- IF postrow.RANK_TITLE eq 'Site Admin' --><font color="#AA0000">{postrow.MESSAGE}</font><!-- ELSEIF postrow.RANK_TITLE eq 'Moderator' --><font color="green">{postrow.MESSAGE}</font><!-- ELSE -->{postrow.MESSAGE}<!-- ENDIF --></div>
basically to add more, you do <!-- ELSEIF postrow.RANK_TITLE eq 'Moderator' --><font color="green">{postrow.MESSAGE}</font> just change the title in quotes and the color
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets
User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Default Post Colour

Post by Netframe »

Ather wrote:yes its possible, if your mod's rank is for example called : Moderators, then you can alter the code as follows :

Code: Select all

<div class="content"><!-- IF postrow.RANK_TITLE eq 'Site Admin' --><font color="#AA0000">{postrow.MESSAGE}</font><!-- ELSEIF postrow.RANK_TITLE eq 'Moderator' --><font color="green">{postrow.MESSAGE}</font><!-- ELSE -->{postrow.MESSAGE}<!-- ENDIF --></div>
basically to add more, you do <!-- ELSEIF postrow.RANK_TITLE eq 'Moderator' --><font color="green">{postrow.MESSAGE}</font> just change the title in quotes and the color
Awesome! I have one more question... the colours are overriding white text... is there a way to fix that, or am I going to have to deal with it?

Like, I made a BBcode to bold and highlight text #FFFFFF, but it's now making it my admins colours, which is lightblue... is there a way to fix that, or ..?
User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Default Post Colour

Post by Netframe »

Never mind, I was able to fix it by change the bbcode to <font color> :)

Thank so much again!!!!
sweet.ksh
Registered User
Posts: 101
Joined: Thu Sep 15, 2011 12:11 pm

Re: Default Post Colour

Post by sweet.ksh »

i add it but it is not working my forum version is 3.9 plz help me
User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: Default Post Colour

Post by 4_seven »

Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Default Post Colour

Post by Netframe »

I can't get this to work anymore, any suggestions?

Return to “[3.0.x] MOD Requests”