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

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

版主: 版主管理群

主題已鎖定
azxcvba81
星球普通子民
星球普通子民
文章: 14
註冊時間: 2004-04-19 19:01

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

文章 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
最後由 azxcvba81 於 2006-02-03 10:13 編輯,總共編輯了 2 次。
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8532
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

1. 正常情況只會有一個才對啊! :-?

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

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

建議您:
參考這篇文章修正:
http://phpbb-tw.net/phpbb/viewtopic.php?p=188499#188499
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
azxcvba81
星球普通子民
星球普通子民
文章: 14
註冊時間: 2004-04-19 19:01

文章 azxcvba81 »

我只改一個

代碼: 選擇全部

$topic_rowset = array(); 
$total_announcements = 0;
另外一個不知道要怎麼辦 :roll:
viewforum檔案:
http://myweb.hinet.net/home8/azxcvba81/viewforum.rar
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8532
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

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
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
azxcvba81
星球普通子民
星球普通子民
文章: 14
註冊時間: 2004-04-19 19:01

文章 azxcvba81 »

已經可以用了,謝謝
主題已鎖定

回到「外掛問題討論」