1 頁 (共 1 頁)

[問題] 有一個錯誤, 不知如何解決. (已經解決~)

發表於 : 2005-05-29 17:32
chsa
問題外掛:應該是裝了這全域公告global_announcement_1.2.8, i-Commend_Mod_1.0.5.外掛後發生問題.
參考連結:無
使用版本:phpBB 2.0.14
網站位置:http://chsa.bounceme.net/phpbb2/portal.php
安裝外掛:貨幣系統 2.2.2, 註冊時間為 15 秒, 偽子分區 2.0.1, 報到系統, 主題類型, Links mod 1.2.2, WIO User Icon, Advanced Quick Reply Mod 1.1.1, 系統文章強迫斷行, ezportal 2.1.8, Forum_Information - 1.0.1, 進階快速回覆, Bank 銀行 V3, 在ezportal中加入最多發文者, Generation Time 2.0.0, 付費瀏覽 1.0.9, 多國語言修正, session force, Recent Topics Block for Smartor's ezPortal, 在入口加入 top5, Fix message_die, Hide Mode for 2.0.4, 增加版權說明, 增加樓層顯示, Reply BACKGROUND, i-Forum Rule, 與版面管理原增加水平線, 個人小檔案修改, 全域公告global_announcement_1.2.8, i-Commend_Mod_1.0.5.
狀況描述:

進入後台時左邊選單上方就跑出這個了?! 請幫我解決! 謝謝 ^^

代碼: 選擇全部

Parse error: parse error, unexpected T_DOUBLE_ARROW in d:\xxxx\www\phpbb2\admin\admin_ug_auth.php on line 539

發表於 : 2005-05-29 23:34
心靈捕手
To chsa:

如果, 您知道可能是安裝哪個外掛出錯的話,
那麼, 建議您: 回頭查看該外掛的安裝說明,
重新比對一次 admin/admin_ug_auth.php 的修正.

或者, 您也可以貼出該檔案在 539 行, 附近的程式碼.

發表於 : 2005-05-30 18:27
chsa
謝謝回覆!! 我得539行在下..

代碼: 選擇全部

//
		// Update user level to user for appropriate users
		// 
		switch ( SQL_LAYER )
		{
			case 'postgresql':
				$sql = "SELECT u.user_id 
					FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa
					WHERE ug.user_id = u.user_id 
						AND aa.group_id = ug.group_id 
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")
					GROUP BY u.user_id 
					HAVING SUM(aa.auth_mod) = 0 
					UNION (
						SELECT u.user_id  
						FROM " . USERS_TABLE . " u 
						WHERE NOT EXISTS ( 
							SELECT aa.auth_mod 
							FROM " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa 
							WHERE ug.user_id = u.user_id 
								AND aa.group_id = ug.group_id
						)
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")  
						GROUP BY u.user_id
					)";
				break;
	case 'oracle':              
				$sql = "SELECT u.user_id 
					FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa 
					WHERE ug.user_id = u.user_id(+)
						AND aa.group_id = ug.group_id(+) 
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")
					GROUP BY u.user_id 
					HAVING SUM(aa.auth_mod) = 0";
倒數10行是539行

發表於 : 2005-05-30 19:30
心靈捕手
To chsa:

我以 phpbb 2.0.15 該檔原始碼, 做比對;
上頭貼出的部份, 並沒有更動以及發現錯誤.

方便的話, 請貼出您修改後的該檔案, 或者連結;
我可以再幫您比對一下.

ps.
您提出可疑的外掛中, 我只有安裝過 global_announcement_1.2.8
我只能針對這個外掛的修改, 加以比對.

發表於 : 2005-05-30 19:45
chsa
在次謝謝您..

admin_ug_auth.php

發表於 : 2005-05-30 20:13
心靈捕手
chsa 寫:在次謝謝您..

admin_ug_auth.php
發現兩個地方有誤, 建議您修正, 如下:

代碼: 選擇全部

#
#-----{ Find ]-----
#
$auth_field_match = array(
	'auth_view' => AUTH_VIEW,
	'auth_read' => AUTH_READ,
	'auth_post' => AUTH_POST,
	'auth_reply' => AUTH_REPLY,
	'auth_edit' => AUTH_EDIT,
	'auth_delete' => AUTH_DELETE,
	'auth_sticky' => AUTH_STICKY,
	'auth_announce' => AUTH_ANNOUNCE, 
	'auth_vote' => AUTH_VOTE, 
	'auth_pollcreate' => AUTH_POLLCREATE);

$field_names = array(
	'auth_view' => $lang['View'],
	'auth_read' => $lang['Read'],
	'auth_post' => $lang['Post'],
	'auth_reply' => $lang['Reply'],
	'auth_edit' => $lang['Edit'],
	'auth_delete' => $lang['Delete'],
	'auth_sticky' => $lang['Sticky'],
	'auth_announce' => $lang['Announce'], 
	'auth_vote' => $lang['Vote'], 
	'auth_pollcreate' => $lang['Pollcreate'],
	// Start add - Global announcement MOD
        'auth_globalannounce' => AUTH_GLOBALANNOUNCE);
        // End add - Global announcement MOD
        
#
#-----[ Replace With ]-----
#
$auth_field_match = array(
	'auth_view' => AUTH_VIEW,
	'auth_read' => AUTH_READ,
	'auth_post' => AUTH_POST,
	'auth_reply' => AUTH_REPLY,
	'auth_edit' => AUTH_EDIT,
	'auth_delete' => AUTH_DELETE,
	'auth_sticky' => AUTH_STICKY,
	'auth_announce' => AUTH_ANNOUNCE, 
	'auth_vote' => AUTH_VOTE, 
	'auth_pollcreate' => AUTH_POLLCREATE,
// Start add - Global announcement MOD
'auth_globalannounce' => AUTH_GLOBALANNOUNCE);
// End add - Global announcement MOD

$field_names = array(
	'auth_view' => $lang['View'],
	'auth_read' => $lang['Read'],
	'auth_post' => $lang['Post'],
	'auth_reply' => $lang['Reply'],
	'auth_edit' => $lang['Edit'],
	'auth_delete' => $lang['Delete'],
	'auth_sticky' => $lang['Sticky'],
	'auth_announce' => $lang['Announce'], 
	'auth_vote' => $lang['Vote'], 
	'auth_pollcreate' => $lang['Pollcreate'],
// Start add - Global announcement MOD
'auth_globalannounce' => $lang['Globalannounce']);
// End add - Global announcement MOD

#
#-----[ Find ]-----
#      
, auth_globalannounce = 0WHERE group_id = $group_id";

#
#-----[ Replace With ]-----
#
, auth_globalannounce = 0 WHERE group_id = $group_id";

發表於 : 2005-05-30 20:34
chsa
謝謝您已做修正, 一樣跑出\r

代碼: 選擇全部

Parse error: parse error, unexpected T_DOUBLE_ARROW in d:\p h p b b 2 . 0 . 1 3\www\phpbb2\admin\admin_ug_auth.php on line 542

發表於 : 2005-05-30 20:41
俊俊
535 -> 541 行

代碼: 選擇全部

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't obtain forum information", "", __LINE__, __FILE__, $sql,
		// Start add - Global announcement MOD
		'auth_globalannounce' => $lang['Globalannounce']);
		// End add - Global announcement MOD
	}
錯錯錯....

是\r

代碼: 選擇全部

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't obtain forum information", "", __LINE__, __FILE__, $sql,
	}

代碼: 選擇全部

		// Start add - Global announcement MOD
		'auth_globalannounce' => $lang['Globalannounce']);
		// End add - Global announcement MOD
是在67 -> 77行

代碼: 選擇全部

$auth_field_match = array(
	'auth_view' => AUTH_VIEW,
	'auth_read' => AUTH_READ,
	'auth_post' => AUTH_POST,
	'auth_reply' => AUTH_REPLY,
	'auth_edit' => AUTH_EDIT,
	'auth_delete' => AUTH_DELETE,
	'auth_sticky' => AUTH_STICKY,
	'auth_announce' => AUTH_ANNOUNCE, 
	'auth_vote' => AUTH_VOTE, 
	'auth_pollcreate' => AUTH_POLLCREATE);
把 最後的 ); 改做 , 再在下邊加

代碼: 選擇全部

		// Start add - Global announcement MOD
		'auth_globalannounce' => $lang['Globalannounce']);
		// End add - Global announcement MOD

即是\r

代碼: 選擇全部

$auth_field_match = array(
	'auth_view' => AUTH_VIEW,
	'auth_read' => AUTH_READ,
	'auth_post' => AUTH_POST,
	'auth_reply' => AUTH_REPLY,
	'auth_edit' => AUTH_EDIT,
	'auth_delete' => AUTH_DELETE,
	'auth_sticky' => AUTH_STICKY,
	'auth_announce' => AUTH_ANNOUNCE, 
	'auth_vote' => AUTH_VOTE, 
	'auth_pollcreate' => AUTH_POLLCREATE,
	// Start add - Global announcement MOD
	'auth_globalannounce' => $lang['Globalannounce']);
	// End add - Global announcement MOD
PS 是根據你給我們的檔案的....

發表於 : 2005-05-30 20:58
chsa
To 俊俊:

已修改, 謝謝, 一樣跑出\r

代碼: 選擇全部

Parse error: parse error, unexpected '}' in d:\p h p b b 2 . 0 . 1 3\www\phpbb2\admin\admin_ug_auth.php on line 541

發表於 : 2005-05-30 21:40
~倉木麻衣~
chsa 寫:To 俊俊:

已修改, 謝謝, 一樣跑出\r

代碼: 選擇全部

Parse error: parse error, unexpected '}' in d:\p h p b b 2 . 0 . 1 3\www\phpbb2\admin\admin_ug_auth.php on line 541
因為少刪一個,

代碼: 選擇全部

   if ( !($result = $db->sql_query($sql)) ) 
   { 
      message_die(GENERAL_ERROR, "Couldn't obtain forum information", "", __LINE__, __FILE__, $sql, 
   }
在$sql後頭的, 刪掉即可

發表於 : 2005-05-30 21:53
心靈捕手
chsa 寫:To 俊俊:

已修改, 謝謝, 一樣跑出\r

代碼: 選擇全部

Parse error: parse error, unexpected '}' in d:\p h p b b 2 . 0 . 1 3\www\phpbb2\admin\admin_ug_auth.php on line 541
呵! 呵! 俊俊 幫您找到的錯誤, 我倒是沒注意到,
那個部份, 應該是要這樣修正:

代碼: 選擇全部

#
#-----[ Find ]-----
# ps. 這是您的原錯誤碼\r
	$sql = "SELECT * 
		FROM " . FORUMS_TABLE . " f
		ORDER BY forum_order";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't obtain forum information", "", __LINE__, __FILE__, $sql,
// Start add - Global announcement MOD
'auth_globalannounce' => $lang['Globalannounce']);
// End add - Global announcement MOD
	}
#
#-----[ Replace With ]-----
#
	$sql = "SELECT * 
		FROM " . FORUMS_TABLE . " f
		ORDER BY forum_order";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't obtain forum information", "", __LINE__, __FILE__, $sql);
	}

發表於 : 2005-05-31 19:37
chsa
謝謝~倉木麻衣~, 心靈捕手, 俊俊前輩們耐心教導, 尤其心靈捕手前輩耐心教導十分感謝.. :mrgreen: