; $gids = $xn_nosametitle['gids'] ? $xn_nosametitle['gids'] : array(); if(in_array($user['gid'], $gids)){ $_subject = $subject; if($set_days){ $last=time()-$set_days*86400; }else{ $last=0; } $haved_title=db_find('thread', array('subject'=>$_subject, 'last_date'=>array('>'=>$last))); if($haved_title){ message(-1, $fr_tishi); } } // todo: $fid = param('fid'); $tagids = param('tagid', array(0)); $tag_all = tag_find(); $zd_tag = kv_get('zd_tag'); $tag_cate_fid_all = tag_cate_find(array("fid"=>$fid), array("rank"=>-1)); foreach($tagids as $tagids_key => $tagids_value) { if ($tagids_value!=0) { for ($tagids_count=0; $tagids_count=$tagids_count_1) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_1.lang("tag_choice_tips_b3").$zd_tag['tag_choice_number_1'].lang("tag_choice_tips_c").$tagids_count_1);} break; }} if (is_null($tag_cate_name_2)==false) { switch ($zd_tag['tag_choice_2']) { case 1: if ($zd_tag['tag_choice_number_2']<=$tagids_count_2) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_2.lang("tag_choice_tips_b1").$zd_tag['tag_choice_number_2'].lang("tag_choice_tips_c").$tagids_count_2);} break; case 2: if ($zd_tag['tag_choice_number_2']!=$tagids_count_2) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_2.lang("tag_choice_tips_b2").$zd_tag['tag_choice_number_2'].lang("tag_choice_tips_c").$tagids_count_2);} break; case 3: if ($zd_tag['tag_choice_number_2']>=$tagids_count_2) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_2.lang("tag_choice_tips_b3").$zd_tag['tag_choice_number_2'].lang("tag_choice_tips_c").$tagids_count_2);} break; }} if (is_null($tag_cate_name_3)==false) { switch ($zd_tag['tag_choice_3']) { case 1: if ($zd_tag['tag_choice_number_3']<=$tagids_count_3) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_3.lang("tag_choice_tips_b1").$zd_tag['tag_choice_number_3'].lang("tag_choice_tips_c").$tagids_count_3);} break; case 2: if ($zd_tag['tag_choice_number_3']!=$tagids_count_3) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_3.lang("tag_choice_tips_b2").$zd_tag['tag_choice_number_3'].lang("tag_choice_tips_c").$tagids_count_3);} break; case 3: if ($zd_tag['tag_choice_number_3']>=$tagids_count_3) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_3.lang("tag_choice_tips_b3").$zd_tag['tag_choice_number_3'].lang("tag_choice_tips_c").$tagids_count_3);} break; }} if (is_null($tag_cate_name_4)==false) { switch ($zd_tag['tag_choice_4']) { case 1: if ($zd_tag['tag_choice_number_4']<=$tagids_count_4) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_4.lang("tag_choice_tips_b1").$zd_tag['tag_choice_number_4'].lang("tag_choice_tips_c").$tagids_count_4);} break; case 2: if ($zd_tag['tag_choice_number_4']!=$tagids_count_4) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_4.lang("tag_choice_tips_b2").$zd_tag['tag_choice_number_4'].lang("tag_choice_tips_c").$tagids_count_4);} break; case 3: if ($zd_tag['tag_choice_number_4']>=$tagids_count_4) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_4.lang("tag_choice_tips_b3").$zd_tag['tag_choice_number_4'].lang("tag_choice_tips_c").$tagids_count_4);} break; }} $tagcatemap = $forum['tagcatemap']; foreach($forum['tagcatemap'] as $cate) { $defaulttagid = $cate['defaulttagid']; $isforce = $cate['isforce']; $catetags = array_keys($cate['tagmap']); $intersect = array_intersect($catetags, $tagids); // 比较数组交集 // 判断是否强制 if($isforce) { if ($gid != 1) { if(empty($intersect)) { message(-1, '请选择'.$cate['name']); } } } } $tid = thread_create($thread, $pid); $pid === FALSE AND message(-1, lang('create_post_failed')); $tid === FALSE AND message(-1, lang('create_thread_failed')); $set_check = setting_get('tt_check'); if($set_check['check_threads'] < $user['threads']){ thread_update($tid, array('OK'=>1)); } if ($offer_status&& $offer_num>0){ db_update('user',array('uid'=>$uid),array(get_credits_name_by_type($set_offer['credits_type']).'-'=>$offer_num)); db_insert('user_pay',array('uid'=>$uid,'status'=>1,'num'=>$offer_num,'type'=>16,'credit_type'=>$set_offer['credits_type'],'time'=>time(),'code'=>'')); db_update('thread', array('tid' => $tid), array('offerNum' =>$offer_num,'offerStatus'=>0)); } $forum_structure_r = $forumlist[$fid]['structure']; $forum_structure= explode('|',$forum_structure_r); $forum_structure_count = count($forum_structure); $update_array = array(); $update_array['tid']= $tid; for($i=0;$i<$forum_structure_count;$i++) $update_array['c'.($i+1)] = param('ini_'.($i+1),'-'); db_insert('thread_structure',$update_array); // todo: /* $tag_cate_id_arr = param('tag_cate_id', array(0)); foreach($tag_cate_id_arr as $tag_cate_id => $tagid) { tag_thread_create($tagid, $tid); } */ $tagids = param('tagid', array(0)); $tagcatemap = $forum['tagcatemap']; foreach($forum['tagcatemap'] as $cate) { $defaulttagid = $cate['defaulttagid']; $isforce = $cate['isforce']; $catetags = array_keys($cate['tagmap']); $intersect = array_intersect($catetags, $tagids); // 比较数组交集 // 判断是否强制 if($isforce) { if(empty($intersect)) { message(-1, '请选择'.$cate['name']); } } // 判断是否默认 if($defaulttagid) { if(empty($intersect)) { array_push($tagids, $defaulttagid); } } } foreach($tagids as $tagid) { $tagid AND tag_thread_create($tagid, $tid); } if($group['allowsell']=="1") { $content_num_status = param('content_num_status'); $content_num = param('content_num');//下面添加 if($content_num < 0 ){//判断购买主题货币值小于零 $content_num = 1;//小于零强制写为一 } $content_type = credits_get_content_type_by_name(param('content_type')); if ($content_num_status && $content_num) db_update('thread', array('tid' => $tid), array('content_buy' => $content_num, 'content_buy_type' => $content_type)); } $update_array = array(); if((($add_credit==1)||($add_credit==0&& $credits<0))&&$credits!=0) $update_array['credits+']=$credits; if((($add_credit==1)||($add_credit==0&& $golds<0))&&$golds!=0) $update_array['golds+']=$golds; if((($add_credit==1)||($add_credit==0&& $rmbs<0))&&$rmbs!=0) $update_array['rmbs+']=$rmbs; $uid AND $update_array AND user_update($uid, $update_array); $uid AND $update_array AND $user['gid']>=100 AND user_update_group($uid); $message = ''; isset($update_array['credits+']) AND $message .= lang('credits1').$credits_op.$credits.' ' ; isset($update_array['golds+']) AND $message .= lang('credits2').$golds_op.$golds.' ' ; isset($update_array['rmbs+']) AND $message .= lang('credits3').$rmbs_op.$rmbs ; message(0, lang('create_thread_sucessfully').' '.$message); message(0, lang('create_thread_sucessfully')); } // 帖子详情 | post detail } else { // thread-{tid}-{page}-{keyword}.htm $tid = param(1, 0); $page = param(2, 1); $keyword = param(3); $pagesize = $conf['postlist_pagesize']; //$pagesize = 10; //$page == 1 AND $pagesize++; $xn_guestxzh = kv_get('xiuno_top_guestxzh'); $xn_tishi = $xn_guestxzh['xn_tishi']; $xn_counttime = $xn_guestxzh['xn_counttime']; $xn_limitnum = $xn_guestxzh['xn_limitnum']; $forumlists = $xn_guestxzh['forumlists'] ? $xn_guestxzh['forumlists'] : array(); $is_robot=is_robot(); $is_robot?$is_robot=$is_robot:$is_robot=0; $thread = thread_read($tid); $fid = $thread['fid']; if(empty($uid) && !is_robot()){ if(!in_array($fid, $forumlists)){ $cx_guestnum=$_COOKIE["cx_guestnum"]; $cx_guestnum = $cx_guestnum ? $cx_guestnum : 0; if($cx_guestnum<$xn_limitnum){ $cx_guestnum=$cx_guestnum+1; $del_time=$time+$xn_counttime; setcookie('cx_guestnum',$cx_guestnum,$del_time,''); }else{ $xn_tishi = str_replace(array('{limitnum}'), array($xn_limitnum),$xn_tishi); message(-1,$xn_tishi); } } } if(!empty(user) && !empty($user['digests_ban']) && $user['digests_ban'] == '1'){ message(-1,'您已被禁止');die; } $thread = thread_read($tid); empty($thread) AND message(-1, lang('thread_not_exists')); $fid = $thread['fid']; $forum = forum_read($fid); empty($forum) AND message(3, lang('forum_not_exists')); $postlist = post_find_by_tid($tid, $page, $pagesize); empty($postlist) AND message(4, lang('post_not_exists')); //* @author 西部站长论坛 https://www.westping.com $goback = '

返回前一页'; if ($thread['glimit'] > 100 && (($gid < $thread['glimit'] && $gid > 5) || $gid < 1) && $uid != $thread['uid']) { $u = !$uid ? '您的等级为「游客」,请 登录 后再行查看。':'您的等级为「'.$user['groupname'].'」,请赚取积分升级您的用户组。'; message(-1, '

楼主设置本贴仅「'.$grouplist[$thread['glimit']]['name'].'」及以上等级可见,
'.$u.$goback); } if ($thread['glimit'] == 1 && ($gid < 1 || $gid > 5) && $uid != $thread['uid']) { $u = !$uid ? '您的等级为「游客」,请 登录 后再行查看。':'您的等级为「'.$user['groupname'].'」,所以无法查看本贴。'; message(-1, '

楼主设置本贴仅「管理组成员」可见,
'.$u.$goback); } if ($thread['climit'] > 0 && (!$uid || $uid != $thread['uid'] && $user['credits'] < $thread['climit'] && ($gid > 5 || $gid < 1))) { $u = !$uid ? '请 登录 并赚取足够积分后再行查看。':'您现有积分「'.$user['credits'].'分」,请努力赚取积分。'; message(-1, '

楼主设置本贴仅积分大于「'.$thread['climit'].'分」的会员可见,
'.$u.$goback); } if($page == 1) { empty($postlist[$thread['firstpid']]) AND message(-1, lang('data_malformation')); $first = $postlist[$thread['firstpid']]; unset($postlist[$thread['firstpid']]); $attachlist = $imagelist = $filelist = array(); // 如果是大站,可以用单独的点击服务,减少 db 压力 // if request is huge, separate it from mysql server thread_inc_views($tid); } else { $first = post_read($thread['firstpid']); } $keywordurl = ''; if($keyword) { $thread['subject'] = post_highlight_keyword($thread['subject'], $keyword); //$first['message'] = post_highlight_keyword($first['subject']); $keywordurl = "-$keyword"; } $allowpost = forum_access_user($fid, $gid, 'allowpost') ? 1 : 0; $allowupdate = forum_access_mod($fid, $gid, 'allowupdate') ? 1 : 0; $allowdelete = forum_access_mod($fid, $gid, 'allowdelete') ? 1 : 0; forum_access_user($fid, $gid, 'allowread') OR message(-1, lang('user_group_insufficient_privilege')); $pagination = pagination(url("thread-$tid-{page}$keywordurl"), $thread['posts'] + 1, $page, $pagesize); $header['title'] = $thread['subject'].'-'.$forum['name'].'-'.$conf['sitename']; //$header['mobile_title'] = lang('thread_detail'); $header['mobile_title'] = $forum['name'];; $header['mobile_link'] = url("forum-$fid"); $header['keywords'] = ''; $header['description'] = $thread['subject']; $_SESSION['fid'] = $fid; $haya_post_info_param = array(); if (isset($haya_post_info_config['show_post_sort']) && $haya_post_info_config['show_post_sort'] == 1 ) { $haya_post_info_post_default_sort = isset($haya_post_info_config['post_default_sort']) ? trim($haya_post_info_config['post_default_sort']) : ''; $haya_post_info_orderby = param('sort', $haya_post_info_post_default_sort); if (!empty($haya_post_info_orderby)) { $haya_post_info_param = array_merge($haya_post_info_param, array('sort' => trim($haya_post_info_orderby))); } } if ((isset($haya_post_info_config['show_see_him']) && $haya_post_info_config['show_see_him'] == 1) || (isset($haya_post_info_config['show_see_first_floor']) && $haya_post_info_config['show_see_first_floor'] == 1) ) { $haya_post_info_see_user = param('user', ''); if (!empty($haya_post_info_see_user)) { $haya_post_info_see_user_id = intval($haya_post_info_see_user); $thread['posts'] = post_count(array( 'tid' => $thread['tid'], 'isfirst' => 0, 'uid' => $haya_post_info_see_user_id, )); $haya_post_info_param = array_merge($haya_post_info_param, array('user' => $haya_post_info_see_user_id)); } } if (!empty($haya_post_info_param)) { $pagination = pagination(url("thread-$tid-{page}$keywordurl", $haya_post_info_param), $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); if($thread['content_buy_type']=='3') {$thread['content_buy']/=100.0;} if($route=='mip') $html_pay='您好,本帖含有付费内容,请您点击下方“查看完整版网页”获取!'; else $html_pay='

'; $preg_pay = preg_match_all('/\[ttPay\](.*?)\[\/ttPay\]/i',$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']); 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']); } include _include(APP_PATH.'view/htm/thread.htm'); } ?>