問題外掛:Hide BBCode 1.010
參考連結:
http://phpbb-tw.net/phpbb/viewtopic.php ... light=hide
使用版本:phpBB 2.0.17
狀況描述:
小弟有找到一篇可以設定版主以上不用回覆就可以看隱藏內容的文章
http://phpbb-tw.net/phpbb/viewtopic.php?p=98201#98201
但文章已失連~不知那位大大還有這篇的教學~
另外小弟想要群組以上的等級不用回覆即可觀看癮藏內容,不知該如何修改\r
煩請好心的大大不吝指教~謝謝
[問題] Hide BBCode 權限問題
版主: 版主管理群
這個我用了第二個方法的Vance 寫:我也是想知道的人..^^||
我目前的方法是...設定 管理員可以看到所有回覆
方法有點簡單\r
我安裝的是這版的 mode
代碼: 選擇全部
############################################################################ ## MOD HIDE | Made By / Auteur: Philiweb < http://www.philiweb.fr.st/ > ############################################################################ ## Description : MOD "HIDE" (aka lockdown) - this mod allow users to hide ## a message via some "bbcodes", ex : [hide] message [/hide]. To see the ## hidden message, you must be a member and you must post a reply to ## the message... ############################################################################ ## VERSION DE PHPBB : PHPBB 2.0 RC3 - RC4 - 2.0.x (gold) - 2.0.4 |02/2003| ############################################################################ ## You can find the last versions and informations here on the official ## website (in English and French) : ## http://membres.lycos.fr/philiweb/accueil.php?num=15 ## Info : There is also some pre-modified files if you have difficulties ! ############################################################################ ## And you can find some modifications to "hide" mod here : ## http://membres.lycos.fr/philiweb/accueil.php?num=23 ## new : version 4 => administrators and moderators can see "hidden ## messages" immediatly...) ############################################################################ ## Demo : http://membres.lycos.fr/philiweb/forums/viewtopic.php?t=167 ############################################################################ ## This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites ############################################################################
我的方法是..
#
#-----[ ACTION: OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ ACTION: FIND ]------------------------------------------
#
//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
#
#-----[ ACTION: ADD BElOW]------------------------------------------
#
if( $userdata['session_logged_in'] ) {
$sql = "SELECT u.user_id, u.user_level
FROM " . USERS_TABLE . " u
WHERE u.user_level=1 AND u.user_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
Open : includes/bbcode.php
Find :
代碼: 選擇全部
function bbencode_third_pass($text, $uid, $deprotect)
{
global $bbcode_tpl;代碼: 選擇全部
function bbencode_third_pass($text, $uid, $deprotect)
{
global $bbcode_tpl, $userdata;代碼: 選擇全部
if ( $deprotect ) {
$patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
$replacements[0] = $bbcode_tpl['show'];
}代碼: 選擇全部
if ( $deprotect || $userdata['user_level'] == ADMIN) {
$patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
$replacements[0] = $bbcode_tpl['show'];
}我的..原本有地方寫錯..^^||
真sorry
補上紅色的地方\r
#
#-----[ ACTION: OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ ACTION: FIND ]------------------------------------------
#
//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
#
#-----[ ACTION: ADD BElOW]------------------------------------------
#
if($valid == FALSE) {
if( $userdata['session_logged_in'] ) {
$sql = "SELECT u.user_id, u.user_level
FROM " . USERS_TABLE . " u
WHERE u.user_level=1 AND u.user_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}}
真sorry
補上紅色的地方\r
#
#-----[ ACTION: OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ ACTION: FIND ]------------------------------------------
#
//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
#
#-----[ ACTION: ADD BElOW]------------------------------------------
#
if($valid == FALSE) {
if( $userdata['session_logged_in'] ) {
$sql = "SELECT u.user_id, u.user_level
FROM " . USERS_TABLE . " u
WHERE u.user_level=1 AND u.user_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}}
最後由 Vance 於 2005-10-01 10:20 編輯,總共編輯了 2 次。

