Dynadot โ€” .com Registration $8.99

PhpBB Login on Joomla

Spaceship Spaceship
Watch
Impact
1
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.

In my Joomla index.php:
PHP:
 ///////////////////////////////////////////////////////
//            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);                           // 
///////////////////////////////////////////////////////


In the module:

PHP:
 <?
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
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Any one?
 
0
•••
from the code, if the user is logged in, the page will display only the part:

"you are logged in"
 
0
•••
Yeah, thats what Im wanting it to do, but when I click the submit button it doesnt do anything
 
0
•••
By default, Joomla Has built in session management anyway, you dont need to add anything to your template index file. Goto joomlahacks.com they have exactly what you are after. Ive customised the phpBB and Joomla before, which can be seen on joomlatips.com
 
0
•••
If you know this much about PHP and stuff then why oh why are you using Joomla!

Cries...
 
0
•••
emadiba said:
By default, Joomla Has built in session management anyway, you dont need to add anything to your template index file. Goto joomlahacks.com they have exactly what you are after. Ive customised the phpBB and Joomla before, which can be seen on joomlatips.com

I have tried to find hacks that have what I need but so far I have had no luck. I will definetly check out the sites you suggested though. Thanks for the help :)

TheComputerGeek247 said:
If you know this much about PHP and stuff then why oh why are you using Joomla!

Cries...

It is for a site that I plan to sell and I dont really have time to create a complicated cms. Joomla was suggested to me as being a good cms. Ive tried a few of the others and I like the administration features and additional modules that comes with Joomla. Although I am trying mambo on another site and I like the layout of it much better.
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Unstoppable Domains
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back