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

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

版主: 版主管理群

主題已鎖定
赤兔
星球公民
星球公民
文章: 140
註冊時間: 2005-02-08 14:19

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

文章 赤兔 »

問題外掛:區分發表主題與回覆
使用版本: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 程式碼所造成
因原作者網站已無法訪問,故在此請教該如何解決?
最後由 赤兔 於 2005-05-02 11:35 編輯,總共編輯了 1 次。
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8547
註冊時間: 2004-04-30 01:54
來自: Taiwan

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

文章 心靈捕手 »

赤兔 寫: $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
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
赤兔
星球公民
星球公民
文章: 140
註冊時間: 2005-02-08 14:19

文章 赤兔 »

依您指示修正後功能已恢復正常,非常感謝您  :-D
主題已鎖定

回到「外掛問題討論」