MyBB Community Forums

Full Version: Login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to link my index page with my forum so there be's a login on my index page and a register page then it goes to the forum but they cant just go to the forum straight away by typing the url they have to login using the login on the index page but when they type in the url it shows somekind of message saying 'you are not logged in' but on the bottom of the index page with the login it might say you can sign in with a guest account . But the guest account only has a few privileges .
So... is this a request for MyBB 2.0? If so, there will be an API making what you're talking about much easier.
MyBB 2.0 will have an API, so this will be possible once 2.0 is released. It's possible now actually, I just don't remember off the top of my head how to do it.
Partial implementation for use with 1.6:
The following HTML snippet will produce a login form that will work from outside the forum directory (although note that the path to member.php will need to be altered for a forum not residing in /forums). It will not change to reflect a user's login state, but it might be useful as a first step. I know it works, because I've lifted it straight off the index of my own site.
<form action="/forums/member.php" method="post">
	  <div class="text" id="loginform">
	    <input type="hidden" name="action" value="do_login" />
	    <input type="hidden" name="url" value="/" />
	    <input type="text" name="username" tabindex="1"/><br/>
	    <input type="password" name="password" tabindex="2"/><br/>
	    <input type="submit" value="login" tabindex="3"/>
	  </div>
	</form>