1 頁 (共 1 頁)

[問題]關於強制報到PLUS

發表於 : 2004-12-03 00:13
arti
參考連結:御津闇慈前輩發表的強制報到plus
網站程式:2.0.10版

請問一下我有加上水怪,
但是這檔functions_post.php改的地方跟水怪有點衝突,
這應該要怎修改。
以下是強制報到PLUS的修改法

代碼: 選擇全部

#
#-----[ FIND ]------------------------------------------
#
      $sql = "UPDATE " . USERS_TABLE . "
         SET user_posts = user_posts $sign

\n#
#-----[ REPLACE WITH ]------------------------------------------
#
      $sql = "UPDATE " . USERS_TABLE . "
         SET user_posts = user_posts $sign $checkin ";
這下面是水怪的部分修改。

代碼: 選擇全部

#-----[ 尋找 ]-----------------------------------------------------------------------
#
	if ($mode != 'poll_delete')
	{
		[color=red]$sql = "UPDATE " . USERS_TABLE . "
			SET user_posts = user_posts $sign[/color] 
			WHERE user_id = $user_id";
		if (!$db->sql_query($sql, END_TRANSACTION))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}
	}

#
#-----[ 覆蓋為 ]---------------------------------------------------------------------
#
# 以下可自行設定發表主題與回覆文章時 HP 和 MP 以及經驗值的加減值\r
#
	if ($mode != 'poll_delete')
	{
		// 水怪 RPG
		if ( $mode == "newtopic" )
		{
			$reward_sql = ", rpg_cur_hp = rpg_cur_hp - 3, rpg_cur_mp = rpg_cur_mp - 3, rpg_cur_exp = rpg_cur_exp + 3"; // 發表主題 HP - 3 , MP - 3 , 經驗值 + 3
		}
		if ( $mode == "reply" )
		{
			$reward_sql = ", rpg_cur_hp = rpg_cur_hp - 2, rpg_cur_mp = rpg_cur_mp - 2, rpg_cur_exp = rpg_cur_exp + 2"; // 回覆文章 HP - 2 , MP - 2 , 經驗值 + 2
		}
		[color=red]$sql = "UPDATE " . USERS_TABLE . "
			SET user_posts = user_posts $sign $reward_sql[/color]
			WHERE user_id = $user_id";
		if (!$db->sql_query($sql, END_TRANSACTION))
		{
			message_die(GENERAL_ERROR, 'Error in posting' . $sql, '', __LINE__, __FILE__, $sql);
		}
		LevelUp($user_id);
	}

紅色字碼這段碼該怎置換成強制報到的碼。
水怪改完的是:
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts $sign $reward_sql

強制報到PLUS的是:\r
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts $sign $checkin ";


我如果這小段全部置換就無法發表跟回覆文章,
會出現這段碼錯誤。謝謝!

發表於 : 2004-12-03 07:51
御津闇慈
改成這樣\r
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts $sign $reward_sql $checkin ";

發表於 : 2004-12-03 17:33
arti
感謝您解答,
我試了一下如果在;之前有加上 " 會出現錯誤,
錯誤內容如下:
Parse error: parse error, unexpected T_STRING in D:\www\cofilm.net#qioeurqwe\phpbbs\includes\functions_post.php on line 498

去掉這個 " 就沒問題。

但是我現在又出現另一個問題,
在後台的基本組態上會出現下面情形,
沒辦法去啟動要指定報到版面。
圖檔

會是哪裡的 " 這個影響嗎?
我有次加上竹貓的公告條的外掛,
在後台連結上有這 " 也會造成公告消失。

發表於 : 2005-02-28 15:02
richer
http://phpbb-tw.net/phpbb/viewtopic.php?p=187478#187478

請參考一下
這是我剛剛裝這外掛的時候
所使用的解決辦法