Automiatc Specific User Text Colouring

mastram

New Member
The mod is simple, it allows you to set a specific colour for a usergroup you set so when a member of that usergroup post it is automaticly posted as the colour you've set. however the colour can be changed if the user seletes a different colour from the text colours

Please note you will have to edit the code to any layout(s) you have and want it to show on.

First login to your admincp --> Style Manager --> Edit Templates

In your postbit find
PHP:
<!-- message --> 
<div id="post_message_$post[postid]">$post[message]</div> 
<!-- / message -->

replace with
PHP:
<!-- message -->              
<if condition="(in_array($post['usergroupid'],  array('6', '#', '#', '#')))"> 
    <div class="VIP_$post[usergroupid]" id="post_message_$post[postid]">$post[message]</div> 
<else /> 
<div id="post_message_$post[postid]">$post[message]</div> 
</if> 

<!-- / message -->

where the # are you put the user groups id for example if i wanted to set my admin, id put
PHP:
<if condition="(in_array($post['usergroupid'],  array('6')))">

after you are happy with this click save.

If your using legacy, make sure you edit postbit_legacy instead of or aswell as postbit.

once this is done go to your Main CSS and add in "Additional CSS Definitions" the following

Code:
 .VIP_# { color:#000000 }
.VIP_# { color:#ffffff }
# replace with the group id and click Save.

Remember that if you have more then one forum skin you will have to edit the code thoughout them inorder for it to show.
 
this is for 3.7.3 updated template

Find this

HTML:
<!-- message -->
		<div id="post_message_$post[postid]">
			$ad_location[ad_showthread_firstpost_start]
			$post[message]
		</div>
		<!-- / message -->

Replace with this:

HTML:
<!-- message -->              
<if condition="(in_array($post['usergroupid'],  array('6', '#', '#', '#')))"> 
    <div class="VIP_$post[usergroupid]" id="post_message_$post[postid]">$post[message]</div> 
<else /> 
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]</div> 
</if> 

<!-- / message -->



Thanks to mastram for this nice hack
 
is this hack change the color on the username? this will show the color on the last post page?

some body know if this hack o another hack can change the color for users on the templates like last post.?

thanks....


elkora...
 
Back
Top