MyBB Community Forums

Full Version: If Statements for Groups
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So what I am attempting to do is put a little badge under the {$post['user_details']} that will show STAFF MEMBER. My issue right now, is that it will show everyone with that tag, but I want it to only be on the postbit for users who are in staff "Groups", but anyone who isn't in the group will still be able to see it.

So: [Image: lJy3jMT.png]
Use the Group Image feature provided by MyBB already?
try this plugin.
I'm not trying to use a group image, I'm trying to use CSS, sorry if I wasn't as clear as I should've been.
if(!in_array( $post['usergroup'],[1,2,3] ))
    $post['staff_member'] = 'Staff Member';
(2016-01-23, 11:39 PM)LucidiousXIV Wrote: [ -> ]I'm not trying to use a group image, I'm trying to use CSS, sorry if I wasn't as clear as I should've been.

There is no such thing as conditional CSS statements, only selectors in a sense. With CSS alone, you won't be able to accomplish what you are trying to achieve.
Download Template Condtionals: http://mybbhacks.zingaburga.com/showthre...464&page=9

Then use this code:
<if is_member('1,2,3', $post) then>staff member html/css, change 1,2,3 to your staff group IDs</if>

You might need to add is_member() to the allowed functions .txt file.

EDIT; @down, what kind of a question is that..?
(2016-01-23, 11:48 PM)Destroy666 Wrote: [ -> ]Download Template Condtionals: http://mybbhacks.zingaburga.com/showthre...464&page=9

Then use this code:
<if is_member('1,2,3', $post) then>staff member html/css, change 1,2,3 to your staff group IDs</if>

You might need to add is_member() to the allowed functions .txt file.

Are you sure that it will do the groups and not just the Member ID?

[Image: Mols6G5.png]

(2016-01-23, 11:48 PM)Destroy666 Wrote: [ -> ]Download Template Condtionals: http://mybbhacks.zingaburga.com/showthre...464&page=9

Then use this code:
<if is_member('1,2,3', $post) then>staff member html/css, change 1,2,3 to your staff group IDs</if>

You might need to add is_member() to the allowed functions .txt file.

EDIT; @down, what kind of a question is that..?

I'm sorry that I'm not being as easy as I should be xD

What I mean is, do the numbers go by the Member ID, or the Group ID. I'm needing it to be by Group ID, so that anyone who is staff will have it on their postbit for everyone to see, but anyone who isn't won't have it.