TOP5放進Protal的問題(已解決)

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

版主: 版主管理群

主題已鎖定
yuei
星球公民
星球公民
文章: 93
註冊時間: 2005-12-20 22:14

TOP5放進Protal的問題(已解決)

文章 yuei »

問題外掛:TOP5
參考連結:http://phpbb-tw.net/phpbb/viewtopic.php ... 4%F4%A6%E2
使用版本:phpbb2.0.19 UTF-8
網站位置:抱歉,目前還在單機測試
狀況描述:

請教一下個位前輩\r
我已經順利的將TOP5放進portal中,也順利的將UTF-8碼的亂碼解決了

請問,我想在TOP5顯示的主題後面,增加他的所在討論區位置\r
有點像是http://www.gamer.com.tw/
這樣\r

我該怎麼做呢?
這是我portal中的原始碼,順便提供給有須要將TOP5放進portal的人\r

代碼: 選擇全部

            <?php
define('FORUMS_TABLE', 'phpbb_forums'); 
define('TOPICS_TABLE', 'phpbb_topics'); 
   define('IN_PHPBB', true); 
   $phpbb_root_path = './'; 
   include($phpbb_root_path . 'config.php'); 
   include($phpbb_root_path . 'extension.inc'); 
   include($phpbb_root_path . 'includes/db.'.$phpEx); 

// 
// Mod setting 
// 
// Topics text length 
//$MAX_STR_LEN = 100; 
// Topics to display 
$MAX_TOPICS = 5; 
// 0 => users can see all topics including authorized issue(but they cant read the posts) 
// 1 => users can see only authorized topics 


function cutStr($str) { 

   global $MAX_STR_LEN; 

   $str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, 50) . ' ...') : $str; 
   return $str; 
} 


$sql = "SELECT topic_id, topic_title
   FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
   WHERE t.forum_id = f.forum_id
   AND t.topic_moved_id = '0' and f.auth_view=0 and t.topic_type = '0' 
   ORDER BY t.topic_replies DESC LIMIT 0, $MAX_TOPICS"; 
   

if( !$result = $db->sql_query($sql) ) 
{ 
   echo '<p align="center"><font color="red"><b>ADV_TOPN_MOD TOPICS QUERY ERROR!!</b></font></p>'; 
   exit; 
} 


// fetch rows 
while( $rows = $db->sql_fetchrow($result) ) 
{ 
   echo "<tr><td><font size='-1'><a href=\"./viewtopic.php?t=".$rows['topic_id']."\" target=\"_blank\">".cutStr($rows["topic_title"])."</a></td></tr>"; 
} 
$db->sql_freeresult($rows); 
$db->sql_close(); 
?>
最後由 yuei 於 2006-02-01 18:25 編輯,總共編輯了 1 次。
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8547
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

我猜想:
如果以您原先參考的文章, 修改後, 有顯示出 topic_title 的話,
那麼應該也不難顯示出 forum_id 吧!

建議您:
參考這個討論串:
http://phpbb-tw.net/phpbb/viewtopic.php?t=34466
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
yuei
星球公民
星球公民
文章: 93
註冊時間: 2005-12-20 22:14

文章 yuei »

心靈捕手 寫:我猜想:
如果以您原先參考的文章, 修改後, 有顯示出 topic_title 的話,
那麼應該也不難顯示出 forum_id 吧!

建議您:
參考這個討論串:
http://phpbb-tw.net/phpbb/viewtopic.php?t=34466
成功了!!
謝謝心靈捕手大指教!!! ;-)
主題已鎖定

回到「外掛問題討論」