1 頁 (共 1 頁)

[問題]01樣式置頂側邊 v0.2 alpha

發表於 : 2006-02-18 23:56
bc010843
參考外掛

問題:照著教學改之後沒發現任何改變......請問這是什麼功能?
有domo圖或domo站可參考嗎?

phpbb 2.0.19
os linux
style icg
快速程式 無\r

謝謝

發表於 : 2006-02-19 01:10
bu
你有裝 簡易子分區嗎?

DEMO:
圖檔

發表於 : 2006-02-19 01:18
bc010843
是的,我的討論區有裝子分區外掛,這二個外掛是否不相容?

謝謝

發表於 : 2006-02-19 01:25
bu
會需要一些修改\r

原本的

代碼: 選擇全部

//
// 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)
        );
    }
} 
修改成

代碼: 選擇全部

//
// 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('sub_forum.if_sticky.stickyrow', array(
            'TOPIC_TITLE' => $topic_title,
            'TOPIC_INTRO' => $topic_intro,
            'U_VIEW_TOPIC' => $view_topic_url)
        );
    }
} 
原本的

代碼: 選擇全部

    <!-- 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 -->
修改成

代碼: 選擇全部

    <!-- 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="{sub_forum.if_sticky.stickyrow.U_VIEW_TOPIC}">{sub_forum.if_sticky.stickyrow.TOPIC_TITLE}</a><br /><span class="gen">{sub_forum.if_sticky.stickyrow.TOPIC_INTRO}</span></td></tr>
        <!-- END stickyrow -->
        </table>
   </td><td width="80%">
   <!-- END if_sticky -->
請試試 ;)