I have set up a module with a login form for phpBB and I got it to work, but I need to find out how to display something other than the login if the viewer is already logged in.
I tried the following but im not sure it is keeping track of the session.
I my Joomla index.php file:
///////////////////////////////////////////////////////
// phpBB Sessions for login //
///////////////////////////////////////////////////////
define('IN_PHPBB', 1); //
$phpbb_root_path = 'forums/'; //
include($phpbb_root_path . 'extension.inc'); //
include($phpbb_root_path . 'common.php'); //
//---------------------------------------------------//
// Start session management //
//---------------------------------------------------//
$userdata = session_pagestart($user_ip, PAGE_INDEX); //
init_userprefs($userdata); //
///////////////////////////////////////////////////////
The module code:
<?
if( $userdata['session_logged_in'] )
{
echo ("You are logged in");
}
else
{
echo(
<form action='/forums/login.php' method='post'>
<table width='100%'>
<tr>
<td>
<span class='loginLabel'>User Name</span>
</td>
</tr>
<tr>
<td>
<input type='text' name='username' class='loginInpu'><br />
</td>
</tr>
<td>
<span class='loginLabel'>Password</span>
</td>
<tr>
<td>
<input type='password' name='password' class='loginInpu'><br />
</td>
<tr>
<td style='text-align: center;'>
<input type='submit' value='Log into Forums Now!' name='login' class='loginButton'><br /><br />
--| <a href='/forums/profile.php?mode=registerRegister'>Register</a> |--
</td>
</tr>
</table>
</form>
}?>
Thanks for your help,
Sam Simmons
http://splinterfreelance.com