請選擇 進入手機版 | 繼續訪問電腦版

微剋多資訊

 找回密碼
 註冊

Sign in with google

Google帳號登入

搜索
回覆 2則 瀏覽 16897篇
Line

[技巧教學] Discuz X2.5 首頁橫排美化

簽到天數: 208

該用戶今日未簽到

升級   100%

發表於 2013-7-7 12:36 | 顯示全部樓層 |閱讀模式
適用版本 : Discuz X 2.5
支援語系 : All
演示 : http://nter.twbbs.org/bbs
效果圖 :


修改如下 :

打開  template/風格/forum/discuz.htm(風格不同,代碼可能會有些差異)

  1.                                                         <td class="fl_g" width="$cat[forumcolwidth]">

  2.                                                                 <div class="fl_icn_g"{if !empty($forum[extra][iconwidth]) && !empty($forum[icon])} style="width: {$forum[extra][iconwidth]}px;"{/if}>

  3.                                                                 <!--{if $forum[icon]}-->

  4.                                                                         $forum[icon]


  5.                                                                 <!--{else}-->

  6.                                                                         <a href="$forumurl"{if $forum[redirect]} target="_blank"{/if}><img src="{IMGDIR}/forum{if $forum[folder]}_new{/if}.gif" alt="$forum[name]" /></a>

  7.                                                                 <!--{/if}-->

  8.                                                                 </div>

  9.                                                                 <dl{if !empty($forum[extra][iconwidth]) && !empty($forum[icon])} style="margin-left: {$forum[extra][iconwidth]}px;"{/if}>

  10.                                                                         <dt><a href="$forumurl"{if $forum[redirect]} target="_blank"{/if}{if $forum[extra][namecolor]} style="color: {$forum[extra][namecolor]};"{/if}>$forum[name]</a><!--{if $forum[todayposts] && !$forum['redirect']}--><em class="xw0 xi1" title="{lang forum_todayposts}"> ($forum[todayposts])</em><!--{/if}--></dt>


  11.                                                                         <!--{if empty($forum[redirect])}--><dd><em>{lang forum_threads}: <!--{echo dnumber($forum[threads])}--></em>, <em>{lang forum_posts}: <!--{echo dnumber($forum[posts])}--></em></dd><!--{/if}-->

  12.                                                                         <dd>

  13.                                                                         <!--{if $forum['permission'] == 1}-->

  14.                                                                                 {lang private_forum}

  15.                                                                         <!--{else}-->


  16.                                                                                 <!--{if $forum['redirect']}-->

  17.                                                                                         <a href="$forumurl" class="xi2">{lang url_link}</a>

  18.                                                                                 <!--{elseif is_array($forum['lastpost'])}-->

  19.                                                                                         <!--{if $cat['forumcolumns'] < 3}-->

  20.                                                                                                 <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost" class="xi2"><!--{echo cutstr($forum[lastpost][subject], 30)}--></a> <cite>$forum[lastpost][dateline] <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>


  21.                                                                                         <!--{else}-->

  22.                                                                                                 <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{lang forum_lastpost}: $forum[lastpost][dateline]</a>

  23.                                                                                         <!--{/if}-->

  24.                                                                                 <!--{else}-->

  25.                                                                                         {lang never}


  26.                                                                                 <!--{/if}-->

  27.                                                                         <!--{/if}-->

  28.                                                                         </dd>

  29.                                                                         <!--{hook/index_forum_extra $forum[fid]}-->

  30.                                                                 </dl>

  31.                                                         </td>
複製代碼
修改為
  1. <td class="fl_g" width="$cat[forumcolwidth]" style="padding:10px 5px; ">
  2.     <script language="javascript">
  3.     function forumbackshow(id){
  4.     document.getElementById(id).style.background="#f8f8f8";
  5.     }
  6.     function forumbackout(id){
  7.     document.getElementById(id).style.background="";
  8.     }
  9.     function showgoto() {
  10.        var i, args=showgoto.arguments; document.showgtvlaue = false;
  11.        for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
  12.     }
  13.     </script>
  14.     <!--/***************************************************************************/-->
  15.     <div id="showback_$forum[fid]" style="border:1px solid #ccc; cursor:default;" title="雙擊進入">
  16.     <div style="padding:5px; ">
  17.     <style>
  18.     .ficodiv {float:left;}
  19.     .ficodiv,.ficodiv img{width:56px; height:56px; overflow:hidden; margin-top:2px; margin-right:5px;}
  20.     .f_ttdiv {height:56px; line-height:20px;overflow:hidden;}
  21.     .f_name {height:20px; overflow:hidden;}
  22.     .f_name small{float:right;color:#aaa;}
  23.     .f_name small span{color:#f30;}
  24.     .f_name a span{font-size:14px;}
  25.     .f_lyhp {float:left;}
  26.     .f_lyhp {color:#999;}
  27.     .f_bkjs {height:20px; line-height:18px; overflow:hidden;color:#888;}

  28.     .f_tzmh {padding:5px; height:18px; line-height:20px; overflow:hidden;}
  29.     </style>
  30.        <div class="ficodiv">
  31.              <!--{if $forum[icon]}-->
  32.              $forum[icon]
  33.              <!--{else}-->
  34.          <a href="$forumurl"{if $forum[redirect]} target="_blank"{/if}>
  35.              <img src="{IMGDIR}/forum{if $forum[folder]}_new{/if}.gif" alt="$forum[name]" />
  36.              </a>
  37.              <!--{/if}-->
  38.        </div>

  39.        <div class="f_ttdiv" {if !empty($forum[extra][iconwidth]) && !empty($forum[icon])} style="margin-left: {$forum[extra][iconwidth]}px;"{/if}>
  40.                <div class="f_name" title="$forum[name]">
  41.                <small>
  42.                <!--{if $forum[todayposts] && !$forum['redirect']}-->
  43.                (<span title="{lang forum_todayposts}">$forum[todayposts]</span>)
  44.                <!--{/if}-->
  45.                </small>
  46.                <a href="$forumurl" {if $forum[redirect]}target="_blank"{/if}{if $forum[extra][namecolor]} style="color:{$forum[extra][namecolor]};"{/if}>

  47.                <span>$forum[name]</span>
  48.                </a>
  49.                </div>
  50.               <div class="f_name">
  51.               <!--{if empty($forum[redirect])}-->
  52.               <div class="f_lyhp">
  53.                       <span>主題:</span><em style="color:#f60;">$forum[threads]</em>
  54.               </div><div style="float:left;">
  55.                      <span>帖子:</span><em style="color:#090;">$forum[posts]</em>
  56.               </div>
  57.              <!--{/if}-->
  58.               </div>
  59.              <div class="f_bkjs">
  60.              <!--{if $forum[description]}-->
  61.                      <p class="xg2">$forum[description]</p>
  62.              <!--{else}-->
  63.              版塊介紹未設置
  64.              <!--{/if}-->

  65.              </div>
  66.        </div>
  67.     </div>
  68.     <!--/******************帖子美化*************************************/-->
  69.     <div class="f_tzmh">
  70.     <!--{if $forum['redirect']}-->
  71.        <a href="$forumurl" class="xi2">{lang url_link}</a>
  72.     <!--{elseif is_array($forum['lastpost'])}-->
  73.     <b style="color:#f30;">New</b>
  74.        <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost" class="xi2">
  75.        <!--{echo cutstr($forum[lastpost][subject], 48)}-->
  76.        </a>
  77.        <!--{else}-->
  78.     <b style="color:#d60; margin-right:5px;">Null</b>暫無主題, <a href="forum.php?mod=post&action=newthread&fid=$forum[fid]">搶先發表</a>!
  79.        <!--{/if}-->
  80.     </div>
  81.     </div>
  82.     <!--/*****************結束***********************************/-->
  83.     </td>[/i]
複製代碼
樓主熱門主題
您需要登入後才可以回帖 登入 | 註冊

本版積分規則

小黑屋|Archiver|微剋多資訊(MicroDuo)

GMT+8, 2024-3-28 20:41

Discuz! X

© 2009-2023 Microduo

快速回覆 返回頂部 返回列表