原帖地址:http://bbs.cswl.top/thread-197.htm
遇到的问题:只能隐藏文字和链接,遇到图片,则标签直接失效,展示明文
修复方法:
打开 /tt_read/hook/thread_info_end.php
核心修复点:正则代码 /i 改为 /is
其他部分无需任何修改
不懂代码一键替换,直接替换原有代码如下即可修复:
<?php exit;
$gid=isset($user ['gid'])?$user ['gid']:'0'; $my_p=$group ['readp']; $target_p=$thread ['readp']; $need_refresh=0;
// hook read_p_check_start.php
if(($gid!=1)&& $my_p<$target_p ){ message(-1, jump(lang('dear_p'), http_referer(), 2));die();}
$preg_login = preg_match_all('/\ [ttlogin\](.*?)\ [\/ttlogin\]/is', $first ['message_fmt'], $array);
if($preg_login) {
$array_count = count($array [0]);
$html_hide='<div class="alert alert-warning" role="alert">'.lang('dear_guest2').'<a href ="/user-login.htm"><i class="icon-user"></i> '.lang('login').'</a> '.lang('or_').' <a href ="/user-create.htm"><i class="icon-flask"></i> '.lang('register').'</a></div>';
for($i=0;$i<$array_count;$i++){
$a = $array [0] [$i];
$b = '<div class="alert alert-success" role="alert">'.$array [1] [$i].'</div>';
if($uid)$first ['message_fmt'] = str_replace($a,$b,$first ['message_fmt']);
else $first ['message_fmt'] = str_replace($a,$html_hide,$first ['message_fmt']);
}
}
$preg_reply = preg_match_all('/\ [ttreply\](.*?)\ [\/ttreply\]/is', $first ['message_fmt'], $array);
if($preg_reply) {
$array_count = count($array [0]);
$html_reply ='<div class="alert alert-warning" role="alert">'.lang('dear_reply').'</div>';
if($uid) $replied=db_find_one('post',array('uid'=>$uid,'tid'=>$thread ['tid'])); else $replied=array();
for($i=0;$i<$array_count;$i++){
$a = $array [0] [$i];
$b = '<div class="alert alert-success" role="alert">'.$array [1] [$i].'</div>';
if($uid AND $replied)$first ['message_fmt'] = str_replace($a,$b,$first ['message_fmt']);
if($uid AND isset($gid) AND $gid==1)$first ['message_fmt'] = str_replace($a,$b,$first ['message_fmt']);
// hook read_p_reply_verify_end.php
else {$first ['message_fmt'] = str_replace($a,$html_reply,$first ['message_fmt']);$need_refresh=1;}
}
}
$set = setting_get('tt_read');
if($set&& $set ['old']==1) {
$preg_reply2 = preg_match_all('/\ [reply\](.*?)\ [\/reply\]/i',$first ['message_fmt'],$array2);
if($preg_reply2) {
$array2_count = count($array2 [0]);
$html_reply ='<div class="alert alert-warning" role="alert">'.lang('dear_reply').'</div>';
if($uid) $replied=db_find_one('post',array('uid'=>$uid,'tid'=>$thread ['tid'])); else $replied=array();
for($i=0;$i<$array2_count;$i++){
$a = $array2 [0] [$i];
$b = '<div class="alert alert-success" role="alert">'.$array2 [1] [$i].'</div>';
if($uid AND $replied)$first ['message_fmt'] = str_replace($a,$b,$first ['message_fmt']);
// hook read_p_reply_verify_end.php
else {$first ['message_fmt'] = str_replace($a,$html_reply,$first ['message_fmt']);$need_refresh=1;}
}
}
}
?>
下载声明
每次下载将扣除 1 个经验,经验可通过 /发布主题/签到/回帖/获得!
拥有经验 : 点|排行
拥有金币 : 枚|兑换
拥有现金 : 0|充值
关闭
帖子版权申明
1、本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请反馈给:
【站长】进行删除处理!
2、 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
3、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向
【站长】举报!
4、 本站资源大多存储在
云盘,如发现链接失效可以点
这里进行反馈我们会第一时间更新。