MyBB Community Forums

Full Version: Make a page or link go to a login page?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How do you make a page, or a link in the nav bar go into a login page?
<a href="{$mybb->settings['bburl']}/member.php?action=login">{$lang->login}</a>
(2013-01-28, 05:08 AM)effone Wrote: [ -> ]<a href="{$mybb->settings['bburl']}/member.php?action=login">{$lang->login}</a>

Ok, I want to make a link so a guest will have to sign in if they view that page, so where would I put that code exectly?
Your descriptions making me wild.

http://yaldaram.com/thread-310.html
(2013-01-28, 06:57 AM)effone Wrote: [ -> ]Your descriptions making me wild.

http://yaldaram.com/thread-310.html

That's for forums and threads, I need one for like viewing a page like buying a membership for the web site, and I need it to go to a log-in page.
What if the viewer is already logged in?
(2013-01-31, 04:16 AM)Leefish Wrote: [ -> ]What if the viewer is already logged in?

Then the log-in box won't show, it will show the membership page instead.

So basically like how guests can't view users profiles until they sign in, once they sign in then they can view users profile. So that's what I want but for pages, so how would I do that for a page? Like if I make a custom page, and want it for users who have signed up on my site only. Which of course they will have to be signed in to view.
Do you use page manager, or will this be a custom page you make yourself?
(2013-01-31, 05:08 AM)Leefish Wrote: [ -> ]Do you use page manager, or will this be a custom page you make yourself?

Both.
How can it be both? Page Manager makes pages like this: www.example.com/misc.php?page=foobar, custom pages are like www.example.com/foobar.php.

Regardless, the PHP would be:

if(!$mybb->user['uid'])
{
error_no_permission();
}
Pages: 1 2