1 頁 (共 1 頁)

[問題]安裝Insert Attachment Into Post v1.0.3出錯,請教[已解决]

發表於 : 2007-08-31 08:45
飞鹰007
問題外掛:Insert Attachment Into Post v1.0.3 (插入圖像附件到文章指定地方)
參考連結: http://phpbb-tw.net/phpbb/viewtopic.php?t=40357
使用版本:phpBB phpBB-2.0.22/ attach_mod_2.4.5/hide mod for phpbb 2.0.22
網站位置:本地測試
狀況描述: 出現 Parse error: parse error in I:\phpBB-2.0.22\phpbb\attach_mod\posting_attachments.php on line 1205


在1025行為

代碼: 選擇全部

$this->attach_filename = str_replace(array(',', '.', '!', '?', '?, '?, '?, '?, '?, '?, ';', ':', '@', "'", '"', '&'), array('', '', '', '', 'ue', 'ue', 'oe', 'oe', 'ae', 'ae', '', '', '', '', '', 'and'), $this->attach_filename);
在1026行為

代碼: 選擇全部

$this->attach_filename = str_replace(array('$', '?, '>','<','?,'%','=','/','(',')','#','*','+',"\\",'{','}','[',']'), array('dollar', 'ss','greater','lower','paragraph','percent','equal','','','','','','','','','','',''), $this->attach_filename);

請問各位大大,該如何解決這個問題???
謝謝。

Re: [問題]安裝Insert Attachment Into Post v1.0.3出錯,請教

發表於 : 2007-08-31 18:37
心靈捕手
飞鹰007 寫:問題外掛:Insert Attachment Into Post v1.0.3 (插入圖像附件到文章指定地方)
參考連結: http://phpbb-tw.net/phpbb/viewtopic.php?t=40357
使用版本:phpBB phpBB-2.0.22/ attach_mod_2.4.5/hide mod for phpbb 2.0.22
網站位置:本地測試
狀況描述: 出現 Parse error: parse error in I:\phpBB-2.0.22\phpbb\attach_mod\posting_attachments.php on line 1205


在1025行為

代碼: 選擇全部

$this->attach_filename = str_replace(array(',', '.', '!', '?', '?, '?, '?, '?, '?, '?, ';', ':', '@', "'", '"', '&'), array('', '', '', '', 'ue', 'ue', 'oe', 'oe', 'ae', 'ae', '', '', '', '', '', 'and'), $this->attach_filename);
在1026行為

代碼: 選擇全部

$this->attach_filename = str_replace(array('$', '?, '>','<','?,'%','=','/','(',')','#','*','+',"\",'{','}','[',']'), array('dollar', 'ss','greater','lower','paragraph','percent','equal','','','','','','','','','','',''), $this->attach_filename);

請問各位大大,該如何解決這個問題???
謝謝。
依個人經驗, 只要有修改過這個檔案, 就會造成這兩行出錯.
attach_mod\posting_attachments.php

解決之道有二:
1. 試試用原始檔的這兩行 複製/ 貼上 (覆蓋)已修改的檔案.
2. 或者, 將這兩行 '註解' 掉.

發表於 : 2007-09-01 09:54
飞鹰007
感謝心靈捕手大大的回覆。

上面的那兩行是原始的源碼,未改動。

如果注解掉那兩行。則 Insert Attachment Into Post 不可用,hide mod也不可用。我想可能是因爲注解掉那兩行後導致無法獲取附加檔的名稱。

發表於 : 2007-09-02 06:56
心靈捕手
飞鹰007 寫:感謝心靈捕手大大的回覆。

上面的那兩行是原始的源碼,未改動。

如果注解掉那兩行。則 Insert Attachment Into Post 不可用,hide mod也不可用。我想可能是因爲注解掉那兩行後導致無法獲取附加檔的名稱。
依我的經驗, 即使沒有修改那兩行,
只要有修改此檔案其他地方, 這兩行就會因改變編碼而出錯.

我懷疑是編碼造成的問題, 依經驗, 只要再依原始檔案的原始碼覆蓋回去即可.

當然如果沒有辦法的話, 那麼奉勸您不要更動此檔.

發表於 : 2007-09-02 14:41
飞鹰007
謝謝,我再找找看有什麽方法可以把附加檔放入post bbcode裡。

發表於 : 2007-09-02 17:52
飞鹰007
此文档的编码问题已解决。。

需要用ultraedit这个软件打开保存即可。。

以前版本的attach中的这个文件并无编码的问题,可以直接用记事本编辑保存,不知是不是作者保存文档时不小心用上了其它的编码。。。

發表於 : 2007-09-03 15:43
~倉木麻衣~
飞鹰007 寫:以前版本的attach中的这个文件并无编码的问题,可以直接用记事本编辑保存,不知是不是作者保存文档时不小心用上了其它的编码。。。
非也
那是因為作者追加了對西歐語系的檢查, 所以在存檔時採用了西歐語系的編碼
$this->attach_filename = str_replace(array(',', '.', '!', '?', 'ü', 'Ü', 'ö', 'Ö', 'ä', 'Ä', ';', ':', '@', "'", '"', '&'), array('', '', '', '', 'ue', 'ue', 'oe', 'oe', 'ae', 'ae', '', '', '', '', '', 'and'), $this->attach_filename);
用UltraEdit開啟, 應該是被轉成DOS格式
這樣子雖然可以解決問題, 但也同時失去了檢測/替換西歐字元的作用
雖然不敢保證這種作法不會出現其它後遺症, 但還是建議使用EmEditor開啟
利用EmEditor的指定編碼功能, 重新以西歐語系讀取、修改、存檔較為保險

發表於 : 2007-09-04 08:44
飞鹰007
原來如此,謝謝倉木麻衣版大的指教。這就去重新修正。