Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 13 Years, 10 Months, 2 Weeks ago <if then> Help
#1
Solved: 13 Years, 10 Months, 2 Weeks ago
Hello all. I am using the following code below to hide content I want from guests.

<if $mybb->usergroup['gid'] == 2 || $mybb->usergroup['gid'] == 3 || $mybb->usergroup['gid'] == 6 || $mybb->usergroup['gid'] == 4 || $mybb->usergroup['gid'] == 12 then>
</if>

I know there HAS to be a smaller code because I used to use it but then I lost it. What it did, was displayed to every group except 1 (guests).

THanks!
social. forever.
an online community.
#2
Solved: 13 Years, 10 Months, 2 Weeks ago
Try this. What this'll do is check if the user has a uid.

<if $mybb->user['uid'] then> </if>
[Image: igG319dTu71gT.png]
#3
Solved: 13 Years, 10 Months, 2 Weeks ago
Replace above with this;
<if $mybb->user['usergroup'] != 1 then>SHOW_CONTENT_HERE_TO_ALL_GROUPS_EXCEPT_GUESTS
</if>
#4
Solved: 13 Years, 10 Months, 2 Weeks ago
What what this be if I wanted to ONLY show content to guests?
social. forever.
an online community.
#5
Solved: 13 Years, 10 Months, 2 Weeks ago
Or:

if (in_array($mybb->user['usergroup'], array(1,2,5,7)))
{
    //Content Here
} 


Show content to guests:

<if $mybb->user['usergroup'] == 1 then>
    //Content
</if> 

Or

<if $GLOBALS['mybb']->user['usergroup'] == 1 then>
    //Content
</if>
#6
Solved: 13 Years, 10 Months, 2 Weeks ago
Makes perfect sense! Thanks!
social. forever.
an online community.


Forum Jump:


Users browsing this thread: 1 Guest(s)