[問題]文章太長,無法 po[尚待解決]

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

版主: 版主管理群

版面規則
本區是討論關於 phpBB 2.0.X 架設安裝上的問題,只要有安裝任何外掛,請到外掛討論相關版面按照公告格式發表。
(發表文章請按照公告格式發表,違者砍文)
頭像
sh85216s
竹貓忠實會員
竹貓忠實會員
文章: 306
註冊時間: 2003-09-04 20:13
來自: 阿里阿度

文章 sh85216s »

Martinet 寫:裝Mod裝錯...

居然把一大堆不該複製的都複製進去了..當然會錯= =a

仔細看一下裝Mod教學吧...

套句少林足球的話...「外掛不是這樣裝的~」


XD
無法理解您說的!!!

哦!我是貼了
phpBB 2.0.11 多國語言修正
這篇文章才出現上面的情形!
架設主機︰Fedora Core 5
上網方式:Hinet ADSL (2M/512K)
安裝程式:Apache + php + MySql
phpBB2 版本: phpBB 2.0.21
phpBB2 連結網址: 小站
Martinet
竹貓忠實會員
竹貓忠實會員
文章: 850
註冊時間: 2003-06-09 21:58
聯繫:

文章 Martinet »

哈~知道你的問題了

當你的文章裡出現 ' 這個魔術字元就會出現問題.

經過診斷..結果是..

你裝某外掛之後...

讓 phpBB 原本 使 文章內的 ' 變成 \' 的功能消失了..

於是造成這個問題...

至於解決方法..要在那行之前 呼叫一個php函式吧...
我去翻一下參考資料;)
Martinet
竹貓忠實會員
竹貓忠實會員
文章: 850
註冊時間: 2003-06-09 21:58
聯繫:

文章 Martinet »

用這個函數吧..

str_replce("'" , "\'" , 某變數)

閃去考試..先掰
最後由 Martinet 於 2004-11-26 09:05 編輯,總共編輯了 1 次。
頭像
sh85216s
竹貓忠實會員
竹貓忠實會員
文章: 306
註冊時間: 2003-09-04 20:13
來自: 阿里阿度

文章 sh85216s »

請多幫忙,備份資料已被我誤刪,現在已無退路,感恩!!
架設主機︰Fedora Core 5
上網方式:Hinet ADSL (2M/512K)
安裝程式:Apache + php + MySql
phpBB2 版本: phpBB 2.0.21
phpBB2 連結網址: 小站
神川小羽
調皮の小羽
調皮の小羽
文章: 1461
註冊時間: 2004-05-01 05:55
來自: 謎樣之筱語
聯繫:

文章 神川小羽 »

那應該是 includes下的 bbcode.php 吧\r
阿勒@@ 這個可難搞了 原諒偶 我對字串處理的函式粉沒概念@@
-.-
Martinet
竹貓忠實會員
竹貓忠實會員
文章: 850
註冊時間: 2003-06-09 21:58
聯繫:

文章 Martinet »

那跟bbcode.php沒有關係唷~

麻煩發文者把
Line : 302
File : /var/www/html/phpBB208a/includes/functions_post.php

上下5行左右的程式碼貼上..

(考試ing偷上中XD")
頭像
sh85216s
竹貓忠實會員
竹貓忠實會員
文章: 306
註冊時間: 2003-09-04 20:13
來自: 阿里阿度

文章 sh85216s »

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))
{
(302行) 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);
}
架設主機︰Fedora Core 5
上網方式:Hinet ADSL (2M/512K)
安裝程式:Apache + php + MySql
phpBB2 版本: phpBB 2.0.21
phpBB2 連結網址: 小站
Martinet
竹貓忠實會員
竹貓忠實會員
文章: 850
註冊時間: 2003-06-09 21:58
聯繫:

文章 Martinet »

good...

現在在\r
$sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id,
前面加上
str_replace("'" , "\'" , $post_message);
如果還有問題再說吧^^a
頭像
sh85216s
竹貓忠實會員
竹貓忠實會員
文章: 306
註冊時間: 2003-09-04 20:13
來自: 阿里阿度

文章 sh85216s »

是改成這樣吧\r

代碼: 選擇全部

        str_replace("'" , "\'" , $post_message);$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";
改了之後還是不能 po 文!
架設主機︰Fedora Core 5
上網方式:Hinet ADSL (2M/512K)
安裝程式:Apache + php + MySql
phpBB2 版本: phpBB 2.0.21
phpBB2 連結網址: 小站
Martinet
竹貓忠實會員
竹貓忠實會員
文章: 850
註冊時間: 2003-06-09 21:58
聯繫:

文章 Martinet »

不能Po文請把錯誤訊息po出來....=.=
頭像
sh85216s
竹貓忠實會員
竹貓忠實會員
文章: 306
註冊時間: 2003-09-04 20:13
來自: 阿里阿度

文章 sh85216s »

代碼: 選擇全部

 
Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near 'add_poll_option_text'])));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換' at line 1

INSERT INTO phpbb_posts_text (post_id, post_subject, bbcode_uid, post_text) VALUES (579, '', 'ba28df8b04', '下載檔案: [url]http://myweb.hinet.net/home6/riot/Multi-Language_Fix_2.0.11.txt[/url] # #-----[ OPEN 打開 ]------------------------------------------------ # posting.php # #-----[ FIND 尋找 ]------------------------------------------------ #618 列 [code:1:ba28df8b04]$poll_options = array();[/code:1:ba28df8b04] # #-----[ BEFORE ADD 之前, 加上 ]------------------------------------ # 預覽標題、預覽後欄框文章內容及標題、投票議題 # [code:1:ba28df8b04] $subject = ereg_replace("&","&",$subject); $message = ereg_replace("&","&",$message); $poll_title = ereg_replace("&","&",$poll_title);[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ #633 列 [code:1:ba28df8b04]$poll_options[$option_id] = htmlspecialchars(trim(stripslashes($option_text)));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # 預覽之後的投票選項 (option)、增加選項之後的舊選項、更新選項 # [code:1:ba28df8b04]$poll_options[$option_id] = ereg_replace("&","&",htmlspecialchars(trim(stripslashes($option_text))));[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ #640 列 [code:1:ba28df8b04]$poll_options[] = htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['add_poll_option_text'])));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # 新增投票選項之後欄框裡面的選項內容 # [code:1:ba28df8b04]$poll_options[] = ereg_replace("&","&",htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['add_poll_option_text']))));[/code:1:ba28df8b04] # #-----[ OPEN 打開 ]------------------------------------------------ # includesfunctions_post.php # #-----[ FIND 尋找 ]------------------------------------------------ #152 列 [code:1:ba28df8b04]$subject = htmlspecialchars(trim($subject));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # 發表之後的主題標題 # [code:1:ba28df8b04]$subject = ereg_replace("&","&",htmlspecialchars(trim($subject)));[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ #179 列 [code:1:ba28df8b04]$poll_title = htmlspecialchars(trim($poll_title));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # 發表之後的投票議題 # [code:1:ba28df8b04]$poll_title = ereg_replace("&","&",htmlspecialchars(trim($poll_title)));[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ #331 列 [code:1:ba28df8b04]$option_text = str_replace("''", "''", htmlspecialchars($option_text));[/code:1:ba28df8b04] # #-----[ AFTER, ADD 之後, 加上 ]------------------------------------ # 發表之後的投票選項 (2.0.4 起新產生的問題) # [code:1:ba28df8b04]$option_text = str_replace("&","&", $option_text);[/code:1:ba28df8b04] # #-----[ OPEN 打開 ]------------------------------------------------ # includesusercp_register.php # #-----[ FIND 尋找 ]------------------------------------------------ #108 列 [code:1:ba28df8b04]$$var = trim(htmlspecialchars($HTTP_POST_VARS[$param]));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # 使用者名稱 (2.0.4 起新產生的問題) # [code:1:ba28df8b04]$$var = str_replace("&","&",trim(htmlspecialchars($HTTP_POST_VARS[$param])));[/code:1:ba28df8b04] # #-----[ OPEN 打開 ]------------------------------------------------ # includesbbcode.php # #-----[ FIND 尋找 ]------------------------------------------------ # [code:1:ba28df8b04]$curr_pos = strpos($text, "[", $curr_pos);[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # 引言修正 # http://phpbb-tw.net/phpbb/viewtopic.php?p=102297#102297 # [code:1:ba28df8b04] if ( ord(substr($text, $curr_pos, 1)) > 0xa0 ) { $curr_pos += 2; continue; } else if ( substr($text, $curr_pos, 1) != '[' ) { $curr_pos++; continue; }[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ #483 列 [code:1:ba28df8b04]$code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\[#', '#\]#', '#\(#', '#\)#', '#\{#', '#\}#'); $code_entities_replace = array('<', '>', '&', ':', '[', ']', '(', ')', '{', '}');[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # code 標籤內的某些中文字變成 ?#91; ?#93; ?#123; ?#125; 問題 # [code:1:ba28df8b04]$code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\(#', '#\)#'); $code_entities_replace = array('<', '>', '&', ':', '(', ')');[/code:1:ba28df8b04] # #-----[ OPEN 打開 ]------------------------------------------------ # adminadmin_users.php # #-----[ FIND 尋找 ]------------------------------------------------ #219 列 [code:1:ba28df8b04]$username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username']))) : '';[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # [code:1:ba28df8b04]$username = ( !empty($HTTP_POST_VARS['username']) ) ? ereg_replace("&","&",trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username'])))) : '';[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ #285 列 [code:1:ba28df8b04]$location = htmlspecialchars(stripslashes($location)); $occupation = htmlspecialchars(stripslashes($occupation)); $interests = htmlspecialchars(stripslashes($interests)); $signature = htmlspecialchars(stripslashes($signature));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # [code:1:ba28df8b04]$location = ereg_replace("&","&",htmlspecialchars(stripslashes($location))); $occupation = ereg_replace("&","&",htmlspecialchars(stripslashes($occupation))); $interests = ereg_replace("&","&",htmlspecialchars(stripslashes($interests))); $signature = ereg_replace("&","&",htmlspecialchars(stripslashes($signature)));[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ #708 列 [code:1:ba28df8b04]$username = htmlspecialchars(stripslashes($username));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # [code:1:ba28df8b04]$username = ereg_replace("&","&",htmlspecialchars(stripslashes($username)));[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ # [code:1:ba28df8b04]$location = htmlspecialchars(stripslashes($location)); $occupation = htmlspecialchars(stripslashes($occupation)); $interests = htmlspecialchars(stripslashes($interests)); $signature = htmlspecialchars(stripslashes($signature));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- #719 列 [code:1:ba28df8b04]$location = ereg_replace("&","&",htmlspecialchars(stripslashes($location))); $occupation = ereg_replace("&","&",htmlspecialchars(stripslashes($occupation))); $interests = ereg_replace("&","&",htmlspecialchars(stripslashes($interests))); $signature = ereg_replace("&","&",htmlspecialchars(stripslashes($signature)));[/code:1:ba28df8b04] # #-----[ FIND 尋找 ]------------------------------------------------ #741 列 [code:1:ba28df8b04]$location = htmlspecialchars($this_userdata['user_from']); $occupation = htmlspecialchars($this_userdata['user_occ']); $interests = htmlspecialchars($this_userdata['user_interests']);[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # 從管理控制台編輯會員資料時,來自、 職業、 興趣三個欄位的多國文字顯示問題 # [code:1:ba28df8b04] $location = ereg_replace("&","&",htmlspecialchars($this_userdata['user_from'])); $occupation = ereg_replace("&","&",htmlspecialchars($this_userdata['user_occ'])); $interests = ereg_replace("&","&",htmlspecialchars($this_userdata['user_interests']));[/code:1:ba28df8b04] # #-----[ OPEN 打開 ]------------------------------------------------ # includes/functions.php # #-----[ FIND 尋找 ]------------------------------------------------ # (2.0.11 起新產生的問題) [code:1:ba28df8b04]$username = htmlspecialchars(rtrim(trim($username), "\\\"));[/code:1:ba28df8b04] # #-----[ REPLACE WITH 替換 ]---------------------------------------- # [code:1:ba28df8b04]$username = ereg_replace("&","&",htmlspecialchars(trim(trim($username), "\\\")));[/code:1:ba28df8b04] # #-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]------------------- # # EoM 外掛修正結束')

Line : 302\r
File : /var/www/html/phpBB208a/includes/functions_post.php
架設主機︰Fedora Core 5
上網方式:Hinet ADSL (2M/512K)
安裝程式:Apache + php + MySql
phpBB2 版本: phpBB 2.0.21
phpBB2 連結網址: 小站
Martinet
竹貓忠實會員
竹貓忠實會員
文章: 850
註冊時間: 2003-06-09 21:58
聯繫:

文章 Martinet »

我該複習每個函數的用法了..=.=

$post_message = str_replace("'" , "\'" , $post_message);

把剛我給你的那段改成上面這樣試試~
頭像
sh85216s
竹貓忠實會員
竹貓忠實會員
文章: 306
註冊時間: 2003-09-04 20:13
來自: 阿里阿度

文章 sh85216s »

這個時候應該開瓶香檳來慶祝一下!!

已經OK了!!

您有在開課嗎?跟您學如何?

..☆∵ ∴∵ ∴∵∴ ∵╭ ∵╭ ∴╭ ☆╭ ∴ ★∵∴
..∵ ∴★.∴∵∴ ╭ ╯╭ ╯╭ ╯╭ ╯∴∵∴∵∴
.☆.∵∴∵.∴∵∴▍▍ ▍▍ ▍▍ ▍▍☆ ★∵∴
▍.∴∵∴∵.∴▅███████████☆ ★∵
◥█▅▅▅▅███▅█▅█▅█▅█▅█▅███◤
.◥██████感█謝█有█你███████◤
....◥█████████████████◤\r

感謝 神州小羽 和 Martinet 的幫忙!!
架設主機︰Fedora Core 5
上網方式:Hinet ADSL (2M/512K)
安裝程式:Apache + php + MySql
phpBB2 版本: phpBB 2.0.21
phpBB2 連結網址: 小站
Martinet
竹貓忠實會員
竹貓忠實會員
文章: 850
註冊時間: 2003-06-09 21:58
聯繫:

文章 Martinet »

解決了就好^^a
我本身..其實年紀很小XD
也沒開課或什麼的..||

建議你慢邊參考書邊看phpBB的程式碼就行了:P
頭像
sh85216s
竹貓忠實會員
竹貓忠實會員
文章: 306
註冊時間: 2003-09-04 20:13
來自: 阿里阿度

文章 sh85216s »

多謝你的建言,再次感謝你!!
架設主機︰Fedora Core 5
上網方式:Hinet ADSL (2M/512K)
安裝程式:Apache + php + MySql
phpBB2 版本: phpBB 2.0.21
phpBB2 連結網址: 小站
主題已鎖定

回到「phpBB 2 安裝與使用」