MyBB Community Forums

Full Version: Color postbit background for certain forum and certain group
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,

as the subjects says, i am looking for something to give a specific group a different background color on the postbit.
This should be for a specific forum only. I already have template conditionals installed, if that is necessary. Would just need a code.

Where the color should go for example: http://prntscr.com/bhuri8
http://community.mybb.com/thread-134747.html

You just need to change which bit you want colored for user groups.
I already saw that. The thing is that it doesn't say how to make it for a specific forum only.
I still need this, no one knows?
Use this.

Search

<div class="post {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">

replace to

<if $usergroup['gid']==4 && $fid==25 then>
<div class="post post{$usergroup['gid']} {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">
<else>
<div class="post {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">
</if>

search

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

replace to

 <if $usergroup['gid']==4 && $fid==25 then>
 <div class="post_body scaleimages" id="pid_{$post['pid']} post{$usergroup['gid']}">
 {$post['message']}
 </div>
 <else>
 <div class="post_body scaleimages" id="pid_{$post['pid']}">
 {$post['message']}
 </div>
 </if>

$usergroup['gid']==4  -> change 4 to your group
$fid==25  -> change 25 to your forums fid
That won't work, you can't have a space in an ID tag like that really.

You don't need template conditionals or anything, in your postbit template find:

<div class="post {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">

change to:

<div class="post forum-{$fid} group-{$usergroup['gid']} {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">

Then create a CSS selector like this:

.post.forum-X.group-Y {
    // css here
}

Change the X and Y to the ID of the forum and group respectively.
(2016-08-13, 11:54 AM)Matt Wrote: [ -> ]change to:

<div class="post forum-{$fid} group-{$usergroup['gid']} {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">

If i add this, the forum postbit turns into the horizontal mode, even though i use the classic postbit mode.
However the background color worked fine, thanks.

If only you could give a fix for that issue too.^^
Not sure what you mean to be honest, adding this is going to have no effect on the entire template that gets loaded, unless you copied the entire postbit template into postbit_classic?

Literally all the change is is adding

forum-{$fid} group-{$usergroup['gid']}

after

<div class="post

with a space between, in both the postbit and postbit_classic template. Doing that can't change which postbit layout gets displayed.
Found out whats wrong.

When adding this on the classic postbit, you need to consider the "classic" after the post, otherwise you just get the horizontal postbit.

<div class="post classic forum-{$fid} group-{$usergroup['gid']} {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">
Hm, fair enough, didn't notice it had its own class too. The forum-{$fid} group-{$usergroup['gid']} bit is the important bit.
Pages: 1 2