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)
Ideas Centre
Locked
User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Default Post Colour

Post by Netframe » Fri Jul 15, 2011 4:22 pm

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 » Fri Jul 15, 2011 5:20 pm


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

Re: Default Post Colour

Post by Mick » Fri Jul 15, 2011 6:05 pm

Moved to "MOD Requests" at user request.
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.
Forza Garibaldi

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 » Fri Jul 15, 2011 9:05 pm

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 » Fri Jul 15, 2011 9:57 pm

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 » Fri Jul 15, 2011 10:16 pm

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 » Fri Jul 15, 2011 10:25 pm

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 » Fri Jul 15, 2011 10:30 pm

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 » Tue Oct 04, 2011 2:17 pm

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 » Tue Oct 04, 2011 5:27 pm

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 » Sun Aug 09, 2015 6:54 am

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

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: No registered users and 21 guests

cron