0

Restricting forum access to users or newly registered users

Wednesday, November 7, 2007

This will encourage registrations in forum (phpBB) and that everyone logs on when they visit so you can track who has been there.

In order to do the add the following code in the index.php page of the forum:

Find the "End session management" in the index.php file in forum. Add the following line below it:
// Begin 'Restrict Guest Access' MOD
if ( !$userdata['session_logged_in'] )
{
redirect(append_sid("login.".$phpEx."?redirect=index.".$phpEx, true));
exit;
}
// End 'Restrict Guest Access' MOD

This will redirect to login page of the forum.

The new users requires the register link to register in the forum. For that add the register link in the "login_body.tpl" file. Most probably you can find it in the "templates/subSilver/login_body.tpl" . The template should be the exact one which you are using in the forum. There are many templates such as subSilver, abandon, Galaxian, metalBB, Anubis and ca_artemis.

0 Responses to "Restricting forum access to users or newly registered users"