可以看
MODX檔 或是
依照以下的step安裝:
打開
代碼: 選擇全部
index.php
代碼: 選擇全部
// Assign index specific vars
代碼: 選擇全部
//
// Integrated Topiclist v 2.0 START
//
// Topics text length
$MAX_STR_LEN = 40;
// Topics to display (Default: 5)
$MAX_TOPICS = 5;
// Order by
// topic_last_post_id (Default)
// topic_replies
// topic_views
$sortby="topic_last_post_id";
//
// Option of Toplist End
//
function cutStr($str) {
global $MAX_STR_LEN;
$str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str;
return $str;
}
$raw_auth_forums = $auth->acl_getf('f_read');
$auth_forums = array();
while(list($k,$v)=each($raw_auth_forums)) if($v['f_read'] == 1) $auth_forums[] =$k;
$auth_forums_sql = implode(',',$auth_forums);
$sql_array['SELECT'] = array('t.topic_id','t.topic_replies','t.topic_views','t.forum_id','f.forum_name','t.topic_title','t.topic_first_poster_colour','t.topic_first_poster_name','t.topic_last_poster_id','t.topic_last_post_id','t.topic_last_poster_name','t.topic_last_poster_colour','t.topic_last_post_time','t.topic_poster');
$sql_array['FROM'] = array(TOPICS_TABLE => 't',FORUMS_TABLE => 'f');
// SQL array for obtaining topics/stickies
$sql_array = array(
'SELECT' => implode(',',$sql_array['SELECT']),
'FROM' => $sql_array['FROM'],
'WHERE' => ' t.forum_id IN ('.$auth_forums_sql .') AND f.forum_id = t.forum_id',
'ORDER_BY' => 't.'.$sortby.' DESC'
);
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query_limit($sql, $MAX_TOPICS, 0);
while ($row = $db->sql_fetchrow($result))
{
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $row['topic_id']);
$template->assign_block_vars('topiclist', array(
'TOPIC_TITLE' => cutStr($row['topic_title']),
'FORUM_NAME' => $row['forum_name'],
'FORUM_ID' => $row['forum_id'],
'LAST_REPLY_TIME' => $user->format_date($row['topic_last_post_time']),
'LAST_REPLYER' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_LAST_POST_POSTER' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_TOPIC_POSTER' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_REPLIES' => $row['topic_replies'],
'TOPIC_VIEWS' => $row['topic_views'],
'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
'TOPIC_POSTER' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'FORUM_ID' => $row['forum_id'],
'FORUM_URL' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'TOPIC_URL' => $view_topic_url
)
);
}
$db->sql_freeresult($result);
//
// Integrated Topiclist V 2.0 END
//
代碼: 選擇全部
styles/subsilver2/template/index_body.html
代碼: 選擇全部
<!-- INCLUDE overall_footer.html -->
代碼: 選擇全部
<!-- MOD: Integrated Topiclist 2.0 START -->
<br clear="all" />
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th width="20%"> {L_FORUM} </th>
<th width="30%"> {L_TOPICS} </th>
<th width="20%"> {L_AUTHOR} </th>
<th width="5%"> {L_REPLIES} </th>
<th width="5%"> {L_VIEWS} </th>
<th width="20%"> {L_LAST_POST} </th>
</tr>
<!-- BEGIN topiclist -->
<tr>
<td class="row1" align="center"><a class="forumlink" href="{topiclist.FORUM_URL}">{topiclist.FORUM_NAME}</a></td>
<td class="row2" align="center"><a href="{topiclist.TOPIC_URL}" class="topictitle">{topiclist.TOPIC_TITLE}</a></td>
<td class="row1" align="center"><p class="topiclist"><a href="{topiclist.U_TOPIC_POSTER}">{topiclist.TOPIC_POSTER}</a></p></td>
<td class="row2" align="center">{topiclist.TOPIC_REPLIES}</td>
<td class="row1" align="center">{topiclist.TOPIC_VIEWS}</td>
<td class="row2" align="center">{topiclist.LAST_REPLY_TIME}<br />{topiclist.LAST_REPLYER}<a href="{topiclist.U_LAST_POST}">{LAST_POST_IMG}</a></td>
</tr>
<!-- END topiclist -->
</table>
<!-- MOD: Integrated Topiclist 2.0 END -->
程式(於index.php)之
// Topics text length
$MAX_STR_LEN = 40; 主題名稱最長長度
// Topics to display (Default: 5)
$MAX_TOPICS = 5; 顯示主題個數
// Order by
// topic_last_post_id 發表時間(預設)
// topic_replies 回覆數
// topic_views 觀看數
$sortby="topic_last_post_id"; 依何而排? (自上方三種選來用)
//
// Option of Toplist End
//