Not Solved [How To?] <table> permissions
#1
Not Solved
This user has been denied support. This user has been denied support.
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.
New Community, Free Stuff !

Fixed the footer Smile  => https://emma-space.com
Reply
#2
Not Solved
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.
-Ben

Please do not PM me for support. I am looking to be hired for paid services.

You can view my paid services here.
Reply
#3
Not Solved
This user has been denied support. This user has been denied support.
(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
New Community, Free Stuff !

Fixed the footer Smile  => https://emma-space.com
Reply
#4
Not Solved
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>
Reply
#5
Not Solved
This user has been denied support. This user has been denied support.
(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
New Community, Free Stuff !

Fixed the footer Smile  => https://emma-space.com
Reply
#6
Not Solved
try using code like below
<if $mybb->user['uid'] > 0 then>
   // code to appear for logged in users
</if>
Reply
#7
Not Solved
This user has been denied support. This user has been denied support.
(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)
New Community, Free Stuff !

Fixed the footer Smile  => https://emma-space.com
Reply
#8
Not Solved
I think the problem is that you haven't installed the Template Conditionals nor the PHP in Templates plugins.
Reply
#9
Not Solved
This user has been denied support. This user has been denied support.
(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
New Community, Free Stuff !

Fixed the footer Smile  => https://emma-space.com
Reply
#10
Not Solved
^ both plugins links were already given. preferred one => template conditionals plugin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)