01樣式置頂側邊 v0.2 alpha

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
bu
版面管理員
版面管理員
文章: 443
註冊時間: 2003-02-23 12:46
來自: 25° 4′N 121° 29′E
聯繫:

01樣式置頂側邊 v0.2 alpha

文章 bu »

MOD: 01樣式置頂側邊 v0.2 alpha

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


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

---------------------------
OPEN viewforum.php

FIND

代碼: 選擇全部

//
// Grab all the basic data (all topics except announcements)
// for this forum
//
BEFORE, ADD

代碼: 選擇全部

//
// 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);
FIND

代碼: 選擇全部

'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 
AFTER, ADD

代碼: 選擇全部

'L_STICKY_SIDEBAR' => $lang['Post_Sticky'].$lang['Topics'],
FIND

代碼: 選擇全部

//
// End header
//
AFTER, ADD

代碼: 選擇全部

//
// 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)
        );
    }
}
OPEN templates/subSilver/viewforum_body.tpl

代碼: 選擇全部

<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
	  <th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
	  <th width="50" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_REPLIES}&nbsp;</th>
	  <th width="100" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_AUTHOR}&nbsp;</th>
	  <th width="50" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_VIEWS}&nbsp;</th>
	  <th align="center" class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
	</tr>
	<!-- BEGIN topicrow -->
BEFORE, ADD

代碼: 選擇全部

    <!-- 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 -->
FIND

代碼: 選擇全部

	<!-- END switch_no_topics -->
	<tr> 
	  <td class="catBottom" align="center" valign="middle" colspan="6" height="28"><span class="genmed">{L_DISPLAY_TOPICS}:&nbsp;{S_SELECT_TOPIC_DAYS}&nbsp; 
		<input type="submit" class="liteoption" value="{L_GO}" name="submit" />
		</span></td>
	</tr>
  </table>
AFTER,ADD

代碼: 選擇全部

 <!-- BEGIN if_sticky -->
    </td></tr></table>
    <!-- END if_sticky -->
~ bu @ 2006
*譯文資料在phpBB 技術文件
bu.femto-size
*和我聯絡,請寄 or Google Talk 圖檔
*作品: Intergrated Toplist & Message Can
主題已鎖定

回到「非官方認證外掛」