[問題]內文許功蓋問題

phpBB Installation & Usage Support
phpBB 2 安裝於各類型作業平台之問題討論;外掛問題,請到相關版面依發問格式發表!
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

版面規則
本區是討論關於 phpBB 2.0.X 架設安裝上的問題,只要有安裝任何外掛,請到外掛討論相關版面按照公告格式發表。
(發表文章請按照公告格式發表,違者砍文)
aaron
星球公民
星球公民
文章: 37
註冊時間: 2002-05-29 01:51
聯繫:

[問題]內文許功蓋問題

文章 aaron »

●架設主機作業系統:Linux
●您的上網方式:ADSL (Hinet)。
●您安裝的程式:Apache1.3.34 (Unix) + php 4.4.2 + MySql 4.1.18-standard
●您的 phpBB2 版本:phpBB (2.0.20)。
●您的 domain(網域名稱) :twdesign.net
●您的 phpBB2 連結網址: http://twdesign.net/design/

phpbb系統是一路升級上來的,目前是2.0.20,也依照以下教學進行修正。

[教學] phpBB 2.0.15 多國語言 & 其他問題修正
http://phpbb-tw.net/phpbb/viewtopic.php?t=35623

[分享] 解決_許功蓋_的方法
http://phpbb-tw.net/phpbb/viewtopic.php?t=37061

但在發表文章時,標題使用許功蓋可以正常顯示,但是內文則會出現亂碼。

煩請高手相助,謝謝!
chiouss
竹貓忠實會員
竹貓忠實會員
文章: 1741
註冊時間: 2002-11-29 18:19

文章 chiouss »

你的 2.0.20 是哪個版本?Big5 or UTF8?
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

許功蓋的問題和多國語言修正無關.

建議您:
0. 補充說明: 您解決 '許功蓋' 的方法
1. 貼出發現 '亂碼' 的文章網址
2. 提供測試用帳號與密碼
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
brentsu
星球公民
星球公民
文章: 232
註冊時間: 2004-08-23 09:08
來自: BNW 時尚資訊網
聯繫:

文章 brentsu »

應該是 BIG5 吧?所以才要裝【多國語言修正】....
直接換成 UTF-8 版本,以後就免修正了,一勞永逸囉~~ :mrgreen:
※架設伺服器主機:Mac mini 1.5GHz, 1GB RAM x 三部
※架設主機作業系統:Mac OS X Server 10.6.6 Snow Leopard
※我的上網方式:固定制 ADSL 16M/8M、6 IP
※安裝的伺服器:Apache + php 5 + MySQL 5
※我的 phpBB2 版本:phpBB 3.0.x UTF-8 版
※BNW會議室網址: http://www.bnw.com.tw/conference/
chiouss
竹貓忠實會員
竹貓忠實會員
文章: 1741
註冊時間: 2002-11-29 18:19

文章 chiouss »

brentsu 寫:應該是 BIG5 吧?所以才要裝【多國語言修正】....
直接換成 UTF-8 版本,以後就免修正了,一勞永逸囉~~ :mrgreen:
我就是怕有人會用了 utf8 版還*加裝*多國語言修正阿! :Q
aaron
星球公民
星球公民
文章: 37
註冊時間: 2002-05-29 01:51
聯繫:

文章 aaron »

心靈捕手 寫:許功蓋的問題和多國語言修正無關.

建議您:
0. 補充說明: 您解決 '許功蓋' 的方法
1. 貼出發現 '亂碼' 的文章網址
2. 提供測試用帳號與密碼
是big5版本

0.完全依照上述連結教學,增加空白的方式
[分享] 解決_許功蓋_的方法
http://phpbb-tw.net/phpbb/viewtopic.php?t=37061

標題沒有問題,主要是內文

1.煩請參考 http://twdesign.net/design/viewtopic.php?t=24486
2.測試帳號twdesign密碼 123456

感激... :-D
aaron
星球公民
星球公民
文章: 37
註冊時間: 2002-05-29 01:51
聯繫:

文章 aaron »

附上functions_post.php 部分內容

代碼: 選擇全部

		$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject ', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject ', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}

		if ($mode == 'newtopic')
		{
			$topic_id = $db->sql_nextid();
		}
	}

	$edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";
	$sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";
	if (!$db->sql_query($sql, BEGIN_TRANSACTION))
	{
		message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
	}

	if ($mode != 'editpost')
	{
		$post_id = $db->sql_nextid();
	}

	$sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$post_subject ', '$bbcode_uid', '$post_message ')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message ',  bbcode_uid = '$bbcode_uid', post_subject = '$post_subject ' WHERE post_id = $post_id";
	if (!$db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
	}

	add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));

	//
	// Add poll
	// 
	if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2)
	{
		$sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title ', $current_time, " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title ', vote_length = " . ($poll_length * 86400) . " WHERE topic_id = $topic_id";
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}

		$delete_option_sql = '';
		$old_poll_result = array();
		if ($mode == 'editpost' && $post_data['has_poll'])
		{
			$sql = "SELECT vote_option_id, vote_result  
				FROM " . VOTE_RESULTS_TABLE . " 
				WHERE vote_id = $poll_id 
				ORDER BY vote_option_id ASC";
			if (!($result = $db->sql_query($sql)))
			{
				message_die(GENERAL_ERROR, 'Could not obtain vote data results for this topic', '', __LINE__, __FILE__, $sql);
			}

			while ($row = $db->sql_fetchrow($result))
			{
				$old_poll_result[$row['vote_option_id']] = $row['vote_result'];

				if (!isset($poll_options[$row['vote_option_id']]))
				{
					$delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id'];
				}
			}
		}
		else
		{
			$poll_id = $db->sql_nextid();
		}

		@reset($poll_options);

		$poll_option_id = 1;
		while (list($option_id, $option_text) = each($poll_options))
		{
			if (!empty($option_text))
			{
				$option_text = str_replace("\'", "''", dohtmlspecialchars($option_text));
				$poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0;

				$sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text ', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text ', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

To aaron:

建議您:
試試改用 ~倉木麻衣~ 兄的修改方法, 解決 '許功蓋'.
http://phpbb-tw.net/phpbb/viewtopic.php?p=226930#226930
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
aaron
星球公民
星球公民
文章: 37
註冊時間: 2002-05-29 01:51
聯繫:

文章 aaron »

心靈捕手 寫:To aaron:

建議您:
試試改用 ~倉木麻衣~ 兄的修改方法, 解決 '許功蓋'.
http://phpbb-tw.net/phpbb/viewtopic.php?p=226930#226930
謝謝您

我之前就有試過
會出現這樣的狀況

代碼: 選擇全部

Parse error: syntax error, unexpected T_LNUMBER in /home/twdesign/public_html/design/includes/functions.php on line 928
aaron
星球公民
星球公民
文章: 37
註冊時間: 2002-05-29 01:51
聯繫:

文章 aaron »

functions.php

代碼: 選擇全部

	// Behave as per HTTP/1.1 spec for others
	header('Location: ' . $server_protocol . $server_name . $server_port . $script_name . $url);
	exit;
}

function Fix_Backslash($org_str) { 
   //if ( mysql_client_encoding() != "big5" ) return mysql_client_encoding(); 

   $tmp_length = strlen($org_str); 

   for ( $tmp_i=0; $tmp_i<$tmp_length; $tmp_i++ ) { 
      $ascii_str_a = substr($org_str, $tmp_i , 1); 
      $ascii_str_b = substr($org_str, $tmp_i+1, 1); 

      $ascii_value_a = ord($ascii_str_a); 
      $ascii_value_b = ord($ascii_str_b); 

      if ( $ascii_value_a > 128 ) { 
         if ( $ascii_value_b == 92 ) { 
            $org_str = substr($org_str, 0, $tmp_i+2) . substr($org_str,$tmp_i+3); 
            $tmp_length = strlen($org_str); 
         } 
         $tmp_i++; 
      } 
   } 

   $tmp_length = strlen($org_str); 
   if ( substr($org_str, ($tmp_length-1), 1) == "\\\" ) $org_str .= chr(32); 

   $org_str = str_replace("\\\0", "\ 0", $org_str); 
   return $org_str; 
}

?>
functions_post.php

代碼: 選擇全部

//
// Post a new topic/reply/poll or edit existing post/poll
//
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)
{
	global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
	global $userdata, $user_ip;

//--修正許 功 蓋 問題開始 
$post_subject = Fix_Backslash($post_subject); 
$post_message = Fix_Backslash($post_message); 
$poll_title = Fix_Backslash($poll_title); 
$option_text = Fix_Backslash($option_text); 
//--修正許 功 蓋 問題結束

	include($phpbb_root_path . 'includes/functions_search.'.$phpEx);

	$current_time = time();

	if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') 
	{
		//
		// Flood control
		//
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

To aaron:

建議您:
將下列檔案壓縮後, 貼出下載連結.
includes/functions.php
includes/functions_post.php
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
aaron
星球公民
星球公民
文章: 37
註冊時間: 2002-05-29 01:51
聯繫:

文章 aaron »

~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

能再多附個posting.php來看看嗎?

剛有小測了一下
直接打許功蓋的話, 會出現如同原提問者所說的狀況
但是如果在這行衝碼字的後頭加上\(例如許\功\蓋\), 這樣反而一切正常
見此篇的測試結果
http://twdesign.net/design/viewtopic.ph ... 201#247201
感覺上可能是多做了stripslashes所造成的
謝絕所有私人訊息詢問外掛相關問題
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好

竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚
aaron
星球公民
星球公民
文章: 37
註冊時間: 2002-05-29 01:51
聯繫:

文章 aaron »

頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

aaron 寫:http://twbrand.com/designer/includes.rar

麻煩您了... :-D
以下的修改, 提供您參考:
#
#-----[ OPEN ]-----
#
includes/functions_post.php

#
#-----[ FIND ]-----
#

代碼: 選擇全部

		$message = str_replace('"', '\\"', $message);
#
#-----[ BEFORE, ADD ]-----
#

代碼: 選擇全部

		$message = addslashes($message);
#
#-----[ SAVE&CLOSE ]-----
#
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
主題已鎖定

回到「phpBB 2 安裝與使用」