|
Page 1 of 1
|
KugeLSichA
Joined: August 2006
Posts: 803
Location: Dresden
|
How To Add A New Page Permission To ACP
Hi there,
if you have an new site that is not included in the xs package, and you know who i can add a new site AUTH to the DB which is configuarable over the site page permissions in ACP, just let me know.
if you have the time maybe one can write an documantation about this, like an MOD install instruction.. maybe others find this usefull
thx
EDITED BY MG
- ##############################################################
- ## MOD Title: Page permissions for a new site in phpBBXS
- ## MOD Author: KugeLSichA < kugelsicha@caromonline.de > (HoLLe) http://www.caromguild.de
- ## MOD Description: If you have an other site that is not included in phpBBXS
- ## package, and you want to add the phpBBXS site
- ## permissions to this site, add the following lines to your
- ## site.
- ## Site permissions can be set in ACP -> config -> site
- ## permissions.
- ## MOD Version: 1.0.0
- ##
- ## Installation Level: Easy
- ## Installation Time: 5 min
- ## Files To Edit: 4
- ## adm/admin_board_permissions.php
- ## lanugage/lang_english/lang_admin.php
- ## new_page.php
- ## templates/ca_aphrodite/admin/board_config_permissions_body.tpl
- ## Included Files: n/a
- ##############################################################
- ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
- ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
- ## to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered
- ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
- ##############################################################
- ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
- ##############################################################
- #
- #-----[ SQL ]------------------------------------------
- #
- INSERT INTO `phpbb_config_mg` (`config_name`, `config_value`) VALUES ('auth_view_new_page', '0');
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- adm/admin_board_permissions.php
- #
- #-----[ FIND ]------------------------------------------
- #
- $auth_view['viewonline'] = auth_select($new['auth_view_viewonline'], 'auth_view_viewonline');
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- $auth_view['new_page'] = auth_select($new['auth_view_new_page'], 'auth_view_new_page');
- #
- #-----[ FIND ]------------------------------------------
- #
- "L_AUTH_VIEW_VIEWONLINE" => $lang['auth_view_viewonline'],
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- "L_AUTH_NEW_PAGE" => $lang['auth_new_page'],
- #
- #-----[ FIND ]------------------------------------------
- #
- "S_AUTH_VIEW_VIEWONLINE" => $auth_view['viewonline'],
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- "S_AUTH_VIEW_NEW_PAGE" => $auth_view['new_page'],
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- templates/ca_aphrodite/admin/board_config_permissions_body.tpl
- #
- #-----[ FIND ]------------------------------------------
- #
- <tr>
- <td class="row1">{L_AUTH_VIEW_VIEWONLINE}</td>
- <td class="row2">{S_AUTH_VIEW_VIEWONLINE}</td>
- </tr>
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- <tr>
- <td class="row1">{L_AUTH_VIEW_NEW_PAGE}</td>
- <td class="row2">{S_AUTH_VIEW_NEW_PAGE}</td>
- </tr>
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- # do this for all languages you have installed!
- lanugage/lang_english/lang_admin.php
- #
- #-----[ FIND ]------------------------------------------
- #
- $lang['auth_view_viewonline'] = 'View Online';
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- $lang['auth_view_new_page'] = 'New Page';
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- new_page.php
- #
- #-----[ FIND ]------------------------------------------
- #
- # similar
- // Start session management
- $userdata = session_pagestart($user_ip, PAGE_INDEX);
- init_userprefs($userdata);
- // End session management
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- $auth_level_req = $config_mg['auth_view_new_page'];
- if ($auth_level_req > AUTH_ALL)
- {
- if ( ($auth_level_req == AUTH_REG) && (!$userdata['session_logged_in']) )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
- }
- if ($userdata['user_level'] != ADMIN)
- {
- if ( $auth_level_req == AUTH_ADMIN )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
- }
- if ( ($auth_level_req == AUTH_MOD) && ($userdata['user_level'] != MOD) )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
- }
- }
- }
-
- #
- #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
- #
- # EoM
-
Edited by Mighty Gorgon, Sat 12 Aug, 2006 11:33: Added the instructions in the first post. |
#1 Thu 10 Aug, 2006 01:37 |
|
Sponsors
|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7192
Location: Borgo San Michele
|
Re: How To Add A New Site AUTH
Hi there,
if you have an new site that is not included in the xs package, and you know who i can add a new site AUTH to the DB which is configuarable over the site page permissions in ACP, just let me know.
if you have the time maybe one can write an documantation about this, like an MOD install instruction.. maybe others find this usefull
thx
Sorry, but can you explain this again? I haven't understand what do you mean.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#2 Thu 10 Aug, 2006 02:17 |
|
KugeLSichA
Joined: August 2006
Posts: 803
Location: Dresden
|
Re: How To Add A New Site AUTH
i have a new site, maybe movies.php
and want to add this code:
- $auth_level_req = $config_mg['auth_view_forum'];
- if ($auth_level_req > AUTH_ALL)
- {
- if ( ($auth_level_req == AUTH_REG) && (!$userdata['session_logged_in']) )
- {
- redirect(append_sid(LOGIN_MG . "?redirect=forum.$phpEx", true));
- }
- if ($userdata['user_level'] != ADMIN)
- {
- if ( $auth_level_req == AUTH_ADMIN )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
- }
- if ( ($auth_level_req == AUTH_MOD) && ($userdata['user_level'] != MOD) )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
- }
- }
- }
to it... this is the code from forum.php... and i nee an how to, for adding the new DB field, and which is to edit in the ACP, that i can that up the page mermissions...
you understand?
|
#3 Thu 10 Aug, 2006 02:26 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7192
Location: Borgo San Michele
|
Re: How To Add A New Site AUTH
Ok, now I got this!
- First thing you have to choose the name for the DB field and add it:
INSERT INTO `phpbb_config_mg` (`config_name`, `config_value`) VALUES ('auth_view_new_page', '0');
- Open adm/admin_board_permissions.php
FIND
$auth_view['viewonline'] = auth_select($new['auth_view_viewonline'], 'auth_view_viewonline');
ADD AFTER
$auth_view['new_page'] = auth_select($new['auth_view_new_page'], 'auth_view_new_page');
FIND
"L_AUTH_VIEW_VIEWONLINE" => $lang['auth_view_viewonline'],
ADD AFTER
"L_AUTH_NEW_PAGE" => $lang['auth_new_page'],
FIND
"S_AUTH_VIEW_VIEWONLINE" => $auth_view['viewonline'],
ADD AFTER
"S_AUTH_VIEW_NEW_PAGE" => $auth_view['new_page'],
- Open templates/ca_aphrodite/admin/board_config_permissions_body.tpl
FIND
<tr>
<td class="row1">{L_AUTH_VIEW_VIEWONLINE}</td>
<td class="row2">{S_AUTH_VIEW_VIEWONLINE}</td>
</tr>
ADD AFTER
<tr>
<td class="row1">{L_AUTH_VIEW_NEW_PAGE}</td>
<td class="row2">{S_AUTH_VIEW_NEW_PAGE}</td>
</tr>
- Open language/lang_*/lang_admin.php
FIND
$lang['auth_view_viewonline'] = 'View Online';
ADD AFTER
$lang['auth_view_new_page'] = 'New Page';
- And finally add the code to your page... new_page.php
FIND (similar)
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
ADD AFTER
$auth_level_req = $config_mg['auth_view_new_page'];
if ($auth_level_req > AUTH_ALL)
{
if ( ($auth_level_req == AUTH_REG) && (!$userdata['session_logged_in']) )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
if ($userdata['user_level'] != ADMIN)
{
if ( $auth_level_req == AUTH_ADMIN )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
if ( ($auth_level_req == AUTH_MOD) && ($userdata['user_level'] != MOD) )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
}
}
You owe me a beer.
P.S.: Topic title changed.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#4 Thu 10 Aug, 2006 09:31 |
|
KugeLSichA
Joined: August 2006
Posts: 803
Location: Dresden
|
Re: How To Add A New Page Permission To ACP
great MG,
thats exactly what i want to get.
maybe other users need this too, if they have other MODs installed.
thx.
P.S.: you can get a beer, but u dont have an beer MOD in your forum
|
#5 Thu 10 Aug, 2006 11:52 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7192
Location: Borgo San Michele
|
Re: How To Add A New Page Permission To ACP
great MG,
thats exactly what i want to get.
maybe other users need this too, if they have other MODs installed.
thx.
P.S.: you can get a beer, but u dont have an beer MOD in your forum
It took me an hour writing this... so we are tied...
I'll go to a pub buying a beer for myself!
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#6 Thu 10 Aug, 2006 12:23 |
|
KugeLSichA
Joined: August 2006
Posts: 803
Location: Dresden
|
Re: How To Add A New Page Permission To ACP
ok here i have written this as a MOD for easily download.
thx to MG for help.
- ##############################################################
- ## MOD Title: Page permissions for a new site in phpBBXS
- ## MOD Author: KugeLSichA < kugelsicha@caromonline.de > (HoLLe) http://www.caromguild.de
- ## MOD Description: If you have an other site that is not included in phpBBXS
- ## package, and you want to add the phpBBXS site
- ## permissions to this site, add the following lines to your
- ## site.
- ## Site permissions can be set in ACP -> config -> site
- ## permissions.
- ## MOD Version: 1.0.0
- ##
- ## Installation Level: Easy
- ## Installation Time: 5 min
- ## Files To Edit: 4
- ## adm/admin_board_permissions.php
- ## lanugage/lang_english/lang_admin.php
- ## new_page.php
- ## templates/ca_aphrodite/admin/board_config_permissions_body.tpl
- ## Included Files: n/a
- ##############################################################
- ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
- ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
- ## to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered
- ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
- ##############################################################
- ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
- ##############################################################
- #
- #-----[ SQL ]------------------------------------------
- #
- INSERT INTO `phpbb_config_mg` (`config_name`, `config_value`) VALUES ('auth_view_new_page', '0');
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- adm/admin_board_permissions.php
- #
- #-----[ FIND ]------------------------------------------
- #
- $auth_view['viewonline'] = auth_select($new['auth_view_viewonline'], 'auth_view_viewonline');
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- $auth_view['new_page'] = auth_select($new['auth_view_new_page'], 'auth_view_new_page');
- #
- #-----[ FIND ]------------------------------------------
- #
- "L_AUTH_VIEW_VIEWONLINE" => $lang['auth_view_viewonline'],
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- "L_AUTH_NEW_PAGE" => $lang['auth_new_page'],
- #
- #-----[ FIND ]------------------------------------------
- #
- "S_AUTH_VIEW_VIEWONLINE" => $auth_view['viewonline'],
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- "S_AUTH_VIEW_NEW_PAGE" => $auth_view['new_page'],
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- templates/ca_aphrodite/admin/board_config_permissions_body.tpl
- #
- #-----[ FIND ]------------------------------------------
- #
- <tr>
- <td class="row1">{L_AUTH_VIEW_VIEWONLINE}</td>
- <td class="row2">{S_AUTH_VIEW_VIEWONLINE}</td>
- </tr>
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- <tr>
- <td class="row1">{L_AUTH_VIEW_NEW_PAGE}</td>
- <td class="row2">{S_AUTH_VIEW_NEW_PAGE}</td>
- </tr>
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- # do this for all languages you have installed!
- lanugage/lang_english/lang_admin.php
- #
- #-----[ FIND ]------------------------------------------
- #
- $lang['auth_view_viewonline'] = 'View Online';
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- $lang['auth_view_new_page'] = 'New Page';
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- new_page.php
- #
- #-----[ FIND ]------------------------------------------
- #
- # similar
- // Start session management
- $userdata = session_pagestart($user_ip, PAGE_INDEX);
- init_userprefs($userdata);
- // End session management
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- $auth_level_req = $config_mg['auth_view_new_page'];
- if ($auth_level_req > AUTH_ALL)
- {
- if ( ($auth_level_req == AUTH_REG) && (!$userdata['session_logged_in']) )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
- }
- if ($userdata['user_level'] != ADMIN)
- {
- if ( $auth_level_req == AUTH_ADMIN )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
- }
- if ( ($auth_level_req == AUTH_MOD) && ($userdata['user_level'] != MOD) )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
- }
- }
- }
-
- #
- #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
- #
- # EoM
-
|
#7 Sat 12 Aug, 2006 11:11 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|