discuz!X1.5 指定版块发帖时 自动默认最高阅读权限(让您的秘密版块只有vip可见)

 有时候站里一些特殊版块 ,比如我那个站,里面有几个版块需要发帖的时候,想让只有vip才能看到,或者只有楼主和管理员可见,而其他人只能看到列表而看不到内容,这就用到一下代码了

修改文件:/template/default/forum/post.htm
记事本打开这个文件 找到

 

  • <!--{if $_G['group']['allowsetreadperm']}-->
  • <p class="mbn">{lang readperm}:</p>
  • <p class="mbn">
  • <em class="ftid">
  • <select name="readperm" id="readperm" class="ps" style="width:90px">
  • <option value="">{lang unlimited}</option>
  • <!--{loop $_G['cache']['groupreadaccess'] $val}-->
  • <option value="$val[readaccess]" title="{lang readperm}: $val[readaccess]"{if $thread['readperm'] == $val[readaccess]} selected="selected"{/if}>$val[grouptitle]</option>
  • <!--{/loop}-->
  • <option value="255">{lang highest_right}</option>
  • </select>
  • </em>
  • <img src="{IMGDIR}/faq.gif" alt="Tip" class="mtn vm" style="margin: 0;" οnmοuseοver="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
  • </p>
  • <!--{/if}-->

    改成

  •  

    1. <!--{if $_G['fid'] == 39 }-->
    2. <p class="mbn">{lang readperm}:</p>
    3. <p class="mbn">
    4. <em class="ftid">
    5. <select name="readperm" id="readperm" class="ps" style="width:90px">
    6. <option value="255">{lang highest_right}</option>
    7. </select>
    8. </em>
    9. <img src="{IMGDIR}/faq.gif" alt="Tip" class="mtn vm" style="margin: 0;" οnmοuseοver="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
    10. </p>
    11. <!--{elseif $_G['group']['allowsetreadperm']}-->
    12. <p class="mbn">{lang readperm}:</p>
    13. <p class="mbn">
    14. <em class="ftid">
    15. <select name="readperm" id="readperm" class="ps" style="width:90px">
    16. <option value="">{lang unlimited}</option>
    17. <!--{loop $_G['cache']['groupreadaccess'] $val}-->
    18. <option value="$val[readaccess]" title="{lang readperm}: $val[readaccess]"{if $thread['readperm'] == $val[readaccess]} selected="selected"{/if}>$val[grouptitle]</option>
    19. <!--{/loop}-->
    20. <option value="255">{lang highest_right}</option>
    21. </select>
    22. </em>
    23. <img src="{IMGDIR}/faq.gif" alt="Tip" class="mtn vm" style="margin: 0;" οnmοuseοver="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
    24. </p>
    25. <!--{/if}-->

     

     

  • 即可,PS:替换后的第一行代码中39需要更换为目标版块的fid怎么知道fid号?当前版块的地址中比如:http://www.discuz.net/forumdisplay.php?fid=2组后fid=后的那个数字 就是当前版块fid号这样就行了,其中value对应的就是阅读权限,比如255,而{lang highest_right}代表了最高权限四个字,其他大家自己参悟喽

     

     
     
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值