帖子内容隐藏(GG_thread_hide)V1.0插件BUG修复 BUG反馈

已通过实名认证 勇芳
黑铁
2021-4-23 1100

首先感谢 GG 大神免费分享的插件,我也是下载他做的插件改改自己用,于是发现BUG。

这个插件就一个文件:GG_thread_hide\hook\thread_info_end.php

一:重要BUG

//回复查看
	$is_reply = db_find_one('post',array('uid'=>$uid,'tid'=>$tid));
	if($preg_reply){

 后一排的判断语句错了 应该是

//回复查看
	$is_reply = db_find_one('post',array('uid'=>$uid,'tid'=>$tid));
	if($is_reply){

二:次要BUG(不影响执行逻辑,正常执行,但对于代码洁癖,执行效率有问题,因此调整下代码)

	//登录查看
	$preg_login = preg_match('/\[login\](.*?)\[login\/\]/i',$first['message_fmt']);
	if($preg_login){
		if($user){
			$first['message_fmt'] = preg_replace('/\[login(.*?)\]/i','',$first['message_fmt']);
		}else{
		$html_login = '<p style="padding:3px 5px;margin:10px auto;border:1px dashed #ea413c;">本帖隐藏内容,请您<a href="'.url('user-login').'" target="_blank" style="font-weight:bold;">登录</a>后查看。</p>';
			$first['message_fmt'] = preg_replace('/\[login\](.*?)\[login\/\]/i',$html_login,$first['message_fmt']);
		}
	}
	//回复查看
	$preg_reply = preg_match('/\[reply\](.*?)\[reply\/\]/i',$first['message_fmt']);
	if($preg_reply){
		$html_reply = '<p style="padding:3px 5px;margin:10px auto;border:1px dashed #ea413c;">本帖隐藏内容,请您<a href="'.url('post-create-'.$tid).'" style="font-weight:bold;">回复</a>后查看。</p>';
		if($user){
			$is_reply = db_find_one('post',array('uid'=>$uid,'tid'=>$tid));
			if($is_reply){
				$first['message_fmt'] = preg_replace('/\[reply(.*?)\]/i','',$first['message_fmt']);
			}else{
				$first['message_fmt'] = preg_replace('/\[reply\](.*?)\[reply\/\]/i',$html_reply,$first['message_fmt']);
			}
		}else{
			$first['message_fmt'] = preg_replace('/\[reply\](.*?)\[reply\/\]/i',$html_reply,$first['message_fmt']);
		}
	}


未登录提示:


关闭
他们喜欢这个资源
  • GG分享社资源网
  • w1993825
  • 7g7777
  • river1988
  • baco0801
  • 委员长
  • 88
  • ggxy
  • 奋进
  • ok8888
  • laowu666
  • °街角°
  • 旺迈-郭东东
楼主热门帖子
最新回复 (2)
  • 已通过实名认证 韶年
    黑铁
    2
    正需要,支持xiuno顶尖网了!
    10月前 回复
  • 已通过实名认证 故大壮力
    黑铁
    3
    啥也不说了,感谢xiuno顶尖网的分享!
    9月前 回复
    • Xiuno顶尖网
      4
        登陆 注册
  • 旺迈-郭东东
    4
     点击可以快捷回复 感谢 支持 不错 无奈 一般 生气 回帖 路过 顶帖
    表情
在线客服

特别说明

QQ客服仅提供有偿服务,如无付费意愿,请勿扰!一般问题请站内发帖咨询!
服务项目:
1,xiuno插件模板定制开发
2,xiuno网站BUG修复
3,xiuno个性化定制
4,xiuno仿站等

客服工作时间:8:00~22:00
在线客服