Forum Moderators: rogerd

Message Too Old, No Replies

Integrate Forum Login

         

almo136

8:12 pm on Feb 2, 2009 (gmt 0)

10+ Year Member



Guys,

I have a site which requires users to register and then login using a username and password. This information is stored in a mysql database.

I'd like to integrate a forum into the site and allow users to login to the forum using their login credentials from the main site.

Ideally this would be totally seamless.

Does anyone have any suggestions for a good forum which would allow this with minimal effort?

Thanks!

thecoalman

5:33 pm on Feb 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think I can safely say that integrating your current user database into any forum software package is not going to have minimal effort. All that information has to be inserted into the forums database which will most likely require custom SQL queries unless there is converter or bridge available for your current software package if you're using something like Joomla.

If you wanted to do it with phpbb I believe the best approach is to integrate your site into the forum. It's actually quite easy to do once you have the user database up and running. It opens a lot of doorways because you can then use phpbb's templating engine, switches in the templates etc. There's an article in the KB in phpbb.com on how to do this but it's currently down.

I could post a sample if you're interested.

almo136

5:38 pm on Feb 3, 2009 (gmt 0)

10+ Year Member



yeah, a sample would be good. I've also been looking at vanilla forums which looks like it could be ideal. There is a tutorial on how to integrate it with wordpress which I should be able to adapt. It seems to be reasonably straight forward.

thecoalman

8:08 pm on Feb 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For a custom page in phpbb3 you only need to do the following:
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('Your Page Title HERE');

$template->set_filenames(array(
'body' => 'custom_template.html',
));

page_footer();
?>

This will only work for pages in the phpbb root folder. Copy and paste the code above and name it mypage.php and upload to the phpbb root folder.

The only edits you need to make is change the page title and change the name of your custom template.

custom_template.html gets uploaded to the template folder in your styles folder and would look something like this:

<!-- INCLUDE overall_header.html -->

<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>

<p>your custom html</p>

<span class="corners-bottom"><span></span></span></div>
</div>

<!-- INCLUDE overall_footer.html -->

You should have access to all the common phpbb switches, for example since we're including overall_header.html this page will have "new PM's". This can really be greatly expanded and it can be used outside the phpBB root folder with some modification but I don't have an example of that right now.

overall_footer and overall_footer could of course be changed to a custom header and footer. Lots of options, this is just the basic setup that you need to get a page. You can actually use PHP in the templates if you enable it within the ACP.,