MyBB Community Forums

Full Version: Image behind avatar using <if> statements
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Alright you beautiful people, i'm going to apologize in advanced if this was already done.  But that being said i'm trying to figure out how to add a "image" behind the person's avatar.  As shown in the image below.  I'm now trying to learn how to to different pictures for each group using <if> statements. 

[Image: 687474703a2f2f692e696d6775722e636f6d2f6b...382e706e67]
Do you have the plugin php & conditionals for mybb installed?
(2017-03-13, 04:29 AM)Lunorian Wrote: [ -> ]Do you have the plugin php & conditionals for mybb installed?

Ya bro, still can't seem to get the <if> statements to work
What do you mean an image behind their avatar? Do you mean you want to have a padded background-image div box with the avatar inside?

Also to user usergroup conditionals for postbit, this is how to do this.

<if $post['usergroup'] == # then>content here</if>

Just replace each # with the usergroup number, which you can get from the Groups section in your AdminCP.
You could technically do something like this...

Find the below code in your postbit_classic template.
<div class="post_author scaleimages">

Replace it with the following.
<div class="post_author author_bg_{$usergroup['gid']} scaleimages">

Open global.css and add your CSS classes.
.author_bg_4 {
    background: url(images/postauthorimages/background4.png) no-repeat !important;
}

.author_bg_5 {
    background: url(images/postauthorimages/background5.png) no-repeat !important;
}

The numbers represent the group ids. You can find these ids by hovering over a group's name in your Admin CP. With this method there's no use of a plugin so you don't need it.