1 頁 (共 1 頁)

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

發表於 : 2003-09-18 11:46
slipknot
問題外掛:hide hack 2.0.5與news mod 1.2.1 CHT
參考連結:
使用版本:phpBB 2.0.6
網站位置:
狀況描述:

使用[hide][/hide]的文章在news mod中觀看的話可以完全顯示出來,該如何解決呢?謝謝喔!

發表於 : 2003-10-05 11:24
slipknot
好久了....沒人回答,容我自推一次吧 Q_Q

發表於 : 2003-10-05 13:32
godbless
理論上你必須在NEWS.PHP裡面加入HIDE的參數值,你可以參考其他BBCODE的安裝方式一起寫進去!

這個我沒有試過,我只能就理論上給你一個建議

發表於 : 2003-11-15 03:30
吉兒
我寫在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