MyBB Community Forums

Full Version: <table> permissions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Mybb Community, 



I have a quick question
I have created left sidebox "user profile" on my index page (HTML& CSS only) the box shows the user avatar & REPs etc..
my question is how I can set permission for (logged-in) only can see it


thanks for reading, 
have a nice day.
This is probably what your looking for: https://community.mybb.com/thread-211871...pid1279462

Note, you will need to install the PHP in Templates plugin.
(2020-04-26, 10:15 PM)Ben Wrote: [ -> ]This is probably what your looking for: https://community.mybb.com/thread-211871...pid1279462

Note, you will need to install the PHP in Templates plugin.

[Image: 3bVOQpV.png]

can you explain a bit more cuz im still newbie, thanks Smile
I would recommend the Template Conditionals instead (do not use PHP in Templates unless necessary):
http://mybbhacks.zingaburga.com/showthread.php?tid=464

Then paste the following in (almost) any template and it should work:
<if !$mybb->user['uid']  then>
   Guest!
</if>


Or simply use the following if the former doesn't work:
<if !$GLOBALS['mybb']->user['uid']  then>
   Guest!
</if>
(2020-04-26, 11:58 PM)Omar G. Wrote: [ -> ]I would recommend the Template Conditionals instead (do not use PHP in Templates unless necessary):
http://mybbhacks.zingaburga.com/showthread.php?tid=464

Then paste the following in (almost) any template and it should work:
<if !$mybb->user['uid']  then>
  Guest!
</if>


Or simply use the following if the former doesn't work:
<if !$GLOBALS['mybb']->user['uid']  then>
  Guest!
</if>
the first code worked for both logged-in and guests 
and the second code didn't work at all 

i need a php code to put inside it my HTML code(sidebox(user stats)) 
loggin-in can see it but the guests can't 

thanks anyway @Omar G & @Ben
try using code like below
<if $mybb->user['uid'] > 0 then>
   // code to appear for logged in users
</if>
(2020-04-27, 04:36 AM).m. Wrote: [ -> ]try using code like below
<if $mybb->user['uid'] > 0 then>
   // code to appear for logged in users
</if>

in the index template:

[Image: xQ0hhjF.png]

index.php :
[Image: 537Kw4p.png]

didn't work 
i can see testing* html code when im logged out too.
i think the problem with the 0 then> (i think)
I think the problem is that you haven't installed the Template Conditionals nor the PHP in Templates plugins.
(2020-04-27, 07:46 PM)Omar G. Wrote: [ -> ]I think the problem is that you haven't installed the Template Conditionals nor the PHP in Templates plugins.
how i can do it ?

friendly bump Smile
^ both plugins links were already given. preferred one => template conditionals plugin