This Tutorial Guide gives you a very basic overview of creating a new page to be integrated with the phpBB3 Framework. It is assumed that you have at least basic knowledge of PHP to perform this kind of integration.
This method is especially useful for creating pages that utilize the phpBB3 login function, and integration with your website or CMS.
Each page created for phpBB needs three parts.
-
new_page.php-- This is your PHP file that a user will navigate to, such as: http://mywebsite.tld/new_page.php. This file will contain the main PHP/Script information for making this page work with the phpBB3 framework. - /phpBB3/language/<lang>/mods/
my_language_file.php-- This is your PHP Language File that contains all of your language variables. - /phpBB3/styles/<style>/template/
my_template.html-- This is your HTML Template File containing all of your template variables and the HTML that will end up creating what the user will see when they view the page.
Step 1: Creating the PHP File
Save this file to your website root directory (not inside your phpBB3 installation directory) and name it:
new_page.php.Spoiler:
Step 2: Creating the language file
Save this file to the languages directory in the following location:
/phpBB3/language/<lang>/mods/my_language_file.php.Spoiler:
Step 3: Create your Template File
Save this file to your templates directory for the style that you are using:
/phpBB3/styles/<style>/template/my_template.html.Spoiler:
Step 4: Navigate to your new page
You are done, now point your browser to your new page, i.e.:
http://yourwebsite.tld/new_page.php Now Modify the page to fit your needs.
-------------------------------------------------
Setting Permissions
If you would like to make your page viewable only if the user is logged in, perform the following...
In new_page.php
FIND:
$user->setup('mods/my_language_file');AFTER, ADD:
- Code: Select all
// is the user logged in?
if (!$user->data['is_registered'])
{
if ($user->data['is_bot'])
{
// the user is a bot, send them back to home base...
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
// the user is not logged in, give them a chance to login here...
login_box('', 'LOGIN');
}
If you would like to fine-tune your permissions.
You can append an else if with a permission check. -- This verifies the user is a Moderator.
- Code: Select all
else if (!$auth->acl_get('m_'))
{
// User is not a moderator...
trigger_error('NOT_AUTHORISED');
}








