MyBB Community Forums

Full Version: Color All Post Backgrounds of a Usergroup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Is there a way to make this work for 2014?

Neither of my postbit, and postbit classic templates have:

<td class="trow2 post_content {$unapproved_shade}">
try post {$unapproved_shade} ?
(2013-02-17, 10:27 PM)effone Wrote: [ -> ]This tutorial is for those who want some specific usergroup's posts be different from the others. Like say all moderators' post background to be some different color. We can do it without using any plugin. Let's discuss about that trick today.

First we have to add a special class to our postbit templates to override the default post colors. For that open the template:

ACP > Templates & Styles > Templates > [Theme Name] Templates > Postbit Templates > postbit

and find:

<td class="trow2 post_content {$unapproved_shade}">

Now we have to add our special class post{$usergroup['gid']} to it. So, change the code to:

<td class="trow2 post_content post{$usergroup['gid']} {$unapproved_shade}">

Note that: You have to place the class
a) after class 'trow2' else the 'trow2' background color will govern.
b) before class'{$unapproved_shade}' so that Unapproved post's color can lead over any user's post.

Do the same thing with postbit_classic template. Open:

ACP > Templates & Styles > Templates > [Theme Name] Templates > Postbit Templates > postbit_classic

and find:

<div id="pid_{$post['pid']}" class="post_body">

Change the code to:

<div id="pid_{$post['pid']}" class="post_body post{$usergroup['gid']}">

Now the CSS, main trick part. Our dynamic class 'post{$usergroup['gid']}' will change at runtime based on group ID. ie. for all the posts of admins (default group ID is 4) it will be post4, for all the posts of members (default group ID is 2) it will be post2

So, as we said, if we want to target the specific group, for our example, say Moderators (default group ID is 6) we will declare our CSS class as .post6

Now, open your global.css and add at the end (or any suitable location):

.post6 { background: #FDB5FF; }

and save global.css.

Now the background of all posts made by any Moderator is a decent light pink.
We can change post backgrounds for as many usergroups as we wish using this trick, only we need to know the target group ID and change the number at the end of the class in css as per that group ID.

I was unable to find this in postbit
<td class="trow2 post_content {$unapproved_shade}">
My postbit classic is:

{$ignore_bit}
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<div class="post classic {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">
<div class="post_author scaleimages">
    {$post['useravatar']}
    <div class="author_information">
            <strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
            <span class="smalltext">
                {$post['usertitle']}<br />
                {$post['userstars']}
                {$post['groupimage']}
            </span>
    </div>
    <div class="author_statistics">
        {$post['user_details']}{$post['usercountry']}<br />{$post['usermood']}
    </div>
</div>
<div class="post_content">
    <div class="post_head">
        {$post['posturl']}
        {$post['icon']}
        <span class="post_date">{$post['postdate']} <span class="post_edit" id="edited_by_{$post['pid']}">{$post['editedmsg']}</span></span>
    {$post['subject_extra']}
    </div>
    <div class="post_body scaleimages" id="pid_{$post['pid']}">
        {$post['message']}
    </div>
 {$post['simplelikes']}
    {$post['attachments']}
    {$post['signature']}
    <div class="post_meta" id="post_meta_{$post['pid']}">
        
    </div>
</div>
<div class="post_controls">
    <div class="postbit_buttons author_buttons float_left">
        	{$post['quick_quote']}
		{$post['quick_quote']}
		{$post['quick_quote']}
	{$post['iplogged']}{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
    </div>
    <div class="postbit_buttons post_management_buttons float_right">
        {$post['button_edit']}{$post['button_quickdelete']}{$post['button_quickrestore']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_purgespammer']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}{$post['button_like']}
    </div>
</div>
</div>
  

I'm not able to see any of the codes i have to change here.
{$ignore_bit}
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<div class="post classic  post{$usergroup['gid']} {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">
<div class="post_author scaleimages">
    {$post['useravatar']}
    <div class="author_information">
            <strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
            <span class="smalltext">
                {$post['usertitle']}<br />
                {$post['userstars']}
                {$post['groupimage']}
            </span>
    </div>
    <div class="author_statistics">
        {$post['user_details']}{$post['usercountry']}<br />{$post['usermood']}
    </div>
</div>
<div class="post_content">
    <div class="post_head">
        {$post['posturl']}
        {$post['icon']}
        <span class="post_date">{$post['postdate']} <span class="post_edit" id="edited_by_{$post['pid']}">{$post['editedmsg']}</span></span>
    {$post['subject_extra']}
    </div>
    <div class="post_body post{$usergroup['gid']} scaleimages" id="pid_{$post['pid']}">
        {$post['message']}
    </div>
{$post['simplelikes']}
    {$post['attachments']}
    {$post['signature']}
    <div class="post_meta" id="post_meta_{$post['pid']}">
        
    </div>
</div>
<div class="post_controls">
    <div class="postbit_buttons author_buttons float_left">
            {$post['quick_quote']}
        {$post['quick_quote']}
        {$post['quick_quote']}
    {$post['iplogged']}{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
    </div>
    <div class="postbit_buttons post_management_buttons float_right">
        {$post['button_edit']}{$post['button_quickdelete']}{$post['button_quickrestore']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_purgespammer']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}{$post['button_like']}
    </div>
</div>
</div>

Try that
This works! Thank you.
Postbit doesn't find any matching codes :/
What is the code I have to put for the postbit? I cant find it.
thank u
Is it possible to just change there text color ?
Pages: 1 2 3 4