Discuz! X3.* 屏蔽帖中联系方式,仅VIP会员和持有“显示联系方式”勋章的用户可查看
分类 网站技术/村民张先生 发布于 2016-03-18 16:42
2、打开 source/class/discuz/discuz_application.php 文件,
查找:
if($this->var['member']['newprompt']) { $this->var['member']['newprompt_num'] = C::t('common_member_newprompt')->fetch($this->var['member']['uid']); $this->var['member']['newprompt_num'] = unserialize($this->var['member']['newprompt_num']['data']); $this->var['member']['category_num'] = helper_notification::get_categorynum($this->var['member']['newprompt_num']); }
在其下方新增:
$dcgroup = in_array($this->var['member']['groupid'], array(1,2,3,33,29,40,17,41,42,43,44,45)) ? 1 : 0; //全站不受限的用户组 if(!$dcgroup) { $cmffu = C::t('common_member_field_forum')->fetch($this->var['member']['uid']); $cmffum = explode("\t", $cmffu['medals']); foreach($cmffum as $k => $r) { list($cmffumid) = explode("|", $r); if($cmffumid == '15') { //“显示联系方式”勋章编号 $dccard = '1'; } $dccard = $dccard ? $dccard : '0'; } unset($cmffum[$k]); setglobal('dccard', $dccard); }
注意:如果您已按本站 wenzhang-1639.html 所述调整过帖子显示时间,只需将该文所述的替换内容修改为以下代码即可:
$dygroup = in_array($this->var['member']['groupid'], array(1,2,3,33,29,40,43,44,45)) ? 1 : 0; //全站显示年份的用户组 setglobal('dygroup', $dygroup); if(!$dygroup) { $cmffu = C::t('common_member_field_forum')->fetch($this->var['member']['uid']); $cmffum = explode("\t", $cmffu['medals']); foreach($cmffum as $k => $r) { list($cmffumid) = explode("|", $r); if($cmffumid == '13') { $dycard = '2'; } if($cmffumid == '14') { $dycard = '1'; } if($cmffumid == '15') { $dccard = '1'; } $dycard = $dycard ? $dycard : '0'; $dccard = $dccard ? $dccard : '0'; } unset($cmffum[$k]); setglobal('dycard', $dycard); setglobal('dccard', $dccard); }
欢迎谈谈你的看法(无须登录) *正文中请勿包含"http://"否则将被拦截