==$tag_cate_fid_all[1]['cateid']) {$tagids_count_2 = $tagids_count_2 + 1;} if ($tag_all[$tagids_count]['cateid']==$tag_cate_fid_all[2]['cateid']) {$tagids_count_3 = $tagids_count_3 + 1;} if ($tag_all[$tagids_count]['cateid']==$tag_cate_fid_all[3]['cateid']) {$tagids_count_4 = $tagids_count_4 + 1;} } } } } $tag_cate_all = tag_cate_find(); $tag_cate_name_1 = $tag_cate_fid_all[0]['name']; $tag_cate_name_2 = $tag_cate_fid_all[1]['name']; $tag_cate_name_3 = $tag_cate_fid_all[2]['name']; $tag_cate_name_4 = $tag_cate_fid_all[3]['name']; if (is_null($tagids_count_1)) {$tagids_count_1 = 0;} if (is_null($tagids_count_2)) {$tagids_count_2 = 0;} if (is_null($tagids_count_3)) {$tagids_count_3 = 0;} if (is_null($tagids_count_4)) {$tagids_count_4 = 0;} if (is_null($tag_cate_name_1)==false) { switch ($zd_tag['tag_choice_1']) { case 1: if ($zd_tag['tag_choice_number_1']<=$tagids_count_1) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_1.lang("tag_choice_tips_b1").$zd_tag['tag_choice_number_1'].lang("tag_choice_tips_c").$tagids_count_1);} break; case 2: if ($zd_tag['tag_choice_number_1']!=$tagids_count_1) {message(-1, lang("tag_choice_tips_a").$tag_cate_name_1.lang("tag_choice_tips_b2").$zd_tag['tag_choice_number_1'].lang("tag_choice_tips_c").$tagids_count_1);} break; case 3: if ($zd_tag['tag_choice_number_1']>=$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)); }$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 A