[問題] 改良型引言 1.0.0

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

版主: 版主管理群

主題已鎖定
阿維
竹貓忠實會員
竹貓忠實會員
文章: 868
註冊時間: 2003-02-23 13:36
來自: 台南市

[問題] 改良型引言 1.0.0

文章 阿維 »

問題外掛:改良型引言 1.0.0
參考連結:http://www.phpbb-tw.net/phpbb/viewtopic.php?t=28049
使用版本:phpBB 2.0.19
網站位置:http://forums.jcms.com.tw
狀況描述:
我在升級完2.0.19了之後發現引言代碼會變成"WesleyWei";p="22668 寫到:"
可是phpBB 2.0.18卻沒有這個問題,請問這是不是跟下面這段phpbb_2.0.18_to_2.0.19有關?

代碼: 選擇全部

#
#-----[ FIND ]---------------------------------------------
# Line 255
	$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\\".*?\\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\1]");

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
	$text = bbencode_first_pass_pda($text, $uid, '/\[quote=\\\\\\\"(.*?)\\\\\\\"\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\\\"\\\1\\\\\"]");

#
#-----[ FIND ]---------------------------------------------
# Line 392
				if( preg_match('#\[quote=\\\\\"#si', $possible_start, $match) && !preg_match('#\[quote=\\\\\"(.*?)\\\\\"\]#si', $possible_start) )
				{
					// OK we are in a quote tag that probably contains a ] bracket.
					// Grab a bit more of the string to hopefully get all of it..
					if ($close_pos = strpos($text, '"]', $curr_pos + 9))
					{
						if (strpos(substr($text, $curr_pos + 9, $close_pos - ($curr_pos + 9)), '[quote') === false)
						{
							$possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 2);

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
				if( preg_match('#\[quote=\\\\\"#si', $possible_start, $match) && !preg_match('#\[quote=\\\\\"(.*?)\\\\\"\]#si', $possible_start) )
				{
					// OK we are in a quote tag that probably contains a ] bracket.
					// Grab a bit more of the string to hopefully get all of it..
					if ($close_pos = strpos($text, '"]', $curr_pos + 14))
					{
						if (strpos(substr($text, $curr_pos + 14, $close_pos - ($curr_pos + 14)), '[quote') === false)
						{
							$possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 7);
改良型引言 1.0.0

代碼: 選擇全部

#
#-----[ FIND ]---------------------------------------------
# around line 269
	$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\\\\"[^"]*?\\\\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\1]");

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
	// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff with an pre-defined post entry
	$text = bbencode_first_pass_pda($text, $uid, '/\[quote=p=(\\\\\\\"[0-9]+\\\\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=p=\\\1]");

	$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\\".*?\\\\\");p=(\\\\\\\"[0-9]+\\\\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\1;p=\\\2]");
最後由 阿維 於 2006-10-30 09:09 編輯,總共編輯了 2 次。
阿維
竹貓忠實會員
竹貓忠實會員
文章: 868
註冊時間: 2003-02-23 13:36
來自: 台南市

文章 阿維 »

請問有前輩知道解決的方法嗎?
因為官方也沒釋出修正的方法,請問可以幫忙檢查嗎?
hpo14
竹貓忠實會員
竹貓忠實會員
文章: 414
註冊時間: 2003-05-10 16:37
來自: M Starbucks

文章 hpo14 »

以下為不負責發表 !!

在修改前,請先最好備份動作,以免發生不測... :oops:

第一種\r

代碼: 選擇全部

# 
#-----[ FIND ]--------------------------------------------- 
# Line 255 
   $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\\".*?\\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\1]"); 

# 
#-----[ REPLACE WITH ]--------------------------------------------- 
# 
   $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\\\\".*?\\\\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\\\"\\\1\\\\\"]");
第二種\r

代碼: 選擇全部

# 
#-----[ FIND ]--------------------------------------------- 
# Line 255 
   $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\\".*?\\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\1]"); 

# 
#-----[ REPLACE WITH ]--------------------------------------------- 
# 
   $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\\\\".*?\\\\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\\\"\\\1\\\\\";]";);
分兩種是因為我不確定... :-(
所以都試試看吧.. Jordan 兄 ;-)
非官方外掛問題區公告: [必看]請配合發問格式及明確主題發問(2004 02/16更新)

竹貓星球發問規則:
http://phpbb-tw.net/phpbb/viewtopic.php?t=16149

請不要濫用 私人訊息 或是 MSN 問問題...你以為竹貓是架好看的阿
阿維
竹貓忠實會員
竹貓忠實會員
文章: 868
註冊時間: 2003-02-23 13:36
來自: 台南市

文章 阿維 »

我想我知道原因了
原因是因為這兩段的關係,現在都已經沒問題了! :mrgreen:

略過修改:

代碼: 選擇全部

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

#
#-----[ FIND ]---------------------------------------------
# Line 28
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');
$html_entities_replace = array('&', '<', '>');

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#');
$html_entities_replace = array('&', '<', '>', '"');

代碼: 選擇全部

# 
#-----[ OPEN ]--------------------------------------------- 
# 
privmsg.php

#
#-----[ FIND ]---------------------------------------------
# Line 38
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');
$html_entities_replace = array('&', '<', '>');

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#');
$html_entities_replace = array('&', '<', '>', '"');
如果是Big5的phpBB有做Scorpion前輩的多國語系修正,該步驟不需要修改!
阿維
竹貓忠實會員
竹貓忠實會員
文章: 868
註冊時間: 2003-02-23 13:36
來自: 台南市

文章 阿維 »

回報,這個改法在"私人訊息"還是會失效,請問有前輩能夠幫忙解決這個問題嗎? :-(

我的版本是phpBB 2.0.21
頭像
hentaibbc
版面管理員
版面管理員
文章: 342
註冊時間: 2005-09-01 18:01

文章 hentaibbc »

JORDAN 寫:回報,這個改法在"私人訊息"還是會失效,請問有前輩能夠幫忙解決這個問題嗎? :-(

我的版本是phpBB 2.0.21
最近有人問我這個問題...
在陰錯陽差之下...
發現用下面的改法可以解決...

但是我不知道會不會有什麼其他的後遺症....^^"

不過...有空的人倒是可以幫我看看...



打開posting.php
找到

代碼: 選擇全部

			$message = '[quote="' . $quote_username . '";p="' . $post_id . '"]' . $message . '[/quote]';
改成

代碼: 選擇全部

			$message = '[quote="' . $quote_username . ';p=' . $post_id . '"]' . $message . '[/quote]';
打開template/subSilver/posting_topic_review.tpl
找到

代碼: 選擇全部

message[{postrow.U_POST_ID}] = "[quote="{postrow.POSTER_NAME}";p="{postrow.U_POST_ID}"]\n{postrow.PLAIN_MESSAGE}\n[/quote]";
改成

代碼: 選擇全部

message[{postrow.U_POST_ID}] = "[quote="{postrow.POSTER_NAME};p={postrow.U_POST_ID}"]\n{postrow.PLAIN_MESSAGE}\n[/quote]";
就麻煩有空有閒的人看一下吧!!
主題已鎖定

回到「外掛問題討論」