MyBB Support

Looking for the php conditionals...

Submitted by AndresXZ09, , Thread ID: 1449

Thread Closed
21-02-2015, 12:44 AM
#1
Hello

I'd like to know which conditionals works on the custom pages (example, groups.php) and what is the group id conditional.

I tried with

Code:
<if $post['gid'] == 4 then>Stuff<else>More stuff</if>

But sadly doesn't work.

Thank you for your time.

RE: Looking for the php conditionals...

#2
http://[disallowed url shortening site]/19M6uvD

RE: Looking for the php conditionals...

OP
This post was last modified: 21-02-2015, 01:26 AM by AndresXZ09
#3
21-02-2015, 12:48 AM
Hug Wrote:
http://[disallowed url shortening site]/19M6uvD

Thanks for your help but I already have the plugin:fp: I need the code for the custom pages and groups, I thought it was gid but I was wrong and about the custom pages I think it should be $global but I'm not sure.

EDIT: I found the code, it's

Code:
<if $GLOBALS['mybb']->user['usergroup'] == 4 then>Upgrade<else>You're already upgraded</if>

But I would like to know how to add multiple user groups, I tried with

Code:
<if $GLOBALS['mybb']->user['usergroup'], array(4,16) then>Upgrade<else>You're already upgraded</if>

But it gives me an error.

EDIT

Code:
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4,16)) then>Upgrade<else>You're already upgraded</if>

That's the code, thanks.

You can close

RE: Looking for the php conditionals...

This post was last modified: 21-02-2015, 01:29 AM by Pulseeey
#4
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4,16) then>Upgrade<else>You're already upgraded</if>

Users browsing this thread: 1 Guest(s)