MyBB Support

Looking for the php conditionals...

Submitted by AndresXZ09, , Thread ID: 1449

Thread Closed
AndresXZ09
Closed Account
Level:
0
Reputation:
30
Posts:
1.22K
Likes:
139
Credits:
1.51K
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...

Blowjob
Closed Account
Level:
0
Reputation:
26
Posts:
2.16K
Likes:
189
Credits:
2.53K
21-02-2015, 12:48 AM
#2
http://[disallowed url shortening site]/19M6uvD

RE: Looking for the php conditionals...

AndresXZ09
Closed Account
Level:
0
Reputation:
30
Posts:
1.22K
Likes:
139
Credits:
1.51K
OP
21-02-2015, 01:03 AM
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...

Pulseeey
The Mandingo Man
Staff
Level:
0
Reputation:
208
Posts:
968
Likes:
159
Credits:
1.69K
21-02-2015, 01:27 AM
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)