[問題]內文許功蓋問題
版主: 版主管理群
版面規則
本區是討論關於 phpBB 2.0.X 架設安裝上的問題,只要有安裝任何外掛,請到外掛討論相關版面按照公告格式發表。
(發表文章請按照公告格式發表,違者砍文)
本區是討論關於 phpBB 2.0.X 架設安裝上的問題,只要有安裝任何外掛,請到外掛討論相關版面按照公告格式發表。
(發表文章請按照公告格式發表,違者砍文)
[問題]內文許功蓋問題
●架設主機作業系統: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
但在發表文章時,標題使用許功蓋可以正常顯示,但是內文則會出現亂碼。
煩請高手相助,謝謝!
●您的上網方式: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
但在發表文章時,標題使用許功蓋可以正常顯示,但是內文則會出現亂碼。
煩請高手相助,謝謝!
應該是 BIG5 吧?所以才要裝【多國語言修正】....
直接換成 UTF-8 版本,以後就免修正了,一勞永逸囉~~
直接換成 UTF-8 版本,以後就免修正了,一勞永逸囉~~
※架設伺服器主機: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/
※架設主機作業系統: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/
是big5版本心靈捕手 寫:許功蓋的問題和多國語言修正無關.
建議您:
0. 補充說明: 您解決 '許功蓋' 的方法
1. 貼出發現 '亂碼' 的文章網址
2. 提供測試用帳號與密碼
0.完全依照上述連結教學,增加空白的方式
[分享] 解決_許功蓋_的方法
http://phpbb-tw.net/phpbb/viewtopic.php?t=37061
標題沒有問題,主要是內文
1.煩請參考 http://twdesign.net/design/viewtopic.php?t=24486
2.測試帳號twdesign密碼 123456
感激...
附上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";
To aaron:
建議您:
試試改用 ~倉木麻衣~ 兄的修改方法, 解決 '許功蓋'.
http://phpbb-tw.net/phpbb/viewtopic.php?p=226930#226930
建議您:
試試改用 ~倉木麻衣~ 兄的修改方法, 解決 '許功蓋'.
http://phpbb-tw.net/phpbb/viewtopic.php?p=226930#226930
謝謝您心靈捕手 寫: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 928functions.php
functions_post.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;
}
?>代碼: 選擇全部
//
// 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
//能再多附個posting.php來看看嗎?
剛有小測了一下
直接打許功蓋的話, 會出現如同原提問者所說的狀況
但是如果在這行衝碼字的後頭加上\(例如許\功\蓋\), 這樣反而一切正常
見此篇的測試結果
http://twdesign.net/design/viewtopic.ph ... 201#247201
感覺上可能是多做了stripslashes所造成的
剛有小測了一下
直接打許功蓋的話, 會出現如同原提問者所說的狀況
但是如果在這行衝碼字的後頭加上\(例如許\功\蓋\), 這樣反而一切正常
見此篇的測試結果
http://twdesign.net/design/viewtopic.ph ... 201#247201
感覺上可能是多做了stripslashes所造成的
謝絕所有私人訊息詢問外掛相關問題
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好
竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好
竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚


