MyBB Community Forums

Full Version: delete text or section after login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

If you want to have a section or text only visible after loggin in you need to use the next code (if you have the php plugin installed)

<if $GLOBALS['mybb']->user['usergroup'] != 1 && $GLOBALS['mybb']->user['usergroup'] != 5 then>
HERE THE STUFF YOU WANT TO HIDE UNTIL LOGIN
</if>


But is there also a code that can be use for making text or a section visible for guests but after login at the forum its disappears???


Thanks!!
So what is the problem, I'm confused. When you login at the forum you become regular aint guests anymore, they become Registered.
Yes, but I want to set a text that is only visible if you are guest and if you login (and become a Registered Member) the text disappears
Because its working!
I don't know what you are saying.... maybe you don't understand me..

its simple, if you at the forum as guest you can see the text wat I have made, and if you login and become a member, the text is not there annymore.. thats what i'm looking for..


But for now I have a temporary sollution for it until someone knows one code for this now i'm using a lot of codes (5 codes)

Now I have set this code:

<if $GLOBALS['mybb']->user['usergroup'] != 1 && $GLOBALS['mybb']->user['usergroup'] != 5 then>
HERE TE TEXT TO HIDE
</if>

En the numbers I change to the numbers of the usergroups that not can see the text.
So I have put this code 6 times (because I have 12 usergroups and the code works for 2 usergroups so 6x2=12 Big GrinBig Grin) I have changes the numbers until I have set all the usergroups so only the guest can see the text.

But if someone knows the code for set one code that only guests can see the text pleace Big GrinBig Grin

Thanks
Oh, Ill have a go at it tommorow. im on my tablet now.
No problem I can wait Toungue
Hope its possible with one code because now its a lot of codes ToungueToungueToungue
To show something for only guests:
The logic is if the user's UID is 0 (guest), then display the message.
How about...

<if $GLOBALS['mybb']->user['usergroup'] != 1 then>
HERE THE STUFF YOU WANT TO HIDE UNTIL LOGIN
</if>
I have found it with a little bit playing with the code...
The working code is:
<if $mybb->user['uid'] == "0" then>
PUT HERE THE STUFF ONLY VISIBLE FOR GUESTS
</if>