Forum Moderators: rogerd
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!
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.
<?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.,