Log in

View Full Version : change color of admin posts


peolit
11-18-2008, 01:54 PM
I'd like to make it so when an admin user makes a post, the background color or the font color of that post is different than that of regular registered users.
Anybody ever done this? I can't figure it out...

Any help would be great!!

Thanks.

Lynne
11-18-2008, 02:13 PM
This thread should help - https://vborg.vbsupport.ru/showthread.php?t=76483&highlight=color+staff+posts

peolit
11-18-2008, 04:24 PM
Thanks for the reply Lynn!

that thread helped change the font color of the post, but how could we change the color of the post background- for instance maybe change the blue bar (posbit.gif?) directly above your reply?

Lynne
11-18-2008, 05:16 PM
Put that same sort of code in the area where that bar is created. That row is by default defined by class thead, so change this line near the top of your postbit(_legacy) template:

<if condition="$post[usergroupid]=6">
<td style="background-color:yellow" $post[scrolltothis]>
<else />
<td class="thead" $post[scrolltothis]>
</if>

ibeteck
03-04-2009, 09:18 PM
Put that same sort of code in the area where that bar is created. That row is by default defined by class thead, so change this line near the top of your postbit(_legacy) template:

<if condition="$post[usergroupid]=6">
<td style="background-color:yellow" $post[scrolltothis]>
<else />
<td class="thead" $post[scrolltothis]>
</if>

Where would I add that code or replace what?

Lynne
03-04-2009, 09:27 PM
Where would I add that code or replace what?

....
so change this line near the top of your postbit(_legacy) template:

ibeteck
03-04-2009, 09:29 PM
I'am sorry but I don't know what line you are talking about. :(

wait i think i found it

that line is towards the middle though. This is what it looks like

<if condition="$post['signature']">
<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<!-- / sig -->
</if>

Lynne
03-04-2009, 09:41 PM
You realize that they are just looking to change the blue-bar above the reply - the one that has the date/time of the post (that is what they asked for in the post above the one I wrote out the template change). Is that what you are trying to change? If so, as I said in my post it is a line right near the top of the postbit(_legacy) that normally is class thead. So, this line in red:
<tr>
<td class="thead" $post[scrolltothis]>
<div class="normal" style="float:$stylevar[right]">
&nbsp;

ibeteck
03-04-2009, 09:47 PM
I'sam trying to change the background color to where the avatars and rank are located (the top side of this post) on my forum its the right because im using postbit_legacy. Thank you for helping me out.

Do you need the code for my postbit?

Lynne
03-04-2009, 09:58 PM
Well, then that is a different area than the area the poster was asking about. You need to find this line:
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px">And change it to something like:
<if condition="$post[usergroupid]==6">
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px; background-color: yellow">
<else />
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px">
</if>Change the stuff in red to what you want.

ibeteck
03-04-2009, 10:05 PM
One problem it changes the color for everyone

Lynne
03-04-2009, 10:07 PM
It shouldn't if you have that condition in place. What usergroupid did you use in the condition?

ibeteck
03-04-2009, 10:07 PM
i got it i was suppose to add a extra =

--------------- Added 1236211699 at 1236211699 ---------------

<if condition="$post[usergroupid]==6">
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px; background-color: purple">
<else />
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px">
</if>







thank you very much for all your help. I'am very gratefull. with the post this other guy made i can change the top bar that has the time you posted the thread right?

Lynne
03-04-2009, 10:11 PM
Whoops! That's what I get for copying stuff and not really looking at it!

ibeteck
03-04-2009, 10:12 PM
now i just want to match the top bar with the color with the code you supplied. If its not much to ask.

if i want to add the same thing to another usegroup do i just add something like this
<if condition="$post[usergroupid]==6""$post[usergroupid]==4">

Lynne
03-04-2009, 10:21 PM
<if condition="is_member_of($post[usergroupid], 4, 6)">

ibeteck
03-04-2009, 11:59 PM
ok got it how about if I want group 6 to be X color and group 4 to be Y color.

Lynne
03-05-2009, 03:07 AM
You could go:

<if condition="$post[usergroupid]==6">
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px; background-color: purple">
<else />
<if condition="$post[usergroupid]==4">
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px; background-color: red">
<else />
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px">
</if>
</if>

ibeteck
03-05-2009, 03:23 AM
i tried this code to add color to admins and mods text but everyones text turned into the color i chose.



<!--message-->
<div>
<if condition="is_member_of($post[usergroupid], 6, 7)">
<div style="color:#CCCC66">
</if>
$post[message]
<if condition="is_member_of($post[usergroupid], 6, 7)">
</div>
</if>
</div>
<!--message-->

Lynne
03-05-2009, 03:46 AM
When something doesn't work, you should post exactly what you did so we can see what went wrong. I have tried it on my forum and it works just fine. (And boy is purple very, very purple!)

Are you sure you have the correct usergroupids? (4 is usually the COPPA users)

ibeteck
03-05-2009, 03:58 AM
the code i posted on my last response is the one i used. and all the post text turns yellow i mean everyones text.

Lynne
03-05-2009, 04:10 AM
Just adding that one line is hopefully not all you did. I mean when you make a change, you should post ALL the code change like this (changed code shown in red):
<tr valign="top">
<if condition="is_member_of($post[usergroupid], 4, 6)">
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px; background-color: purple">
<else />
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px;">
</if>

<div id="postmenu_$post[postid]">
That is the code taken directly from the template I just modified and it turned all my admin posts purple (the userinfo part) and didn't touch anyone else's posts. So, if you have that exact code above, then I'll ask again about your usergroups. *What* is usergroupid 4 on your forum? Cuz that code changes it for all those in usergroup 4 and usergroup 6.

ibeteck
03-05-2009, 04:23 AM
That code change the bottom left border into yellow on postbit_legacy 6 is admin and 7 is mods. I want the text in the post to change for the mods also. here is the code im trying to use to change the admin and mod post text. the code for the color behind the avatars works fine its the one for the post text.

<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
<!--message-->
<div>
<if condition="is_member_of($post[usergroupid], 6, 7)">
<div style="color:#CCCC66">
</if>
$post[message]
<if condition="is_member_of($post[usergroupid], 6, 7)">
</div>
</if>
</div>
<!--message-->
</div>
<!-- / message -->

<if condition="$show['attachments']">

Lynne
03-05-2009, 03:08 PM
If the code I posted only changed a border, then you are posting it in the wrong place or something. Images and posting your code (with a couple lines before and after the change) always helps if something isn't working.

This should (I haven't tested it) change the text color just for posts by a user in group 6 or 7:

<!--message-->
<div <if condition="is_member_of($post[usergroupid], 6, 7)">style="color:#CCCC66"</if>>
$post[message]
</div>
<!--message-->
</div>
<!-- / message -->

ibeteck
03-05-2009, 03:36 PM
I tried the code but it still didnt work I'am posting it in postbit_legacy. does the red text have anything to do with it.

Lynne
03-05-2009, 03:42 PM
I just tested that code and it works just fine on my test board. My posts now look like this from the two edits I've tried out of yours. Other users posts are completely normal.
95950

ibeteck
03-05-2009, 03:50 PM
Did you put it in the postbit? also this is the code I put i modified it a little and now it give colors to all the special groups but not to members

<!--message-->
<div>
<if condition="is_member_of($post[usergroupid], 6, 7)">
<div style="color:#CCCC66">
</if>
$post[message]
</div>
<!--message-->
</div>
<!-- / message -->

Lynne
03-05-2009, 03:53 PM
I put my code in the postbit_legacy template (that is what is shown in the image).

Your code is going to cause your page to not validate since you are missing a </div> tag.

ibeteck
03-05-2009, 03:57 PM
like this

<!--message-->
<div>
<if condition="is_member_of($post[usergroupid], 6, 7)">
<div style="color:#CCCC66">
</div>
</if>
$post[message]
</div>
<!--message-->

Lynne
03-05-2009, 04:03 PM
like this

<!--message-->
<div>
<if condition="is_member_of($post[usergroupid], 6, 7)">
<div style="color:#CCCC66">
</div>
</if>
$post[message]
</div>
<!--message-->
No, that won't work. Did you try what I posted? Actually copy/paste it over what is between the <!-- message --> area? As you can see in my image, it worked fine.

ibeteck
03-05-2009, 04:12 PM
Yes I copy and pasted it the same results this is where I placed the code

<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
<!--message-->
<div <if condition="is_member_of($post[usergroupid], 6, 7)">style="color:#CCCC66"</if>>
$post[message]
</div>
<!--message-->
</div>
<!-- / message -->
<if condition="$show['attachments']">
<!-- attachments -->
<div style="padding:$stylevar[cellpadding]px">

Lynne
03-05-2009, 04:23 PM
And what was the result when you pasted that in? All you said was "it doesn't work" and that doesn't tell me anything.

ibeteck
03-05-2009, 04:42 PM
it makes everyones post text yellow with the exeption of the members group. lets say it turns 6,7 thats ok but then it also turn 15,21,23. those groups i dont want the post text yellow i want it the deault color white

Lynne
03-05-2009, 07:29 PM
That should not happen unless the users in group 15, 21, and 23 are also users in group 6 or 7.

ibeteck
03-05-2009, 08:20 PM
thats what i find weird the users in 15, 21, and 23 are not in groups 6 or 7. I got it it was like this

<!--message-->
<div <if condition="is_member_of($post, 6, 7)">style="color:#CCCC66"</if>>
$post[message]
</div>
<!--message-->