1 頁 (共 1 頁)

[問題]全域公告安裝問題(已解決)

發表於 : 2006-02-02 15:49
azxcvba81
●架設主機作業系統:Unix
●快速架站程式:Appserv 1.3.33
●您的上網方式:ADSL
●您的 phpBB2 版本:phpBB 2.0.16
●錯誤代碼:請使用 BBcode 標籤將錯誤代碼標註,範例如下(這是為了避免語法衝突):
viewforum.php有2個

代碼: 選擇全部

$topic_rowset = array();
$total_announcements = 0;
都要改嗎?
includes/functions.php找不到\r

代碼: 選擇全部

$sql = "SELECT 
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
WHERE f.cat_id = c.cat_id

發表於 : 2006-02-02 16:38
心靈捕手
1. 正常情況只會有一個才對啊! :-?

建議您:
將 viewforum.php 壓縮後, 貼出下載連結.

2. 因為您有安裝" 簡易子版面", 所以找不到 includes/functions.php 對應的代碼.

建議您:
參考這篇文章修正:
http://phpbb-tw.net/phpbb/viewtopic.php?p=188499#188499

發表於 : 2006-02-02 17:48
azxcvba81
我只改一個

代碼: 選擇全部

$topic_rowset = array(); 
$total_announcements = 0;
另外一個不知道要怎麼辦 :roll:
viewforum檔案:
http://myweb.hinet.net/home8/azxcvba81/viewforum.rar

發表於 : 2006-02-02 18:59
心靈捕手
azxcvba81 寫:我只改一個

代碼: 選擇全部

$topic_rowset = array(); 
$total_announcements = 0;
另外一個不知道要怎麼辦 :roll:
viewforum檔案:
http://myweb.hinet.net/home8/azxcvba81/viewforum.rar
翻了外掛安裝說明:
有一個, 應該是外掛新增;
另外一個, 則是必須移除.

以下的修改, 提供您參考:
#
#-----[ FIND ]-----
#

代碼: 選擇全部

// 
// All GLOBAL announcement data, this keeps GLOBAL announcements 
// on each viewforum page ... 
// 
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username 
   FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2 
   WHERE t.topic_poster = u.user_id 
      AND p.post_id = t.topic_last_post_id 
      AND p.poster_id = u2.user_id 
      AND t.topic_type = " . POST_GLOBAL_ANNOUNCE . " 
   ORDER BY t.topic_last_post_id DESC "; 
if( !$result = $db->sql_query($sql) ) 
{ 
   message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql); 
} 

// 2 rows deleted - Global announcement MOD
while( $row = $db->sql_fetchrow($result) ) 
{ 
   $topic_rowset[] = $row; 
   $total_announcements++; 
} 

$db->sql_freeresult($result); 
// End add - Global announcement MOD
//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2
	WHERE t.forum_id = $forum_id 
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_last_post_id
		AND p.poster_id = u2.user_id
		AND t.topic_type = " . POST_ANNOUNCE . " 
	ORDER BY t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

$topic_rowset = array();
$total_announcements = 0;
while( $row = $db->sql_fetchrow($result) )
{
	$topic_rowset[] = $row;
	$total_announcements++;
}

$db->sql_freeresult($result);
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

// 
// All GLOBAL announcement data, this keeps GLOBAL announcements 
// on each viewforum page ... 
// 
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username 
   FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2 
   WHERE t.topic_poster = u.user_id 
      AND p.post_id = t.topic_last_post_id 
      AND p.poster_id = u2.user_id 
      AND t.topic_type = " . POST_GLOBAL_ANNOUNCE . " 
   ORDER BY t.topic_last_post_id DESC "; 
if( !$result = $db->sql_query($sql) ) \r
{ 
   message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql); 
} 

$topic_rowset = array();
$total_announcements = 0;
while( $row = $db->sql_fetchrow($result) ) 
{ 
   $topic_rowset[] = $row; 
   $total_announcements++; 
} 

$db->sql_freeresult($result); 
// End add - Global announcement MOD
//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2
	WHERE t.forum_id = $forum_id 
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_last_post_id
		AND p.poster_id = u2.user_id
		AND t.topic_type = " . POST_ANNOUNCE . " 
	ORDER BY t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

// 2 rows deleted - Global announcement MOD
while( $row = $db->sql_fetchrow($result) )
{
	$topic_rowset[] = $row;
	$total_announcements++;
}

$db->sql_freeresult($result);
ps.
建議您:
試試效能提升: -by- ETERNAL
http://phpbb-tw.net/phpbb/viewtopic.php?p=211452#211452

發表於 : 2006-02-03 10:12
azxcvba81
已經可以用了,謝謝