[外掛] Page Permissions(檢視權限)

phpBB 大部分皆是由竹貓星球提供資料!
頭像
懸壺子
系統管理員
系統管理員
主題中的帖子: 3
文章: 33489
註冊時間: 2001-10-05 , 10:10
個人狀態: 道骨學習佛心..^^..
貼心留言: 氣候不穩
性別: 公仔
來自: 黃金故鄉
聯繫:

[外掛] Page Permissions(檢視權限)

未閱讀文章 懸壺子 »

[外掛] Page Permissions(檢視權限)

http://phpbb-tw.net/phpbb/viewtopic.php?t=43548


代碼: 選擇全部

############################################################## 
## MOD Title: Page Permissions 
## MOD Author: drathbun <N> (Dave Rathbun) http://www.phpBBDoctor.com 
## MOD Description: Set permissions by page (guest, reg, private, mod, admin) 
## MOD Version: 1.0.0 
## 
## 
## Installation Level: Easy 
## Installation Time: ~ 5 Minutes 
## Files To Edit: includes/constants.php, includes/functions.php, language/lang_english/lang_admin.php, language/lang_english/lang_main.php 
## Included Files: cache_pages.php, admin_page_permissions.php, phpbbdoctor_cache_functions.php, page_permissions.php, page_permissions_list_body.tpl, page_permissions_edit_body.tpl 
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/ 
##############################################################

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------- 
# 
language/lang_english/lang_admin.php 

# 
#-----[ FIND ]------------------------------------- 
# 
// 
// That's all Folks! 

# 
#-----[ BEFORE, ADD ]------------------------------------- 
# 
// BEGIN Page Permissions 1.0.0 (www.phpBBDoctor.com) 
$lang['Add_new_page'] = '新增瀏覽頁面'; 
$lang['No_page_selected'] = '沒有頁面被選擇'; 
$lang['No_page_group'] = 'None'; 
$lang['Unknown_group_type'] = '不知明'; 
$lang['Page_permissions_admin_title'] = '檢視管理權限設定'; 
$lang['Page_permissions_element'] = '瀏覽頁面'; 
$lang['Page_ID'] = '瀏覽頁面 ID (系統指派)'; 
$lang['Page_name'] = '編號'; 
$lang['Page_function'] = '瀏覽頁面功能'; 
$lang['Guest_views'] = '訪客瀏覽'; 
$lang['Guest_views_pct'] = '百分比'; 
$lang['Guest_views_explain'] = '此瀏覽統計收集所有訪客瀏覽過的總頁面次數,系統管理員可以自行調整觀看次數。'; 
$lang['Member_views'] = '註冊會員瀏覽'; 
$lang['Member_views_pct'] = '百分比'; 
$lang['Member_views_explain'] = '此瀏覽統計收集所有註冊會員瀏覽過的總頁面次數,系統管理員可以自行調整觀看次數。'; 
$lang['Page_views'] = '檢視次數'; 
$lang['Page_views_pct'] = '百分比'; 
$lang['Total_page_views'] = '總瀏覽次數'; 
$lang['Page_permissions_explain'] = '此清單統計你指定的瀏覽頁面的總觀看次數。ID是系統自行指派。當註冊和訪客進入任何一個你指定的瀏覽頁面,系統就會自動更新統計數據。你可以利用此外掛功能去限制和禁止某一個瀏覽頁面,或者建立瀏覽權限等相關的功能。'; 
$lang['Disable_page'] = '要禁止嗎?'; 
$lang['Disable_page_explain'] = '此功能賦予你禁止個別瀏覽頁面,而不需要關閉整個論壇。所有系統管理階級人員仍然順利可以瀏覽,不過禁止其他會員和訪客進入此頁面。禁止時期可自行設定訊息提醒會員。'; 
$lang['Auth_level'] = '認證階級'; 
$lang['Page_parm_name'] = 'Parameter'; 
$lang['Page_parm_name_explain'] = 'Some pages have parameters based by GET or POST. If you want to check for a specific value, enter the parameter name to check here. An example might be "mode" for the profile page. You might want to set different permissions for "register" than you would for "viewprofile" or other values. Note that you do <b>not</b> have to define all possible parameter values, only those that you want to track or assign permissions to.'; 
$lang['Page_parm_value'] = 'Value (Required if Parameter is provided)'; 
$lang['Min_post_count'] = '最低總發表數'; 
$lang['Min_post_count_explain'] = '選擇"0"賦予某些瀏覽頁面的瀏覽權限必需以你所設定的最低總發表數。'; 
$lang['Max_post_count'] = '最高總發表數'; 
$lang['Max_post_count_explain'] = '選擇"0"表現你賦予某些瀏覽頁面的瀏覽權限必需以你所設定的最高總發表數。這個功能並不建議使用!'; 
$lang['Page_group'] = '群組認證'; 
\n$lang['Page_group_explain'] = '選擇個別或者多個群組賦予認證階級<b>Private</b>進入瀏覽頁面。'; 
$lang['Permission_public'] = '公開'; 
$lang['Permission_registered'] = '註冊會員'; 
$lang['Permission_private'] = '私人群組'; 
$lang['Permission_moderator'] = '版主管理員'; 
$lang['Permission_administrator'] = '系統管理員'; 
// Added when we included ability to enable / disable page view counts 
$lang['Page_view_count_is'] = '目前瀏覽統計: '; 
$lang['Count_views'] = '增加瀏覽統計: '; 
$lang['Save_count_views'] = ' 儲存 '; 
// Added when we included ability to mass enable / disable pages on page listing 
$lang['Update_selected_pages'] = '更新選擇的頁面'; 
$lang['1_page_enabled'] = '目前有 1 個瀏覽頁面開放中'; 
$lang['1_page_disabled'] = '目前有 1 個瀏覽頁面禁止中'; 
$lang['X_pages_enabled'] = '目前有 %d 個瀏覽頁面開放中'; 
$lang['X_pages_disabled'] = '目前有 %d 個瀏覽頁面禁止中'; 
// General admin token strings used 
// in all phpBBDoctor admin pages 
$lang['Updated'] = ' 更新 '; 
$lang['Inserted'] = ' 添加'; 
$lang['Deleted'] = ' 刪除 '; 
$lang['Rebuild_cache'] = '重設快速緩衝貯存(cache)'; 
$lang['Cache_updated'] = ' 快速緩衝貯存(cache)更新 '; 
$lang['Click_return_list'] = '請按 %s這裡%s 返回 %s 設定清單'; 
// END Page Permissions 1.0.0 (www.phpBBDoctor.com)

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------- 
# 
language/lang_english/lang_main.php 

# 
#-----[ FIND ]------------------------------------- 
# 
// 
// That's all, Folks! 

# 
#-----[ BEFORE, ADD ]------------------------------------- 
# 
// BEGIN Page Permissions 1.0.0 (www.phpBBDoctor.com) 
$lang['Page_disabled'] = '目前正在維護中, 暫時關閉瀏覽方便進度!'; 
$lang['Insufficient_privileges'] = '很抱歉!你並未獲授權檢視此頁!'; 
$lang['Post_count_too_low'] = '很抱歉!你的總發文數並未達到要求, 你無法檢視此頁!'; 
$lang['Post_count_too_high'] = '很抱歉!你的總發文數已經超出限制, 你無法檢視此頁!'; 
// END Page Permissions 1.0.0 (www.phpBBDoctor.com)
圖檔
頭像
懸壺子
系統管理員
系統管理員
主題中的帖子: 3
文章: 33489
註冊時間: 2001-10-05 , 10:10
個人狀態: 道骨學習佛心..^^..
貼心留言: 氣候不穩
性別: 公仔
來自: 黃金故鄉
聯繫:

Re: [外掛] Page Permissions(檢視權限)

未閱讀文章 懸壺子 »

原始檔

代碼: 選擇全部

##############################################################
## MOD Title: Page Permissions
## MOD Author: drathbun < N/A > (Dave Rathbun) http://www.phpBBDoctor.com
## MOD Description: Set permissions by page (guest, reg, private, mod, admin)
## MOD Version: 1.0.0
##
##
## Installation Level: Easy
## Installation Time: ~ 5 Minutes
## Files To Edit: includes/constants.php, includes/functions.php, language/lang_english/lang_admin.php, language/lang_english/lang_main.php
## Included Files: cache_pages.php, admin_page_permissions.php, phpbbdoctor_cache_functions.php, page_permissions.php, page_permissions_list_body.tpl, page_permissions_edit_body.tpl
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## This MOD is designed to allow board administrators to
## control access at the page level rather than at the forum
## level. It is not intended to replace the existing phpBB
## permission system but to supplement it.
## 
## For example, a common request is to "protect" the member
## list by preventing guests from viewing that page. Or perhaps
## even only allowing board moderators to view that
## information. This MOD will do that. It can also handle pages
## with different functions such as profile.php (which handles
## editing profiles, viewing profiles, and even new user
## registrations).
## 
## This MOD also sets up a page view counter for each page that
## you specify. Page counts are incremented based on MEMBER or
## GUEST viewing, and can be reset at any time.
## 
## Finally, you can disable individual pages. If a page is
## disabled users with ADMIN permissions can still view the
## pages, which will allow you to work on the page without
## other board members seeing what is going on. Want to shut
## down new user registrations? Simply set the profile page
## with mode of "register" to ADMIN and nobody will be able to
## register. Want to keep guests from viewing member profiles?
## Want to restrict access to a custom php page to members of a
## specific group? This MOD can do all of that.
## 
## Access levels include:
## Guest
## Registered
## Private
## Moderator
## Administrator
## 
## Note that there is a loophole with "moderator" permissions.
## Users that have ever been a moderator of something may still
## have a user_level value of "2", which means that they can
## still appear as a Moderator. This is not a problem with this
## MOD, and to the best of my knowledge has been fixed in the
## latest versions of phpBB.
## 
## Final note: this MOD can be used to set permissions for
## *any* page in your board, even something that is not a part
## of the standard phpBB distribution. You must, however,
## include the phpBB session handler in order for this to work.
## At the current time all pages must be in the same directory
## as the forum.
## 
## Permissions Hierarchy (changed in 0.7.2)
## A page may have different permissions based on different URL
## parameters. One valid parameter is "no" parameter. In older
## versions (0.7.0 and earlier) this MOD would first find the
## match for a page with no parameter and use the permission
## settings at that level for all accesses to that page, even
## if there was a potential match for the URL parameters. In
## 0.7.2 the process has been fixed. You can now have different
## permissions for a page both with and without URL parameters
## and it should work correctly.
## 
## eXtreme Styles MOD
## If you have this MOD installed you need to make a small
## change to one of the files to keep it from removing the Page
## Permissions cache file when a "clear all" process is run.
## Open admin/xs_cache.php and find the following code:
## $skip_files = array(
## 	'.',
## 	'..',
## 	'.htaccess',
## 	'index.htm',
## 	'index.html',
## 	'index.php',
## 	'attach_config.php',
## 	);
## 
## Inline find );
## Before, add
## 	'cache_pages.php'
## 
## Note that in my version this line 
## 	'attach_config.php',
## has an extra comma at the end, which should not be there. If
## your version does not have this extra comma then you will
## need to add one in order to avoid a syntax error, then add
## in the extra line as noted above. The final block of code
## should look something like this:
## $skip_files = array(
## 	'.',
## 	'..',
## 	'.htaccess',
## 	'index.htm',
## 	'index.html',
## 	'index.php',
## 	'attach_config.php',
## 	'cache_pages.php'
## 	);
##
## This MOD has 20 install instructions.
##############################################################
## MOD History:
##
##	2006-03-31 - Version 1.0.0
##		Release candidate
##
##	Prior version history available on the author's
##	web site
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]-------------------------------------
#

CREATE TABLE phpbb_pages
(page_id                mediumint(5) unsigned not null auto_increment
,page_name              varchar(32) not null
,page_parm_name         varchar(32) default ''
,page_parm_value        varchar(32) default ''
,page_key               varchar(255) default ''
,member_views           int(11) unsigned default 0
,guest_views            int(11) unsigned default 0
,disable_page           tinyint(1) unsigned default 0
,auth_level             tinyint(2) unsigned default 0
,min_post_count         mediumint(8) unsigned default 0
,max_post_count         mediumint(8) unsigned default 0
,group_list             varchar(255) default ''
,primary key (page_id)
,unique key (page_key)
);

insert into phpbb_pages (page_name, page_key) values ('index.php', 'index.php');
insert into phpbb_pages (page_name, page_key) values ('viewforum.php', 'viewforum.php');
insert into phpbb_pages (page_name, page_key) values ('viewtopic.php', 'viewtopic.php');
insert into phpbb_pages (page_name, page_key) values ('faq.php', 'faq.php');
insert into phpbb_pages (page_name, page_key) values ('search.php', 'search.php');
insert into phpbb_pages (page_name, page_key) values ('login.php', 'login.php');
insert into phpbb_pages (page_name, page_key, auth_level) values ('memberlist.php', 'memberlist.php', 1);
insert into phpbb_pages (page_name, page_key, page_parm_name, page_parm_value, auth_level) values ('profile.php', 'profile.php?mode=viewprofile', 'mode', 'viewprofile', 1);
insert into phpbb_pages (page_name, page_key, page_parm_name, page_parm_value) values ('profile.php', 'profile.php?mode=register', 'mode', 'register');


#
#-----[ COPY ]-------------------------------------
#
copy cache_pages.php to cache/cache_pages.php
copy admin_page_permissions.php to admin/admin_page_permissions.php
copy phpbbdoctor_cache_functions.php to admin/phpbbdoctor_cache_functions.php
copy page_permissions.php to includes/page_permissions.php
copy page_permissions_list_body.tpl to templates/subSilver/admin/page_permissions_list_body.tpl
copy page_permissions_edit_body.tpl to templates/subSilver/admin/page_permissions_edit_body.tpl

#
#-----[ DIY INSTRUCTIONS ]-------------------------------------
#
CHMOD cache/cache_pages.php to 666

#\r
#-----[ OPEN ]-------------------------------------
#
includes/constants.php

#
#-----[ FIND ]-------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-------------------------------------
#
// BEGIN Page Permissions 1.0.0 (www.phpBBDoctor.com)
define('PAGES_TABLE', $table_prefix.'pages');
define('PAGE_AUTH_GUEST', 0);
define('PAGE_AUTH_REG', 1);
define('PAGE_AUTH_PRIVATE', 2);
define('PAGE_AUTH_MOD', 3);
define('PAGE_AUTH_ADMIN', 4);
// END Page Permissions 1.0.0 (www.phpBBDoctor.com)

#
#-----[ OPEN ]-------------------------------------
#
includes/functions.php

#
#-----[ FIND ]-------------------------------------
#
	//
	// Set up style


#
#-----[ BEFORE, ADD ]-------------------------------------
#
	// BEGIN Page Permissions 1.0.0 (www.phpBBDoctor.com)
	include_once($phpbb_root_path . 'includes/page_permissions.php');
	// END Page Permissions 1.0.0 (www.phpBBDoctor.com)

#
#-----[ OPEN ]-------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]-------------------------------------
#
//
// That's all Folks!

#
#-----[ BEFORE, ADD ]-------------------------------------
#
// BEGIN Page Permissions 1.0.0 (www.phpBBDoctor.com)
$lang['Add_new_page'] = 'Add new page';
$lang['No_page_selected'] = 'No page selected';
$lang['No_page_group'] = 'None';
$lang['Unknown_group_type'] = 'Unknown';
$lang['Page_permissions_admin_title'] = 'Page Permissions';
$lang['Page_permissions_element'] = 'Page';
$lang['Page_ID'] = 'Page ID (System assigned)';
$lang['Page_name'] = 'Page Name';
$lang['Page_function'] = 'Page Function';
$lang['Guest_views'] = 'Guest Views';
$lang['Guest_views_pct'] = 'Pct';
$lang['Guest_views_explain'] = 'This counter shows how many page views were done by guest viewers. This value may be adjusted in case you want to start over at a certain point.';
$lang['Member_views'] = 'Member Views';
$lang['Member_views_pct'] = 'Pct';
$lang['Member_views_explain'] = 'This counter shows how many page views were done by viewers that were logged on to your board. This value may be adjusted in case you want to start over at a certain point.';
$lang['Page_views'] = 'Page Views';
$lang['Page_views_pct'] = 'Pct';
$lang['Total_page_views'] = 'Total Page Views';
$lang['Page_permissions_explain'] = 'This table lists all site pages that have been added to your page permissions list. The ID is assigned by the system. The page view count is updated each time a page is viewed or refreshed. You can use this page to disable individual pages, set guest view permissions, or require admin access.';
$lang['Disable_page'] = 'Disable?';
$lang['Disable_page_explain'] = 'This option allows you to disable a page without disabling your entire board. Admin-level users will still be able to view / interact with this page but everyone else will receive a message saying that the page is offline. To change this message edit the entry in the main language file instead of the admin version.';
$lang['Auth_level'] = 'Access Level';
$lang['Page_parm_name'] = 'Parameter';
$lang['Page_parm_name_explain'] = 'Some pages have parameters based by GET or POST. If you want to check for a specific value, enter the parameter name to check here. An example might be "mode" for the profile page. You might want to set different permissions for "register" than you would for "viewprofile" or other values. Note that you do <b>not</b> have to define all possible parameter values, only those that you want to track or assign permissions to.';
$lang['Page_parm_value'] = 'Value (Required if Parameter is provided)';
$lang['Min_post_count'] = 'Min Posts';
$lang['Min_post_count_explain'] = 'A non-zero value here means that a user must have a minimum post count in order to view a page. As an example, this would allow you to set a minimum number of posts to view the memberlist or even a specific forum.';
$lang['Max_post_count'] = 'Max Posts';
$lang['Max_post_count_explain'] = 'A non-zero value here means that a user must have less than a set number of posts in order to view the page. Be careful that your max post count is higher than your min post count or you will have created a page that nobody can view. An administrator can always view the page.';
$lang['Page_group'] = 'Group Access Allowed';
$lang['Page_group_explain'] = 'Select one or more groups allowed to access this page. Note that this information is only used for access level <b>Private</b>';
$lang['Permission_public'] = 'Public';
$lang['Permission_registered'] = 'Registered';
$lang['Permission_private'] = 'Private';
$lang['Permission_moderator'] = 'Moderator';
$lang['Permission_administrator'] = 'Administrator';
// Added when we included ability to enable / disable page view counts
$lang['Page_view_count_is'] = 'Page view count is ';
$lang['Count_views'] = 'Increment page view counters: ';
$lang['Save_count_views'] = ' Save ';
// Added when we included ability to mass enable / disable pages on page listing
$lang['Update_selected_pages'] = 'Update Selected Pages';
$lang['1_page_enabled'] = 'There was 1 page enabled';
$lang['1_page_disabled'] = 'There was 1 page disabled';
$lang['X_pages_enabled'] = 'There were %d pages enabled';
$lang['X_pages_disabled'] = 'There were %d pages disabled';
// General admin token strings used
// in all phpBBDoctor admin pages
$lang['Updated'] = ' Updated ';
$lang['Inserted'] = ' Inserted ';
$lang['Deleted'] = ' Deleted ';
$lang['Rebuild_cache'] = 'Rebuild cache';
$lang['Cache_updated'] = ' cache updated ';
$lang['Click_return_list'] = 'Click %sHere%s to return to %s list';
// END Page Permissions 1.0.0 (www.phpBBDoctor.com)

#
#-----[ OPEN ]-------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]-------------------------------------
#
//
// That's all, Folks!

#
#-----[ BEFORE, ADD ]-------------------------------------
#
// BEGIN Page Permissions 1.0.0 (www.phpBBDoctor.com)
$lang['Page_disabled'] = 'This page is temporarily offline for maintenance';
$lang['Insufficient_privileges'] = 'You do not have authorization to view this page';
$lang['Post_count_too_low'] = 'You do not have enough posts to view this page yet.';
$lang['Post_count_too_high'] = 'You have too many posts to view this page.';
// END Page Permissions 1.0.0 (www.phpBBDoctor.com)

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
裡面的cache_pages.php記得設為666

代碼: 選擇全部

CHMOD cache/cache_pages.php to 666
頭像
懸壺子
系統管理員
系統管理員
主題中的帖子: 3
文章: 33489
註冊時間: 2001-10-05 , 10:10
個人狀態: 道骨學習佛心..^^..
貼心留言: 氣候不穩
性別: 公仔
來自: 黃金故鄉
聯繫:

Re: [外掛] Page Permissions(檢視權限)

未閱讀文章 懸壺子 »

因為有裝此外掛,我把
[外掛]讓匿名者無法觀看已註冊會員的資料訪客不能看會員資料和搜尋
兩個拆掉
圖檔
版面鎖定 主題已鎖定

回到「phpBB2」