最近發現(!!??) 了這個網站,並看到了他特別的側邊欄,因此我就在 phpbb 上實作了

for subSilver
(不建議新手安裝,三成的老烏..我想應該就可以了

---------------------------
OPEN viewforum.php
FIND
代碼: 選擇全部
//
// Grab all the basic data (all topics except announcements)
// for this forum
//
代碼: 選擇全部
//
// All sticky data, this keeps sticky
// on each viewforum page ...
// edit by bu
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username, pt.*
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2, " . POSTS_TEXT_TABLE . " pt
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 pt.post_id = p.post_id
AND t.topic_type = " . POST_STICKY . "
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_sticky = array();
$total_sticky = 0;
while( $row = $db->sql_fetchrow($result) )
{
$topic_rowset_sticky[] = $row;
$total_sticky++;
}
$db->sql_freeresult($result);
代碼: 選擇全部
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
代碼: 選擇全部
'L_STICKY_SIDEBAR' => $lang['Post_Sticky'].$lang['Topics'],
代碼: 選擇全部
//
// End header
//
代碼: 選擇全部
//
// dump out the sticky bar
// by bu
function cutStr($str,$MAX_STR_LEN=40) {
if (function_exists('mb_strimwidth'))
{
$str = mb_strimwidth($str, 0, $MAX_STR_LEN , '...', 'utf-8');
}
else
{
$str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str;
}
return $str;
}
if( $total_sticky )
{
$template->assign_block_vars('if_sticky', array());
for($j = 0; $j < $total_sticky; $j++)
{
$topic_id = $topic_rowset_sticky[$j]['topic_id'];
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset_sticky[$j]['topic_title']) : $topic_rowset_sticky[$j]['topic_title'];
$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
$topic_intro = cutStr($topic_rowset_sticky[$j]['post_text'],72);
$template->assign_block_vars('if_sticky.stickyrow', array(
'TOPIC_TITLE' => $topic_title,
'TOPIC_INTRO' => $topic_intro,
'U_VIEW_TOPIC' => $view_topic_url)
);
}
}
代碼: 選擇全部
<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
<th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_REPLIES} </th>
<th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th>
<th align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
<!-- BEGIN topicrow -->
代碼: 選擇全部
<!-- BEGIN if_sticky -->
<table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr><td valign="top" width="20%">
<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
<tr><th class="thTop" nowrap="nowrap">{L_STICKY_SIDEBAR}</th></tr>
<!-- BEGIN stickyrow -->
<tr><td class="row1"><a href="{if_sticky.stickyrow.U_VIEW_TOPIC}">{if_sticky.stickyrow.TOPIC_TITLE}</a><br /><span class="gen">{if_sticky.stickyrow.TOPIC_INTRO}</span></td></tr>
<!-- END stickyrow -->
</table>
</td><td width="80%">
<!-- END if_sticky -->
代碼: 選擇全部
<!-- END switch_no_topics -->
<tr>
<td class="catBottom" align="center" valign="middle" colspan="6" height="28"><span class="genmed">{L_DISPLAY_TOPICS}: {S_SELECT_TOPIC_DAYS}
<input type="submit" class="liteoption" value="{L_GO}" name="submit" />
</span></td>
</tr>
</table>
代碼: 選擇全部
<!-- BEGIN if_sticky -->
</td></tr></table>
<!-- END if_sticky -->