PDA

View Full Version : modify this code for admin group


MultiSync77F
12-09-2009, 08:12 PM
How do I change this to search for usergroups?

I found this code in my postbit template. I'm assuming its the code I need to use.

How do I modify this code to change the color of the text if the user is of the admin group? I have disabled colors BBCode and have a black skin. I want admins to have a blue type font but all other usergroups just use the normal font.


<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
if usergroup = admin <font color="#2d8fc4"><b>
$post[message]</font></b>

if usergroup not = admin $post[message]
</div>
<!-- / message -->


I don't know the PHP syntax

thanks

Lynne
12-09-2009, 09:13 PM
Easiest if probably just to modify this line:
<div id="post_message_$post[postid]">Change to:<div id="post_message_$post[postid]" <if condition="is_member_of($post, 6)">style="color:#2d8fc4"</if>>

MultiSync77F
12-09-2009, 10:22 PM
Thanks, I found that this works for me


<div>
<if condition="$post[usergroupid]==6">
<div style="color: #CC0000">
</if>
$post[message]
<if condition="$post[usergroupid]==6">
</div>
</if>
</div>
<!-- / message -->

Lynne
12-09-2009, 10:27 PM
Yeah, that will work also.