the memberlist page is included as this will be the usual way to modify other pages as well....
in order for you to modify other pages, I will try to explain witch steps are nessesary and how they are done...
TO ADD ANOTHER PAGE:
In the following I will make some of the text bold, where your attention is needed, proberbly since you will need to change modify that specific part.
First of all, there are 2 types of pages: original phpbb page and "others", others could be pages from a MOD or a page located outside the forum (e.g. your main page)
if the page are a non phpBB2 page or a MOD included page you should first of all inshure that it is defined in the file
- Code: Select all
includes/constants.php
e.g. the memberlist.php is defined in this line of code
- Code: Select all
define('PAGE_VIEWMEMBERS', -7);
please note the number -7, witch is a identifyer number, and should be uniqe
if you are adding a line of code like
define('PAGE_MYOTHERPAGE', -5678);
you should choise a number witch is not already in use in the file constants.php, and it MUST be a negative value
next step will be to add this new page to your DB
to add this new page into the DB, you will ned a DB tool like e.g. phpmyadmin - then run this SQL
INSERT INTO phpbb_forums (forum_id, cat_id, forum_name, forum_desc, forum_status )
VALUES ("THE_ID_FROM ABOVE","0", "THE_PAGE_NAME", "PAGE_DESCRIPTION", 1 )
the bold marked text need to be costomiced by you, in the eaxample from above where the new page got a id of -5678
- Code: Select all
INSERT INTO phpbb_forums (forum_id, cat_id, forum_name, forum_desc, forum_status )
VALUES ("-5678","0", "My page", "My page permission control", 1 )
ok, now the page need to be modifyed, if it is MOD page for phpbb, I asume it have this first step already done, but look it up you will proberbly need to modify it slightly anywway.
if it is a new file or a external file you will shurely need this step.
in the top of the file include something like this
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, -5678);
init_userprefs($userdata);
//
// End session management
//
//
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, -5678, $userdata);
if( !$is_auth['auth_read'] )
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
//
// End auth check
//
now your page is ready for using the extra permission auth control
anywhere you would like to make a auth control simply add a normal if
else like this
if ($is_auth['auth_post'])
{
echo "You may post";
} else
{
echo "Sorry, you are not allowed to post";
}
any of the permission control you find in the ACP forum permission may be used, this include
auth_view, auth_read, auth_post, auth_delete, auth_mod auth_vote........you name it


