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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 帮忙写个判断,列表页隐藏多个个版块的发帖按钮。

[复制链接]
syym 发表于 2014-9-17 18:02:25 | 显示全部楼层 |阅读模式
  1. <!--{if $_G[fid] !=('44','45')}--> <!--隐藏发帖 -->
  2.                                 <div id="pgt" class="bm bw0 pgs cl">
  3.                                         <span id="fd_page_top">$multipage</span>
  4.                                         <span class="pgb y" {if $_G[setting][visitedforums]}id="visitedforums" onmouseover="$('visitedforums').id = 'visitedforumstmp';this.id = 'visitedforums';showMenu({'ctrlid':this.id,'pos':'34'})"{/if} ><a href="forum.php">{lang return_index}</a></span>
  5.                                         <!--{if !$_GET['archiveid']}--><a href="javascript:;" id="newspecial" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})"{if !$_G['forum']['allowspecialonly'] && empty($_G['forum']['picstyle']) && !$_G['forum']['threadsorts']['required']} onclick="showWindow('newthread', 'forum.php?mod=post&action=newthread&fid=$_G[fid]')"{else} onclick="location.href='forum.php?mod=post&action=newthread&fid=$_G[fid]';return false;"{/if} title="{lang send_posts}"><img src="{IMGDIR}/pn_post.png" alt="{lang send_posts}" /></a><!--{/if}-->
  6.                                         <!--{hook/forumdisplay_postbutton_top}-->
  7.                                 </div>
  8.                                 <!--{/if}--><!--隐藏发帖 -->
复制代码
设置多个板块隐藏发帖按钮,这个方法是来自这个帖子https://discuz.dismall.com/thread-2360273-2-1.html,但是没有解决。帮我看看那里出问题了,最好能判断对管理员不隐藏,对其他用户隐藏。


达梦网 发表于 2014-9-17 19:38:25 | 显示全部楼层
<!--{if $_G[fid] !=('44','45')}--> 指的就是不是fid为44,45的都显示发帖按钮!
回复

使用道具 举报

格东站长网 发表于 2014-9-17 19:43:12 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| syym 发表于 2014-9-17 20:10:18 | 显示全部楼层
格东站长网 发表于 2014-9-17 19:43
$_G[fid]这个变量名似乎不对,列表页的变量名应该是$_G['forum']['fid']
你的要求不明确,不知道你到底要 ...

我的意思是id44和45的版块不显示发帖按钮,但是管理员登陆可以显示。
回复

使用道具 举报

格东站长网 发表于 2014-9-17 20:18:17 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| syym 发表于 2014-9-17 20:20:44 | 显示全部楼层
格东站长网 发表于 2014-9-17 20:18
这很容易
你不需要判断版块,只需要在后台设置44和45的版块禁止会员发帖,再在模板上加个允许的代码就可 ...

好的!非常感谢,我试一下。
回复

使用道具 举报

格东站长网 发表于 2014-9-17 20:21:55 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| syym 发表于 2014-9-17 20:56:05 | 显示全部楼层
格东站长网 发表于 2014-9-17 20:21
肯定行的,因为这是我自己在用的代码

后台已经现在游客和一些用户组不能发帖回帖了,代码也加了,还是显示。难道我代码加的不对吗。
<!--{if !$_G['forum_thread']['is_archived'] && $_G['group']['allowpost']}--><!--隐藏发帖 -->
                                <div id="pgt" class="bm bw0 pgs cl">
                                        <span id="fd_page_top">$multipage</span>
                                        <span class="pgb y" {if $_G[setting][visitedforums]}id="visitedforums"{/if} ><a href="forum.php">{lang return_index}</a></span>
                                        <!--{if !$_GET['archiveid']}--><a href="javascript:;" id="newspecial"{if !$_G['forum']['allowspecialonly'] && empty($_G['forum']['picstyle']) && !$_G['forum']['threadsorts']['required']}{else}{/if} title="{lang send_posts}"><img src="{IMGDIR}/pn_post.png" alt="{lang send_posts}" /></a><!--{/if}-->
                                        <!--{hook/forumdisplay_postbutton_top}-->
                                </div>
                                <!--{/if}--><!--隐藏发帖 -->

链接地址:http://bbs.syym.net/forum-44-1.html和http://bbs.syym.net/forum-45-1.html
回复

使用道具 举报

格东站长网 发表于 2014-9-17 20:58:31 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| syym 发表于 2014-9-17 23:07:32 | 显示全部楼层
格东站长网 发表于 2014-9-17 20:58
加得不对,应该是把默认的这句换成这样,不要重复加代码

太给力了,上下按钮都可以用,谢谢!终于解决哦。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-28 09:30 , Processed in 0.127742 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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