Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 每區獨立設定_主題分類是否用下拉式

[复制链接]
別問我是誰 发表于 2006-1-31 18:12:39 | 显示全部楼层 |阅读模式
══════════════════════════════════════

 若某版區 主題分類設定太多 會超出表格不美觀 ( 看下圖 )

 所以加入這修改 每區可獨立設定 是否使用下拉顯示

══════════════════════════════════════

 修改檔案

 admin/forums.inc.php

 templates/default/admincp.lang.php
 templates/default/forumdisplay.htm ( 其它風格有這份檔亦要修改 )

══════════════════════════════════════

 升級數據庫

  1. ALTER TABLE `cdb_forums` ADD `threadtypeselect` tinyint(1) NOT NULL default '0';
复制代码


══════════════════════════════════════

 admin/forums.inc.php 找

  1.                         showsetting('forums_edit_threadtypes_prefix', 'threadtypesnew[prefix]', $forum['threadtypes']['prefix'], 'radio');
复制代码

 之下加入
  1.                         showsetting('forums_edit_threadtypeselect', 'threadtypeselectnew', $forum['threadtypeselect'], 'radio');
复制代码


 再找
  1. modnewposts='$modnewpostsnew', recyclebin='$recyclebinnew', jammer='$jammernew',
复制代码

 改為
  1. modnewposts='$modnewpostsnew', recyclebin='$recyclebinnew', jammer='$jammernew', threadtypeselect='$threadtypeselectnew',
复制代码


══════════════════════════════════════

 templates/default/admincp.lang.php 找

  1.         'forums_edit_threadtypes_prefix_comment' => '設置是否在主題列表中,給已分類的主題前加上類別的顯示。注意: 本功能必須「啟用主題分類」後才可使用',
复制代码

 之下加入
  1.         'forums_edit_threadtypeselect' => '下拉顯示分類',
  2.         'forums_edit_threadtypeselect_comment' => '本版區是否使用下拉型式,顯示主題分類顯示。',
复制代码


══════════════════════════════════════

 templates/default/forumdisplay.htm ( 其它風格有這份檔亦要修改 ) 找

  1. <!--{if $forum['threadtypes'] && $forum['threadtypes']['listable']}-->
  2.         <br><table cellspacing="0" cellpadding="0" border="0"><tr><td>
  3.         <table cellspacing="{INNERBORDERWIDTH}" cellpadding="2" class="tableborder"><tr class="smalltxt">
  4.         <!--{loop $forum['threadtypes']['types'] $id $name}-->
  5.                 <!--{if $typeid != $id}-->
  6.                         <td class="altbg1"> <a href="forumdisplay.php?fid=$fid&filter=type&typeid=$id">$name</a> </td>
  7.                 <!--{else}-->
  8.                         <td class="header"> <span class="bold">$name</span> </td>
  9.                 <!--{/if}-->
  10.         <!--{/loop}-->
  11.         <!--{if $typeid}--><td class="altbg1"> <a href="forumdisplay.php?fid=$fid">{lang all}</a> </td><!--{else}--><td class="header"> <span class="bold">{lang all}</span> </td><!--{/if}-->
  12.         </tr></table></td></tr><tr><td height="3"></td></tr></table>
  13. <!--{/if}-->
  14. </td></tr></table>
复制代码

 改為
  1. <!--{if $forum['threadtypes'] && $forum['threadtypes']['listable']}-->
  2.         <br><table cellspacing="0" cellpadding="0" border="0"><tr><td>

  3.         <!--{if $forum['threadtypeselect']}-->
  4. <select onchange="window.location=(''+this.options[this.selectedIndex].value)">
  5. <option value="forumdisplay.php?fid=$fid">{lang all} - {lang admin_type}</option>
  6.         <!--{loop $forum['threadtypes']['types'] $id $name}-->
  7.                 <!--{if $typeid != $id}-->
  8. <option value="forumdisplay.php?fid=$fid&filter=type&typeid=$id">$name</option>
  9.                 <!--{else}-->
  10. <option value="" selected>$name</option>
  11.                 <!--{/if}-->
  12.         <!--{/loop}-->
  13. </select>
  14. </td></tr><tr><td height="3"></td></tr></table>

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

  16.         <table cellspacing="{INNERBORDERWIDTH}" cellpadding="2" class="tableborder"><tr class="smalltxt">
  17.         <!--{loop $forum['threadtypes']['types'] $id $name}-->
  18.                 <!--{if $typeid != $id}-->
  19.                         <td class="altbg1"> <a href="forumdisplay.php?fid=$fid&filter=type&typeid=$id">$name</a> </td>
  20.                 <!--{else}-->
  21.                         <td class="header"> <span class="bold">$name</span> </td>
  22.                 <!--{/if}-->
  23.         <!--{/loop}-->
  24.         <!--{if $typeid}--><td class="altbg1"> <a href="forumdisplay.php?fid=$fid">{lang all}</a> </td><!--{else}--><td class="header"> <span class="bold">{lang all}</span> </td><!--{/if}-->
  25.         </tr></table></td></tr><tr><td height="3"></td></tr></table>
  26. <!--{/if}-->

  27. <!--{/if}-->
  28. </td></tr></table>
复制代码


══════════════════════════════════════
            ~ 完 ~
══════════════════════════════════════


[ 本帖最后由 別問我是誰 于 2006-1-31 18:20 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
winter0706 发表于 2006-1-31 18:13:45 | 显示全部楼层
十卜下
回复

使用道具 举报

孤情一刀 发表于 2006-1-31 18:16:10 | 显示全部楼层
顶!
回复

使用道具 举报

hydeist 发表于 2006-1-31 18:28:27 | 显示全部楼层
HACK区已经有这个功能了,不过没楼主的后台开关。
纯支持你了

这功能应该是官方马上要补的……唉
回复

使用道具 举报

17小菜 发表于 2006-1-31 21:12:29 | 显示全部楼层
Thax!
回复

使用道具 举报

wishyou 发表于 2006-1-31 21:20:19 | 显示全部楼层
高位支持
回复

使用道具 举报

tanwill 发表于 2006-1-31 21:33:58 | 显示全部楼层
測試OK!
可以使用
回复

使用道具 举报

手机?守机? 发表于 2006-2-1 23:32:25 | 显示全部楼层
路过支持~
回复

使用道具 举报

freddy 发表于 2006-2-1 23:34:29 | 显示全部楼层
不支持不行啊
回复

使用道具 举报

sospost 发表于 2006-2-2 00:14:28 | 显示全部楼层
顶上去!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-5 17:15 , Processed in 0.118826 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表