[問題]Cash mod造成無法發文

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

版主: 版主管理群

主題已鎖定
atthis
星球公民
星球公民
文章: 216
註冊時間: 2003-07-29 19:16

[問題]Cash mod造成無法發文

文章 atthis »

●架設主機作業系統:Linux RedHat 7.2
●上網方式:學術網\r
●安裝的程式:Apache 1.3.22-1+ php 4.0.6-8+ MySql 3.23.43-1
●phpBB2 版本:phpBB 2.0.5
問題外掛:Cash Mod
參考連結:http://www.phpbb.com/phpBB/viewtopic.php?t=94055
網站位置:http://chianglab.bio.ncku.edu.tw/phpBB2/
狀況描述:
啟動Cash mod的版面,要發表新文章會出現\r
Error retrieving post data

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near 'AND post_time > -3600' at line 4

SELECT count(post_id) as postcount FROM phpbb_posts WHERE poster_id = AND post_time > -3600

Line : 120
File : /var/www/html/phpBB2/includes/functions_cash.php

代碼: 選擇全部

case 'newtopic':
          $sql = "SELECT count(post_id) as postcount
                     FROM " . POSTS_TABLE . "
                     WHERE poster_id = " . $userdata['user_id'] . "
                     AND post_time > " . ($current_time - (3600 * $board_config['cash_disable_spam_time']));
要回覆文章則會出現\r
Error retrieving post data

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near 'AND post_time > -3600' at line 4

SELECT count(post_id) as postcount FROM phpbb_posts WHERE poster_id = AND post_time > -3600

Line : 162
File : /var/www/html/phpBB2/includes/functions_cash.php

代碼: 選擇全部

case 'reply':
          $sql = "SELECT count(post_id) as postcount
                     FROM " . POSTS_TABLE . "
                     WHERE poster_id = " . $userdata['user_id'] . "
                     AND post_time > " . ($current_time - (3600 * $board_config['cash_disable_spam_time']));
無法發文,關掉Cash mod後才可正常發文
請問是那裡弄錯了呢 :?:

備註:
我有修正過這兩個漏洞,不知道有沒有影響\r
http://www.phpbb.com/phpBB/viewtopic.php?t=113826
http://www.phpbb.com/phpBB/viewtopic.php?t=112052
ethan
星球公民
星球公民
文章: 218
註冊時間: 2002-06-01 09:48
聯繫:

文章 ethan »

從 sql error 看起來,都是少掉 $userdata['user_id'] 的關係
你可能要從頭檢查一遍是不是修改時位置有放錯?

* $userdata 是 phpBB 的該使用中的會員的資料
atthis
星球公民
星球公民
文章: 216
註冊時間: 2003-07-29 19:16

文章 atthis »

沒錯,我有一段位置放錯了
謝謝
主題已鎖定

回到「外掛問題討論」