Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Check if logged in?
#1
Not Solved
I'm creating my own sidebar inside my Index template, how can I check if users are logged in and how can I check if they're admins or moderators?
Reply
#2
Not Solved
Note that you can't put these directly in templates, but it is the PHP codes you will need.

if($mybb->user['uid'])
{
// member
}

if($mybb->usergroup['canmodcp'])
{
// moderator
}

if($mybb->usergroup['cancp'])
{
// admin
}
Reply
#3
Not Solved
And if you want it directly in templates, just download Template Conditionals plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=464 and after activating it add this code to the index template:
<if $mybb->user['uid'] then>
Show text/HTML/CSS/variables/whatever for users logged in.
</if>
<if $mybb->usergroup['cancp'] || $mybb->usergroup['canmodcp'] then>
Show text/HTML/CSS/variables/whatever for users with ACP/MCP access.
</if>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)