MyBB Community Forums

Full Version: Using <if> statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've edited my signature postbit template but I wan't the code I added to only display if the user belong to a specific usergroup... how?
(2012-05-23, 12:32 AM)anori Wrote: [ -> ]http://mybbhacks.zingaburga.com/showthread.php?tid=464

Use that plugin.

How do I use it?
I can not seem to find installation instructions... And normally a plugin contains more than a single php script...
(2012-05-23, 12:38 AM)Raven- Wrote: [ -> ]
(2012-05-23, 12:32 AM)anori Wrote: [ -> ]http://mybbhacks.zingaburga.com/showthread.php?tid=464

Use that plugin.

How do I use it?
I can not seem to find installation instructions... And normally a plugin contains more than a single php script...

Simply upload the content of the file to your server. Which only seem to be two files then go to your:
ACP > configuration > plugins > click install (if needed) > click activate

And thats it not much more to it.
example if using the plugin

<if $GLOBALS['mybb']->user['usergroup'] == 4 then> stuff for usergroup 4</if>
Sorry for late reply but it does not seem to be working.
Try this:

<if in_array($GLOBALS['users']['usergroup'], array(2,4)) then>
//Anything here shows only for usergroup 2 and 4
</if>
(2012-05-24, 06:39 AM)crazy4cs Wrote: [ -> ]Try this:

<if in_array($GLOBALS['users']['usergroup'], array(2,4)) then>
//Anything here shows only for usergroup 2 and 4
</if>
Nothing happens..
Then you've got something wrong. The above code is perfect and works fine. Try deactivating and reactivating the plugin. And make sure you're logged in as right usergroup.

And also, the above code IS NOT exact if that is what you think, from the given code of mine, you need to replace:

//Anything here shows only for usergroup 2 and 4

with the variable you want to appear only to specified groups. In your case, it should be the postbit signature code.
(2012-05-24, 07:27 AM)crazy4cs Wrote: [ -> ]Then you've got something wrong. The above code is perfect and works fine. Try deactivating and reactivating the plugin. And make sure you're logged in as right usergroup.

And also, the above code IS NOT exact if that is what you think, from the given code of mine, you need to replace:

//Anything here shows only for usergroup 2 and 4

with the variable you want to appear only to specified groups. In your case, it should be the postbit signature code.

I already did, I actaully replaced
"<if in_array($GLOBALS['users']['usergroup'], array(2,4)) then>"
with
"<if in_array($GLOBALS['users']['usergroup'], array(1,2,3,4,5,6,7,8,9)) then>"
to be hundred percent sure but still nothing appears.
Pages: 1 2