bbsSeoSettings('read', '', $foruminfo['name'], $foruminfo['topictype'][$read['type']], $read['subject'], $read['tags'], $_summary); /*SEO*/ require_once R_P . 'require/showimg.php'; Update_ol(); $readdb = $authorids = array(); //主题印戳 if ($forumset['overprint']) { $overPrintService = L::loadclass("overprint", 'forum'); $overprint = $overPrintService->getOverPrintIcon($read['overprint']); } if ($forumset['viewpic'] && !$winduid) { $viewpic = 1; } if ($read['modelid'] || $foruminfo['modelid']) { L::loadClass('posttopic', 'forum', false); $postTopic = new postTopic($read); } if ($read['special'] > 20 || $foruminfo['pcid']) { L::loadClass('postcate', 'forum', false); $postCate = new postCate($read); } if ($read['special'] == 8 || $foruminfo['actmids']) { L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); } //分类信息主题帖 if ($read['modelid']) { $modelid = $read['modelid']; $topicvalue = $postTopic->getTopicvalue($read['modelid']); $initSearchHtml = $postTopic->initSearchHtml($read['modelid']); foreach ($postTopic->topicmodeldb as $key => $value) {
$type = $atcdb['type']; $special = $atcdb['special']; $modelid = $atcdb['modelid']; $pcid = $atcdb['special'] > 20 ? $atcdb['special'] - 20 : 0; $isCheck_hiddenPost = $atcdb['shares'] ? "checked" : ""; $isCheck_anonymous = $atcdb['anonymous'] ? "checked" : ""; } else { $special = $modelid = $pcid = 0; } if ($pcid > 0 || $modelid > 0) { $db_forcetype = 0; } if ($modelid) { //分类主题 require_once R_P . 'lib/posttopic.class.php'; $postTopic = new postTopic($pwpost); if ($postTopic) { $postTopic->postCheck(); } $topichtml = $postTopic->getTopicHtml($modelid); } if ($pcid > 0) { //团购活动 require_once R_P . 'lib/postcate.class.php'; $postCate = new postCate($pwpost); if ($postCate) { $postCate->postCheck(); } $topichtml = $postCate->getCateHtml($pcid); } $page = floor($article / $db_readperpage) + 1;
list($rt['name1'], $rt['name2']) = explode('{#}', $rt['name']); $fielddb[$rt['fieldid']] = $rt; } } include PrintEot('topiccate'); exit; } elseif ($step == '2') { S::gp(array('ifable', 'vieworder', 'ifsearch', 'ifasearch', 'threadshow', 'ifmust', 'textsize')); foreach ($vieworder as $key => $value) { $db->update("UPDATE pw_topicfield SET " . S::sqlSingle(array('ifable' => $ifable[$key], 'vieworder' => $value, 'ifsearch' => $ifsearch[$key], 'ifasearch' => $ifasearch[$key], 'threadshow' => $threadshow[$key], 'ifmust' => $ifmust[$key], 'textsize' => $textsize[$key])) . " WHERE fieldid=" . S::sqlEscape($key)); } adminmsg("operate_success", $basename . "&action=editmodel&cateid=" . $cateid . "&modelid=" . $modelid); } elseif ($step == '3') { L::loadClass('posttopic', 'forum', false); $pwpost = array(); $postTopic = new postTopic($pwpost); $topichtml = $postTopic->getTopicHtml($modelid); include PrintEot('topiccate'); exit; } } elseif ($action == 'editmodelname') { define('AJAX', 1); if (empty($_POST['step'])) { $ajax_basename = EncodeUrl($basename . '&action=editmodelname&'); //获取主题模版 $modeldb = getModeldbByCateid($cateid); include PrintEot('topiccate'); ajax_footer(); } else { S::gp(array('vieworder'), 'P', 2); S::gp(array('name'));
!defined('P_W') && exit('Forbidden'); require_once R_P . 'require/bbscode.php'; S::gp(array('pcid', 'modelid'), 'P', 2); $fielddb = array(); $data = array(); $atc_content = S::escapeChar(stripslashes(S::getGP('atc_content', 'P'))); $pcinfo = S::escapeChar(stripslashes(S::getGP('pcinfo', 'P'))); if ($modelid > 0) { $query = $db->query("SELECT fieldid,fieldname FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid)); while ($rt = $db->fetch_array($query)) { $fielddb[$rt['fieldid']] = $rt['fieldname']; } $pcdb = getPcviewdata($pcinfo, 'topic'); L::loadClass('posttopic', 'forum', false); $postTopic = new postTopic($data); $topicvalue = $postTopic->getTopicvalue($modelid, $pcdb); } elseif ($pcid > 0) { $query = $db->query("SELECT fieldid,fieldname FROM pw_pcfield WHERE pcid=" . S::sqlEscape($pcid)); while ($rt = $db->fetch_array($query)) { $fielddb[$rt['fieldname']] = $rt['fieldid']; } $pcdb = getPcviewdata($pcinfo, 'postcate'); L::loadClass('postcate', 'forum', false); $postCate = new postCate($data); list(, $topicvalue) = $postCate->getCatevalue($pcid, $pcdb); } $atc_content = wordsConvert($atc_content); $atc_content = convert($atc_content, $db_windpost); $preatc = str_replace("\n", "<br>", $atc_content); require_once R_P . 'require/header.php';
if ($count > 20) { Showmsg('mode_o_addftype_length'); } $db->update("INSERT INTO pw_friendtype(uid,name) VALUES(" . pwEscape($winduid) . "," . pwEscape($typename) . ")"); $id = $db->insert_id(); if ($id) { echo "success\t{$id}\t{$typename}"; ajax_footer(); } else { Showmsg('undefined_action'); } } elseif ($action == 'asearch') { InitGP(array('fid', 'modelid', 'pcid')); if ($modelid) { require_once R_P . 'lib/posttopic.class.php'; $postTopic = new postTopic($pwpost); $query = $db->query("SELECT fieldid,name,type,rules,vieworder,textsize FROM pw_topicfield WHERE modelid = " . pwEscape($modelid) . " AND ifable='1' AND ifasearch='1' ORDER BY vieworder ASC,fieldid ASC"); while ($rt = $db->fetch_array($query)) { list($rt['name1'], $rt['name2']) = explode('{#}', $rt['name']); $rt['searchhtml'] = $postTopic->getASearchHtml($rt['type'], $rt['fieldid'], $rt['textsize'], $rt['rules']); $asearchdb[$rt['fieldid']] = $rt; } } elseif ($pcid) { require_once R_P . 'lib/postcate.class.php'; $postTopic = new postCate($pwpost); $query = $db->query("SELECT fieldid,name,type,rules,vieworder,textsize FROM pw_pcfield WHERE pcid = " . pwEscape($pcid) . " AND ifable='1' AND ifasearch='1' ORDER BY vieworder ASC,fieldid ASC"); while ($rt = $db->fetch_array($query)) { list($rt['name1'], $rt['name2']) = explode('{#}', $rt['name']); $rt['searchhtml'] = $postTopic->getASearchHtml($rt['type'], $rt['fieldid'], $rt['textsize'], $rt['rules']); $asearchdb[$rt['fieldid']] = $rt; }
Cookie("concle", "1", 0); } else { $concle = 1; $managemode = 0; Cookie("concle", "", 0); } $trd_adminhide = "<form action=\"mawhole.php\" method=\"post\" name=\"mawhole\"><input type=\"hidden\" name=\"fid\" value=\"{$fid}\">"; } else { $trd_adminhide = ''; } $colspannum = 6; /*分类、团购 start*/ /*分类信息*/ if ($foruminfo['modelid'] || $modelid > 0) { L::loadClass('posttopic', 'forum', false); $postTopic = new postTopic($pwpost); $modelids = explode(",", $foruminfo['modelid']); if ($foruminfo['modelid']) { $N_allowtopicopen = true; } else { $N_allowtopicopen = false; } } /*团购*/ if ($foruminfo['pcid'] || $pcid > 0) { L::loadClass('postcate', 'forum', false); $postCate = new postCate($pwpost); $pcids = explode(",", $foruminfo['pcid']); if ($foruminfo['pcid']) { $N_allowpostcateopen = true; } else {
function getSearchvalue($field, $type, $alltidtype = false, $backtype = false) { /*获取搜索结果*/ global $db_perpage, $page, $modelid, $fid, $basename; $field = unserialize(StrCode($field, 'DECODE')); $sqladd = ''; $fid && ($sqladd .= " fid=" . S::sqlEscape($fid)); $fielddb = postTopic::getFieldData($modelid, $type); foreach ($field as $key => $value) { if ($value) { if (in_array($fielddb[$key]['type'], array('number', 'radio', 'select'))) { $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . "=" . S::sqlEscape($value) : $fielddb[$key]['fieldname'] . "=" . S::sqlEscape($value); } elseif ($fielddb[$key]['type'] == 'checkbox') { $checkboxs = ''; foreach ($value as $cv) { $checkboxs .= $checkboxs ? ',' . $cv : $cv; } $value = '%,' . $checkboxs . ',%'; $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . " LIKE(" . S::sqlEscape($value) . ")" : $fielddb[$key]['fieldname'] . " LIKE(" . S::sqlEscape($value) . ")"; } elseif ($fielddb[$key]['type'] == 'calendar' && ($value['start'] || $value['end'])) { $value['start'] && ($value['start'] = PwStrtoTime($value['start'])); $value['end'] && ($value['end'] = PwStrtoTime($value['end'])); if ($value['start'] > $value['end'] && $value['start'] && $value['end']) { Showmsg('calendar_error'); } $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . ">=" . S::sqlEscape($value['start']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . S::sqlEscape($value['end']) : $fielddb[$key]['fieldname'] . ">=" . S::sqlEscape($value['start']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . S::sqlEscape($value['end']); } elseif (in_array($fielddb[$key]['type'], array('text', 'url', 'email', 'textarea'))) { $value = '%' . $value . '%'; $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . " LIKE(" . S::sqlEscape($value) . ")" : $fielddb[$key]['fieldname'] . " LIKE(" . S::sqlEscape($value) . ")"; } elseif ($fielddb[$key]['type'] == 'range' && $value['min'] && $value['max']) { $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . ">=" . S::sqlEscape($value['min']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . S::sqlEscape($value['max']) : $fielddb[$key]['fieldname'] . ">=" . S::sqlEscape($value['min']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . S::sqlEscape($value['max']); } else { $sqladd .= ''; } } } if ($sqladd) { !$page && ($page = 1); $start = ($page - 1) * $db_perpage; $limit = S::sqlLimit($start, $db_perpage); $tablename = GetTopcitable($modelid); $sqladd .= $sqladd ? " AND ifrecycle=0" : " ifrecycle=0"; $count = $this->db->get_value("SELECT COUNT(*) as count FROM {$tablename} WHERE {$sqladd}"); $query = $this->db->query("SELECT tid FROM {$tablename} WHERE {$sqladd} {$limit}"); while ($rt = $this->db->fetch_array($query)) { $tiddb[] = $rt['tid']; } if ($alltidtype) { $query = $this->db->query("SELECT tid FROM {$tablename} WHERE {$sqladd}"); while ($rt = $this->db->fetch_array($query)) { $alltiddb[] = $rt['tid']; } } !$count && ($count = -1); } else { if ($backtype) { adminmsg('topic_search_none', "{$basename}&action=topic&modelid={$modelid}"); } Showmsg('topic_search_none'); } return array($count, $tiddb, $alltiddb); }
$asearchhtml .= getSearchHtml($rt); } } $searchhtml .= '</span>'; $asearchhtml .= '</span>'; if (strpos($searchhtml, '</span></span>') !== false) { $searchhtml = str_replace('</span></span>', '</span>', $searchhtml); } if (strpos($asearchhtml, '</span></span>') !== false) { $asearchhtml = str_replace('</span></span>', '</span>', $asearchhtml); } $tablename = GetTopcitable($modelid); } if ($step == 'search') { require_once R_P . 'lib/posttopic.class.php'; $searchTopic = new postTopic($field); if (!$newfield) { $newfield = StrCode(serialize($field)); } list($count, $tiddb, $alltiddb) = $searchTopic->getSearchvalue($newfield, 'one', true, true); is_array($tiddb) && ($sql .= " AND tv.tid IN(" . pwImplode($tiddb) . ")"); is_array($alltiddb) && ($alltids = implode(',', $alltiddb)); } if ($step != 'search' || !$count) { $alltiddb = $threadb = $newtiddb = array(); $query = $db->query("SELECT tid FROM {$tablename} WHERE ifrecycle=0"); while ($rt = $db->fetch_array($query)) { $alltiddb[] = $rt['tid']; } if ($alltiddb) { $query = $db->query("SELECT tid FROM pw_threads WHERE tid IN(" . pwImplode($alltiddb) . ")");
$trd_adminhide = "<form action=\"mawhole.php?{$viewbbs}\" method=\"post\" name=\"mawhole\"><input type=\"hidden\" name=\"fid\" value=\"{$fid}\">"; } } else { $trd_adminhide = ''; } $colspannum = 6; if ($foruminfo['allowtype'] && ($foruminfo['allowtype'] & 1 || $foruminfo['allowtype'] & 2 && $_G['allownewvote'] || $foruminfo['allowtype'] & 4 && $_G['allowactive'] || $foruminfo['allowtype'] & 8 && $_G['allowreward'] || $foruminfo['allowtype'] & 16 || $foruminfo['allowtype'] & 32 && $_G['allowdebate'])) { $N_allowtypeopen = true; } else { $N_allowtypeopen = false; } /*分类、团购、活动 start*/ /*分类信息*/ if ($foruminfo['modelid'] || $modelid > 0) { L::loadClass('posttopic', 'forum', false); $postTopic = new postTopic($pwpost); $modelids = explode(",", $foruminfo['modelid']); if ($foruminfo['modelid']) { $N_allowtypeopen = true; } } /*团购*/ if ($foruminfo['pcid'] || $pcid > 0) { L::loadClass('postcate', 'forum', false); $postCate = new postCate($pwpost); $pcids = explode(",", $foruminfo['pcid']); if ($foruminfo['pcid']) { $N_allowtypeopen = true; } } /*活动*/