1 頁 (共 1 頁)

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

發表於 : 2003-08-07 09:51
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

發表於 : 2003-08-07 15:13
ethan
從 sql error 看起來,都是少掉 $userdata['user_id'] 的關係
你可能要從頭檢查一遍是不是修改時位置有放錯?

* $userdata 是 phpBB 的該使用中的會員的資料

發表於 : 2003-08-10 19:54
atthis
沒錯,我有一段位置放錯了
謝謝