PDA

View Full Version : Force usergroups to post in a different font color by default


SiK GambleR
01-07-2009, 02:33 AM
For one, I'm wondering if this is possible?

Two, where would I place code for something like this?

Three, can someone help me make/find a code that would work for this.

An example would be something like the staff on Blizzard forums; they post in blue for every post, indicating that they are the staff. I want to do something to that effect.

Lynne
01-07-2009, 02:43 AM
I think I already posted this in the other thread for changing the background color inline, but here is it for changing the color and with the conditions. You will need to find which td tag you are interested in changing and then just add the color part. If you have problems, post the code you tried and tell us the outcome.

<if condition="is_member_of($post, X)">
<td class="alt2" id="td_post_$post[postid]" style="color: yellow;">
<else />
<if condition="is_member_of($post, Y)">
<td class="alt2" id="td_post_$post[postid]" style="color: red;">
<else />
<td class="alt2" id="td_post_$post[postid]" style="color: blue;">
</if>
</if>

SiK GambleR
01-07-2009, 02:51 AM
I'm confused.
I don't know what a td tag is.
I know nearly nothing about this coding.

I'm trying to learn, but I know what I want done.

With this statement:
<if condition="is_member_of($post, X)">

Do I edit the "X" with the user, or the usergroup, or do I leave it as "X?"

In the statement:
<td class="alt2" id="td_post_$post[postid]" style="color: yellow;">

Is "alt2" the td tag that you told me to find?

Lynne
01-07-2009, 03:04 AM
X is the usergroupid - you would not leave it as X, but change it to the userid you want.


Lets say you want to change the font in the main post area. You would need to find that area. You will find it by looking for <!-- message --> in the postbit, or postbit_legacy depending on which you use, template. Let's assume you don't care about the post title and instead only the color of the post itself. In that case, we will just use the div tag right below the <!-- message --> (it's in red and it's for a 3.8 template - yours may be different):
<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]
</div>
<!-- / message -->Now you would use the conditions I posted above. Let's say you only care about administrators, groupid 6, supermods, groupid 5, and then the rest of the posters. You want admins in yellow, supermods in red, and everyone else in blue. So, you'd do this *in place of* the stuff in red above:

<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<if condition="is_member_of($post, 5)">
<div id="post_message_$post[postid]" style="color: red;">
<else />
<div id="post_message_$post[postid]" style="color: blue;">
</if>
</if>

SiK GambleR
01-07-2009, 03:09 AM
X is the usergroupid - you would not leave it as X, but change it to the userid you want.


Lets say you want to change the font in the main post area. You would need to find that area. You will find it by looking for <!-- message --> in the postbit, or postbit_legacy depending on which you use, template. Let's assume you don't care about the post title and instead only the color of the post itself. In that case, we will just use the div tag right below the <!-- message --> (it's in red and it's for a 3.8 template - yours may be different):
<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]
</div>
<!-- / message -->Now you would use the conditions I posted above. Let's say you only care about administrators, groupid 6, supermods, groupid 5, and then the rest of the posters. You want admins in yellow, supermods in red, and everyone else in blue. So, you'd do this *in place of* the stuff in red above:

<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<if condition="is_member_of($post, 5)">
<div id="post_message_$post[postid]" style="color: red;">
<else />
<div id="post_message_$post[postid]" style="color: blue;">
</if>
</if>

Could I add in the following, without removing what is in red of your post?

<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
</if>

I can do it the way you want, but I think it would be easier to just have it override for admins only, and leave the rest of the usergroups as default

Lynne
01-07-2009, 03:11 AM
If you only want it for admins, then replace my second box of code with:

<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<div id="post_message_$post[postid]" style="color: blue;">
</if>

or

<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<div id="post_message_$post[postid]">
</if>

SiK GambleR
01-07-2009, 03:21 AM
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<div id="post_message_$post[postid]">
</if>

That forced my text to be yellow, but for some reason, all of my post content was removed, from every post. It came back when I put the original code back, though.

Lynne
01-07-2009, 03:26 AM
It was yellow because it says "color: yellow" Post exactly what that part of your template looked like after you changed it if you want help fixing it. I can't tell what you did wrong if you don't show me exactly what you did.

SiK GambleR
01-07-2009, 03:30 AM
Here is my code:

<!-- message -->
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: #60fffd;">
<else />
<div id="post_message_$post[postid]">
</if>
<!-- / message -->

Bellardia
01-07-2009, 03:40 AM
Here is my code:

<!-- message -->
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: #60fffd;">
<else />
<div id="post_message_$post[postid]">
</if>
<!-- / message -->


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

Lynne
01-07-2009, 03:41 AM
I said in post 4 "you'd do this *in place of* the stuff in red above". You got rid of more than just the stuff in red. You need to only put the conditions in place of the stuff in red, leave the rest alone.

edit: Looks like Bellardia posted the correct code.

SiK GambleR
01-07-2009, 03:46 AM
I said in post 4 "you'd do this *in place of* the stuff in red above". You got rid of more than just the stuff in red. You need to only put the conditions in place of the stuff in red, leave the rest alone.

edit: Looks like Bellardia posted the correct code.

The part that she posted was not in my code beforehand, but it does work now.

Bellardia
01-07-2009, 03:56 AM
The part that she posted was not in my code beforehand, but it does work now.

That's because you removed it, and I put it back in for you ;)

SiK GambleR
01-07-2009, 04:12 AM
That's because you removed it, and I put it back in for you ;)

I meant, the code wasn't there when I went to edit it.
I'm not the only administrator on the board, though, so someone else probably deleted it earlier by accident.