<!--{if ($_G['forum']['threadtypes'] &amp;&amp; $_G'forum'['listable']) || count($_G'forum'['types'])> 0}-->
<p style="text-align: left;">
  <ul id="thread_types" class="ttp bm cl">
    <!--{hook/forumdisplay_threadtype_inner}-->
    <li id="ttp_all" {if !$_GET[ 'typeid'] &amp;&amp; !$_GET[ 'sortid']}class="xw1 a" {/if}>
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]{if $_G'forum'['defaultshow']}&filter=sortall&sortall=1{/if}{if $_GET['archiveid']}&amp;archiveid={$_GET['archiveid']}{/if}">{lang forum_viewall}</a></li>
    <!--{if $_G'forum'}-->
    <!--{loop $_G['forum']['threadtypes']['types'] $id $name}-->
    <!--{if $_GET['typeid']==$ id}-->
    <li class="xw1 a">
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]{if $_GET['sortid']}&filter=sortid&sortid=$_GET['sortid']{/if}{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" &gt;&lt;!--{if $_Gforumicons 'threadtypes'==2 }-->
        <img class="vm" src="$_G[forum][threadtypes][icons][$id]" alt="">
        <!--{/if}-->$name&lt;!--{if $showthreadclasscounttypeid[$id]</span>
        <!--{/if}--></a>
    </li>
    <!--{else}-->
    <li>
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&amp;filter=typeid&amp;typeid=$id$forumdisplayadd[typeid]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" &gt;&lt;!--{if $_Gforumicons 'threadtypes'==2 }-->
        <img class="vm" src="$_G[forum][threadtypes][icons][$id]" alt="">
        <!--{/if}-->$name&lt;!--{if $showthreadclasscounttypeid[$id]</span>
        <!--{/if}--></a>
    </li>
    <!--{/if}-->
    <!--{/loop}-->
    <!--{/if}-->
    <!--{if $_G'forum'}-->
    <!--{if $_G'forum'}-->
    <li>
      <span class="pipe">|</span></li>
    <!--{/if}-->
    <!--{loop $_G['forum']['threadsorts']['types'] $id $name}-->
    <!--{if $_GET['sortid']==$ id}-->
    <li class="xw1 a">
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]{if $_GET['typeid']}&filter=typeid&typeid=$_GET['typeid']{/if}{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" &gt;$name<!--{if $showthreadclasscount[sortid][$id]}-->
        <span class="xg1 num">$showthreadclasscount[sortid][$id]</span>
        <!--{/if}--></a>
    </li>
    <!--{else}-->
    <li>
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&amp;filter=sortid&amp;sortid=$id$forumdisplayadd[sortid]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" &gt;$name<!--{if $showthreadclasscount[sortid][$id]}-->
        <span class="xg1 num">$showthreadclasscount[sortid][$id]</span>
        <!--{/if}--></a>
    </li>
    <!--{/if}-->
    <!--{/loop}-->
    <!--{/if}-->
    <!--{hook/forumdisplay_filter_extra}--></ul>
  <script type="text/javascript">showTypes('thread_types');</script>
  <!--{/if}-->

首先这个是原主题分类的代码,我们需要做些修改:

<p style="text-align: left;">
  <div class="mod_mopart">
    <div class="hd">
      <span>分类</span></div>
    <div class="bd">//开始循环主题分类
      <!--{if $_G'forum'}-->
      <!--{loop $_G['forum']['threadtypes']['types'] $id $name}-->
      <ul class="clearfix">
        <li>//调出主题分类链接和图标(图标去后台设置)
          <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&amp;filter=typeid&amp;typeid=$id$forumdisplayadd[typeid]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}">
            <!--{if $_G[forum][threadtypes][icons][$id]}-->
            <img src="$_G[forum][threadtypes][icons][$id]" width="60" height="60" alt="">
            <!--{else}-->
            <img src="static/image/common/forum.gif" width="60" height="60" alt="">
            <!--{/if}-->//这里染念加if,如果没有图标,则显示默认版块图标,是不是逼格提升了?
            <span class="title">$name</span>//调用名称</p>
<p style="text-align: left;">
  <span class="num">//调用在该主题分类发的帖子,这里染念加了if选择结构,不然没有出现0,而是白白的&nbsp;
    <span>话题:
      <!--{if $showthreadclasscount[typeid][$id]}-->$showthreadclasscount[typeid][$id]
      <!--{else}-->0
      <!--{/if}--></span></span>
  </a>
  </li>
  </ul>
  <!--{/loop}-->
  <!--{/if}--></div>
  </div>
</p>> 注明://注释..在这里不规范,要不是我要看到编码器的效果

.mod_mopart {
padding: 10px 0;
margin: 0 15px;
border-top: 1px dotted #d9d9d9;
}
.mod_mopart .hd {
margin-bottom: 10px;
}
.mod_mopart .hd span {
font-weight: 700;
font-size: 14px;
}
.mod_mopart .bd {
width: 950px;
overflow: hidden;
}
.mod_mopart ul {
margin: 0 -10px -10px 0;
}
.mod_mopart li {
float: left;
_display: inline;
margin: 0 10px 10px 0;
}
.mod_mopart a {
display: block;
width: 215px;
padding: 10px 10px 10px 80px;
overflow: hidden;
cursor: pointer;
}
.mod_mopart img {
float: left;
_display: inline;
width: 60px;
height: 60px;
margin-left: -70px;
overflow: hidden;
cursor: pointer;
}
.mod_mopart .title, .mod_mopart .intro {
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.mod_mopart .title {
display: block;
font-weight: 700;
color: #333;
cursor: pointer;
}
.mod_mopart .num {
width: 100%;
white-space: nowrap;
overflow: hidden;
}
.mod_mopart .num span {
display: inline-block;
margin-right: 5px;
}
.mod_mopart a:hover, .mod_mopart a.active {
background: #f7f7f7;
text-decoration: none;
}
.title{
padding:0!important;
}

然后送大家css,你用代码插入到forumdisplay.htm适当的位置,css再加下。最后把<ul id="thread_types" class="ttp bm cl" style="display: none;">加个display隐藏。

版权属于:染念
本文链接: https://dyedd.cn/51.html
作品采用:本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
更新于: 2020年08月20日 15:39
0
  1.     Windows 10 /    Google Chrome

    mmp,这高亮不行。

  2.     Windows 7 /    FireFox

    拜访博主,感谢分享

  3.     Windows 10 /    Google Chrome

    哎哎



179 文章数
668 评论量
4 分类数
183 页面数
已在风雨中度过 7年46天5小时27分
目录
来自 《把dz的主题分类伪装成子版块》
© 2024 染念Blog
浙ICP备19020194号-1
暗黑模式
暗黑模式
评论
返回顶部
© 2024 染念Blog
浙ICP备19020194号-1
暗黑模式
暗黑模式
评论
返回顶部