1 頁 (共 1 頁)

[求助]無法於 modcp 刪除主題 (已解決)

發表於 : 2005-05-02 10:50
赤兔
問題外掛:區分發表主題與回覆
使用版本:phpBB 2.0.14
架站程式:Apache 2.0.52 + MySQL 4.0.22 + PHP 4.3.10 + phpMyAdmin 2.6.0 pl3
網站位置:localhost
狀況描述:
在 modcp 刪除主題時出現錯誤:
Could not update user post count information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'user_reply = user_reply - 9 WHERE user_id = 2' at line 3

UPDATE phpbb_users SET user_reply = user_reply + 1 WHERE user_id = 2

Line : 323
File : modcp.php
與錯誤訊息有關的 mopcp.php 程式碼\r

代碼: 選擇全部

			while ( $row = $db->sql_fetchrow($result) )
			{
				$count_sql[] = "UPDATE " . USERS_TABLE . " 
					SET user_posts = user_posts - " . $row['posts'] . " 
					user_reply = user_reply - " . $row['posts'] . " 
					WHERE user_id = " . $row['poster_id'];
			}
			$db->sql_freeresult($result);

			if ( sizeof($count_sql) )
			{
				for($i = 0; $i < sizeof($count_sql); $i++)
				{
					if ( !$db->sql_query($count_sql[$i]) )
					{
						message_die(GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql);
					}
				}
			}
			
			$sql = "SELECT post_id 
				FROM " . POSTS_TABLE . " 
				WHERE topic_id IN ($topic_id_sql)";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql);
			}
Line 323 是\r

代碼: 選擇全部

						message_die(GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql);
研判是此 MOD 修改 modcp.php 程式碼所造成
因原作者網站已無法訪問,故在此請教該如何解決?

Re: [求助]無法於 modcp 刪除主題

發表於 : 2005-05-02 11:22
心靈捕手
赤兔 寫: $count_sql[] = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts - " . $row['posts'] . "
user_reply = user_reply - " . $row['posts'] . "
WHERE user_id = " . $row['poster_id'];
建議您:
將引言的部份做以下的修改:

代碼: 選擇全部

$count_sql[] = "UPDATE " . USERS_TABLE . " 
					SET user_posts = user_posts - " . $row['posts'] . "[color=red][b], [/b][/color]
					user_reply = user_reply - " . $row['posts'] . " 
					WHERE user_id = " . $row['poster_id'];
參考連結:
http://wang5555.dnsfor.me/phpbb2/viewtopic. ... 7100#27100

發表於 : 2005-05-02 11:31
赤兔
依您指示修正後功能已恢復正常,非常感謝您  :-D