MyBB Community Forums

Full Version: Registration/Login check
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
Is there a code I can use to check if the user's logged in or redirect them to the registration page if not before they can access something?

Thanks.
PHP wise:
if(!$mybb->user['uid']) error_no_permission();
...will do all the magic.
Thanks, but I tried entering the code and it doesn't seem to work.
I'm unsure where I'm suppose to place it with this:

<area shape="rect" coords="500,25,525,10" href="#" onclick="MyWindow=window.open('test.html','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=620,height=400,left=200,top=200'); return false;" title="test" alt="test" />
That's SVG...why do you have SVG on you forums, or are you doing this on your main site?
Custom set of Navigation, just putting in an HTML made page that I only want members only access to.
There is no way to validate whether a user is logged in or not from a HTML page.
You will need to code your own PHP page.
Hmm, it's a pop up, so I was hoping to check their login first before allowing the window to come up.

Okay thanks anyway.