[問題][hide][/hide]在news mod無效!

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
slipknot
星球普通子民
星球普通子民
文章: 22
註冊時間: 2003-07-27 11:44

[問題][hide][/hide]在news mod無效!

文章 slipknot »

問題外掛:hide hack 2.0.5與news mod 1.2.1 CHT
參考連結:
使用版本:phpBB 2.0.6
網站位置:
狀況描述:

使用[hide][/hide]的文章在news mod中觀看的話可以完全顯示出來,該如何解決呢?謝謝喔!
slipknot
星球普通子民
星球普通子民
文章: 22
註冊時間: 2003-07-27 11:44

文章 slipknot »

好久了....沒人回答,容我自推一次吧 Q_Q
頭像
godbless
竹貓忠實會員
竹貓忠實會員
文章: 647
註冊時間: 2002-05-17 06:02
來自: 台北市南京東路4段
聯繫:

文章 godbless »

理論上你必須在NEWS.PHP裡面加入HIDE的參數值,你可以參考其他BBCODE的安裝方式一起寫進去!

這個我沒有試過,我只能就理論上給你一個建議
外掛問題區發問格式就在這裡,請務必一定照著格式來~!
你不照著規則來,就算是也搞不清楚你的問題在哪裡!
新手問問題不是罪惡
罪惡的是自己沒有先做好本分和功課,說話的口氣也不好,再加上態度有好像我們這群人欠你多少似的~~!!
竹貓星球發問規則:
http://phpbb-tw.net/phpbb/viewtopic.php?t=16149
發問比率最高的句子翻譯:
Please ensure both the install/ and contrib/ directories are deleted
請確認install和contrib資料夾已被刪除(奇怪,翻一下英漢字典有這麼困難嗎)
吉兒
星球普通子民
星球普通子民
文章: 9
註冊時間: 2003-10-13 04:46
來自: 藤原豆腐店

文章 吉兒 »

我寫在news.php裡面, 結果portal看到的還是沒有隱藏
一不做二不休去改了portal.php...
有興趣的人裝裝看, 有問題請回報\r

代碼: 選擇全部

#######################################################
##
## Mod Title: Hide Mod for News
## Mod Author: Jill
## Mod Description: Change Hide Mod to work with news mod on Portal
##
## Files To Edit:	fetchposts.php
##			portal.php
##			
#######################################################
#
#-----------[ OPEN ]-----------------------------------------
#
fetchposts.php

#
#-----------[ FIND ]-----------------------------------------
#
	// First: If there isn't a "[" and a "]" in the message, don't bother.
	if (! (strpos($text, "[") && strpos($text, "]")) )
	{
		// Remove padding, return.
		$text = substr($text, 1);
		return $text;
	}

#
#-----------[ ADD AFTER ]-----------------------------------------
#
	// -- hide mod for news ---------------------------------------
	// -- add
	// [hide] and [/hide] for hiding messages
	$text = preg_replace("/\[hide:$uid\].*\[\/hide:$uid\]/si", "[hidden text]", $text);
	// -- end hide mod for news -----------------------------------

#
#-----------[ OPEN ]-----------------------------------------
#
portal.php

#
#-----------[ FIND ]-----------------------------------------
#
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);

#
#-----------[ ADD AFTER ]-----------------------------------------
#
include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);	// hide mod for news

#
#-----------[ FIND ]-----------------------------------------
#
	$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);
	$i = intval($HTTP_GET_VARS['article']);

#
#-----------[ ADD AFTER ]-----------------------------------------
#
	// -- hide mod for news ---------------------------------------
	// -- add
	$valid = FALSE;
	if( $userdata['session_logged_in'] ) {
		$sql = "SELECT p.poster_id, p.topic_id
			FROM " . POSTS_TABLE . " p
			WHERE p.topic_id = " . $fetchposts[$i]['topic_id'] . "
			AND p.poster_id = " . $userdata['user_id'];

		$resultat = $db->sql_query($sql);
		$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;
	}

	$fetchposts[$i]['post_text'] = bbencode_third_pass($fetchposts[$i]['post_text'], $fetchposts[$i]['bbcode_uid'], $valid);
	// -- end hide mod for news -----------------------------------

#
#-----------[ SAVE/CLOSE ALL FILES ]-----------------------------------------
#
# EoM
主題已鎖定

回到「外掛問題討論」