discuz!X1.5 指定版块发帖时 自动默认最高阅读权限(让您的秘密版块只有vip可见)
2011-07-29 16:17
573 查看
有时候站里一些特殊版块 ,比如我那个站,里面有几个版块需要发帖的时候,想让只有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;" onmouseover="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
</p>
<!--{/if}-->
改成
<!--{if $_G['fid'] == 39 }-->
<p class="mbn">{lang readperm}:</p>
<p class="mbn">
<em class="ftid">
<select name="readperm" id="readperm" class="ps" style="width:90px">
<option value="255">{lang highest_right}</option>
</select>
</em>
<img src="{IMGDIR}/faq.gif" alt="Tip" class="mtn vm" style="margin: 0;" onmouseover="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
</p>
<!--{elseif $_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;" onmouseover="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
</p>
<!--{/if}-->
即可,PS:替换后的第一行代码中39需要更换为目标版块的fid怎么知道fid号?当前版块的地址中比如:http://www.discuz.net/forumdisplay.php?fid=2组后fid=后的那个数字 就是当前版块fid号这样就行了,其中value对应的就是阅读权限,比如255,而{lang highest_right}代表了最高权限四个字,其他大家自己参悟喽
修改文件:/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;" onmouseover="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
</p>
<!--{/if}-->
改成
<!--{if $_G['fid'] == 39 }-->
<p class="mbn">{lang readperm}:</p>
<p class="mbn">
<em class="ftid">
<select name="readperm" id="readperm" class="ps" style="width:90px">
<option value="255">{lang highest_right}</option>
</select>
</em>
<img src="{IMGDIR}/faq.gif" alt="Tip" class="mtn vm" style="margin: 0;" onmouseover="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
</p>
<!--{elseif $_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;" onmouseover="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
</p>
<!--{/if}-->
即可,PS:替换后的第一行代码中39需要更换为目标版块的fid怎么知道fid号?当前版块的地址中比如:http://www.discuz.net/forumdisplay.php?fid=2组后fid=后的那个数字 就是当前版块fid号这样就行了,其中value对应的就是阅读权限,比如255,而{lang highest_right}代表了最高权限四个字,其他大家自己参悟喽
相关文章推荐
- discuz 发布分类信息,能不能设置单版块去掉“发帖子”(默认点发帖后为自定义的默认分类信息模版)
- Discuz!7以上让置顶用户发帖时权限默认为255
- Discuz发帖如何设置默认回帖仅作者可见回帖
- 织梦DedeCMS信息发布员发布文章阅读权限不用审核自动开放亲测试通过!
- samba目录只对指定有权限的用户可见
- 多站点RSS新闻正文抓取,导入discuz论坛,自动发帖的实现(一)
- 安卓自动更新功能实现+安卓调用默认浏览器打开指定URL
- 第一篇、Android Supersu 权限管理定制,隐藏过滤权限,指定APP最高权限
- java public protected 默认 还有private修饰后的可见性,访问权限
- android 学习receiver和发送广播,其中监听其他activity的启动demo;给activity加自定义权限只有指定有权限的app可以监听到
- discuz阅读权限的设置作用
- 多站点RSS新闻正文抓取,导入discuz论坛,自动发帖的实现(二)
- [精华贴纪念]是否 iOS 越狱之后所有的应用程序都自动获得最高系统权限?
- Discuz!教程之论坛设置发帖时默认打开附加选项等功能
- Nginx upstream的5种权重分配方式分享1、轮询(默认) 每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除。 2、weight 指定轮询几率,we
- 右键TXT文件-打开方式-选择默认程序提示 windows无法访问指定设备,路经或文件.您可能没有合适的权限访问这个项目
- discuz论坛首页默认显示单个特定的版块,及自定义论坛首页固定标题
- 第一篇、Android Supersu 权限管理定制,隐藏过滤权限,指定APP最高权限
- discuz论坛首页默认显示单个特定的版块,及自定义论坛首页固定标题
- 【微信:hatybeijing】京女编程老师寻IT牛人建i8lei.com"爱芭蕾"论坛(如:Discuz)和搭建微信的发帖阅读帖子功能