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.
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:
index.php :
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.