MyBB Community Forums

Full Version: how to make a div visibile only to certain user groups?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi everybody,
i'm looking for a way to make a div visible only to my staff, so only to certain usergroups.
i really don't know how to do that ._.
i think i need to write down few lines of php, but i know nothing of that language... ç.ç

can you help me somehow, please...? ._.

thanks in advance for your help Smile
Install this plugin: http://community.mybb.com/thread-31860.html

Next you've to wrap your <div> with the following code;
<if $mybb->user['usergroup'] == "4" then>
<div>YOUR DIV CODE GOES HERE.</div>
</if>
wow, thanks ç.ç
thank you very much @.@
i really needed it @.@

but tell me one more thing please ^^
if i want to make that div visibile to more than one usergroup, do i have to write this?
<if ($mybb->user['usergroup'] == "4" or $mybb->user['usergroup'] == "5") then>
<div>YOUR DIV CODE GOES HERE.</div>
</if> 
correct?
Something like would also work;
$groups = '3,4,6,8';
<if in_array($mybb->user['usergroup'],$groups) then>
<div>YOUR DIV CODE GOES HERE.</div>
</if>

Replace 3,4,6,8 with comma separated usergroups you wish to show them that <div>
uhm thank you!
you made learn a bit of php Big Grin
now i now how to use arrays Wink

thank you again yalda Smile

uhm...
i need some help yet... ^^

how can i make the box appear only in certain pages?
i want to make it visibile only in this page "www.royalgame.org/newthread.php?fid=2"
i think i should write some code like "$mybb-forum['forumfid']" in place of "$mybb->user['usergroup']", but what's the correct variable?