MyBB Community Forums

Full Version: Use MyBB logins and groups in custom application
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to create a custom application that expands MyBB. All I really need to know is if you have have logged into the BB, and what user you are... that's it.

The work flow would be the user logs into the BB, and sees a link to the custom application. Clicking on this link takes you to the page... you don't have to log in again.

If you go to this page without logging in first, you go to the BB page.

I could do this by adding some custom code on the home page AFTER you login that creates a session (or encrypted cookie) and stores it. The custom pages would look for this information. HOWEVER, I would prefer to use a cleaner solution... and leverage the variables used by MyBB (if possible).

Any suggestions?
At the beginning of your page add this.

define("IN_MYBB", 1);
require_once "global.php";
if($mybb->user['uid']>0)
{
// code for a member to see
}
else
{
// code for a guest to see
}
Thank you