Looking for the php conditionals...

by AndresXZ09 - 21-02-2015, 12:44 AM
Closed Account
Posts:
1,383
Joined:
Jan 2015
Likes:
123
Credits:
1,268
Reputation:
30
2 Years of Service
#1
OP
Posted: 21-02-2015, 12:44 AM
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.
Closed Account
Posts:
2,770
Joined:
Jan 2015
Likes:
140
Credits:
1,194
Reputation:
28
2 Years of Service
#2
Posted: 21-02-2015, 12:48 AM
Closed Account
Posts:
1,383
Joined:
Jan 2015
Likes:
123
Credits:
1,268
Reputation:
30
2 Years of Service
#3
OP
Posted: 21-02-2015, 01:03 AM (This post was last modified: 21-02-2015, 01:26 AM by AndresXZ09. Edit Reason: Updated )
(21-02-2015, 12:48 AM)Hug Wrote: http://bit.ly/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
The Mandingo Man
Posts:
876
Joined:
Jan 2015
Likes:
123
Credits:
2,009
Reputation:
116
Sys Admin
2 Years of Service
#4
Posted: 21-02-2015, 01:27 AM (This post was last modified: 21-02-2015, 01:29 AM by Pulseeey.)
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4,16) then>Upgrade<else>You're already upgraded</if>
[Image: jqsoo2y.png]
The last reply on this thread is older than a month. Please do not unnecessarily bump it.
Register an account or login to reply
Create an account
Create a free account today and start posting right away. It only takes a few seconds.
Login
Log into an existing account.
1 Guest(s)