EMLOG扩展 | EMLOG大前端 回复可见问题

2021-05-08 0 886

emlog 大前端回复可见

必须先注册 在 评论才能看到

我不想那么麻烦,那么多的无用用户,自己动手丰衣足食

我测试了测试,可以用~~

原版代码

<?php
/*
 * 文章回复可见
 *
 */
 function reply_view($content,$logid){
 if(!strstr($content,"hide")){
 return $content;
 }
 if(ROLE == ROLE_ADMIN){
 $content = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox">\1</div>', $content);
 return $content;
 }
   if(ROLE != ROLE_VISITOR){
   //是会员的时候回复可见
   global $userData;
   $user_mail = $userData['email'];
   //$logid = $logData['logid'];
   $DB = MySql::getInstance();
   $sql = 	"SELECT * FROM ".DB_PREFIX."comment WHERE gid='$logid' and mail='$user_mail'";
   $res = $DB->query($sql);
   $num = $DB->num_rows($res);
   if($num>0){
   //已经回复过了
   $share_view = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox">\1</div>', $content);
   }else{
   //未回复
   $share_view = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox">此处内容已隐藏,注册会员<a href="#comment-post" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" >评论</a>即可查看</div>', $content);
   }
   
   return $share_view;
   }else{
   //是游客的时候回复可见
   $share_view = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox">此处内容已隐藏,注册会员<a href="#comment-post" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" >评论</a>即可查看</div>', $content);
   return $share_view;
   }
 }
?>

修改后代码

<?php
/*
 * 文章回复可见
 *
 */
 function reply_view($content,$logid){
 if(!strstr($content,"hide")){
 return $content;
 }
 if(ROLE == ROLE_ADMIN){
 $content = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox">\1</div>', $content);
 return $content;
 }
 if(ROLE != ROLE_VISITOR){
   //是会员的时候回复可见
   global $userData;
   $user_mail = $userData['email'];
   //$logid = $logData['logid'];
   $DB = MySql::getInstance();
   $sql = 	"SELECT * FROM ".DB_PREFIX."comment WHERE gid='$logid' and mail='$user_mail'";
   $res = $DB->query($sql);
   $num = $DB->num_rows($res);
   if($num>0){
   //已经回复过了
   $share_view = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox">\1</div>', $content);
   }else{
   //未回复
   $share_view = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox">此处内容已隐藏,赶紧<a href="#comment-post" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" >评论</a>即可查看</div>', $content);
   }
   
   return $share_view;
 }else{
   	if($_COOKIE["postermail"]){
 $share_view = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox" id="ae">\1</div>', $content);
 }else{
 $share_view = preg_replace("/\[hide\](.*)\[\/hide\]/Uims", '<div class="hideConBox">此处内容已隐藏,立即<a href="#comment-post" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" >评论</a>即可查看</div>', $content);
 }
   return $share_view;
 }
 }
?>

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

捷丰下载 技术教程 EMLOG扩展 | EMLOG大前端 回复可见问题 https://www.nwgamer.com/277.html

常见问题

相关文章

官方客服团队

为您解决烦忧 - 24小时在线 专业服务