Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: Eriol - toukokuu 09, 2007, 04:31:32 IP

Otsikko: Integrating my message board authentication into my web pages LOTR game
Kirjoitti: Eriol - toukokuu 09, 2007, 04:31:32 IP
Hello,
First time poster, while I do have experience in mysql and php, I am new to the message board thing.

I have develop a few webpages that hold a LOTR based game (it's a wargame).

What I would like to do is to use the message board login system to attribute what can and can't be seen on the board.

The fact is that I already did it but it was with another type of message board and I want my game to be able to work with this one.

The code use to look like this (it was called each time a page was accessed) :
//============================================ AUTHENTICATE WITH PHPBB CODE =====================

define('IN_PHPBB', true);

$phpbb_root_path = '../forum/';

include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);


From there I was able to construct my sql with this variable $userdata['user_id']  to allow players to see only stuff that they are allowed to see.

Bassically I need to fetch the players board ID.

can anybody give me any suggestion on this?

Thank you
Otsikko: Re: Integrating my message board authentication into my web pages LOTR game
Kirjoitti: Eriol - toukokuu 09, 2007, 11:41:43 IP
I've found a solution...

it was just a matter of loading the SSI.php

en using the context and user_info variable.

require("../SMF/SSI.php");

if  ($context['user']['is_logged'] != 1)
{
   exit("You do not seem to be logged. Please <a href='../SMF/index.php'>log in</a>");
}

$username = $user_info['name'];


I can't wait to see that LOTR wargame going.

Ciao