n = pagination(url("thread-$tid-{page}$keywordurl", array('user' => $haya_sign_see_user_id)), $thread['posts'] + 1, $page, $pagesize); } if($thread['OK']!='1' && $group['see_check']!='1' && $uid!=$thread['uid']) { if($thread['OK']=='0') message(-1, "本帖正在审核中,您无权查看!"); elseif($thread['OK']=='-1') message(-1, "本帖未审核通过,您无权查看!"); elseif($thread['OK']=='-2') message(-1, "本帖正在回收站中,您无权查看!"); die(); } $spay_url = url('thread-sPay-'.$tid); $mycredits_url = url('my-credits'); if($thread['content_buy_type']=='3') {$thread['content_buy']/=1.0;} if($route=='mip') $html_pay='您好,本帖含有付费内容,请您点击下方“查看完整版网页”获取!'; else $html_pay=''; $preg_pay = preg_match_all('/\[ttPay\](.*?)\[\/ttPay\]/is',$first['message_fmt'],$array); $first['purchased']='1'; $content_pay = db_find_one('paylist', array('tid' => $tid, 'uid' => $uid, 'type' => 1)); $is_set=0; if($thread['content_buy']){ if($preg_pay){ $array_count = count($array[0]); for($i=0;$i<$array_count;$i++){ $a = $array[0][$i]; $b = ''; if($content_pay||$thread['uid']==$uid) $first['message_fmt'] = str_replace($a,$b,$first['message_fmt']); elseif($uid && setting_get('wiki_vip')['no_credits_see']=='1' && vip__isvip($user['vip_end'])==1) $first['message_fmt'] = str_replace($a,$b,$first['message_fmt']); else $first['message_fmt'] = str_replace($a,$is_set==0?$html_pay:'',$first['message_fmt']); $is_set=1;$first['purchased']='0'; } } }else{ $first['message_fmt'] = str_replace('[ttPay]','',$first['message_fmt']); $first['message_fmt'] = str_replace('[/ttPay]','',$first['message_fmt']); } $gid=isset($user['gid'])?$user['gid']:'0'; $my_p=$group['readp']; $target_p=$thread['readp']; $need_refresh=0; $set_vip = setting_get('wiki_vip'); if($uid && $set_vip['up_read']!='0' && vip__isvip($user['vip_end'])) $my_p += $set_vip['up_read']; if(($gid!=1)&& $my_p<$target_p ){ message(-1, jump(lang('dear_p'), http_referer(), 2));die();} $preg_login = preg_match_all('/\[ttlogin\](.*?)\[\/ttlogin\]/i',$first['message_fmt'],$array); if($preg_login) { $array_count = count($array[0]); $html_hide=''; for($i=0;$i<$array_count;$i++){ $a = $array[0][$i]; $b = ''; 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\]/i',$first['message_fmt'],$array); if($preg_reply) { $array_count = count($array[0]); $html_reply =''; 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 = ''; 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']); elseif($uid && $set_vip['no_reply_see']!='0' && vip__isvip($user['vip_end']) && vip_getlevel($uid)>=$set_vip['no_reply_see']) $first['message_fmt'] = str_replace($a,$b,$first['message_fmt']); 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 =''; 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 = ''; if($uid AND $replied)$first['message_fmt'] = str_replace($a,$b,$first['message_fmt']); elseif($uid && $set_vip['no_reply_see']!='0' && vip__isvip($user['vip_end']) && vip_getlevel($uid)>=$set_vip['no_reply_see']) $first['message_fmt'] = str_replace($a,$b,$first['message_fmt']); else {$first['message_fmt'] = str_replace($a,$html_reply,$first['message_fmt']);$need_refresh=1;} } } } if($thread['red_num']>=0){ $first['message_fmt'].='
'; $load_redpacket_js=1; $red_info = db_find_one('thread_red',array('tid'=>$tid)); } if($thread['VIPonly']) { if (empty($user)) { message(-1, jump("您好,请先登录!", url('my-credits'), 5)); die(); } if ($user['gid'] != 1 && !(vip__isvip($user['vip_end']))) { message(-1, jump("您好,本帖为VIP专属帖子,仅限VIP用户查看,请您开通VIP后查看!", url('my-credits'), 5)); die(); } } include _include(APP_PATH.'view/htm/thread.htm'); } ?>