$startid = (int) $_GET['startid']; $endid = (int) $_GET['endid']; $starttime = $_GET['starttime']; $endtime = $_GET['endtime']; $totle = isset($_GET['totle']) ? $_GET['totle'] : 0; $loop = isset($_GET['loop']) ? $_GET['loop'] : 1; $i = isset($_GET['i']) ? $_GET['i'] : 0; if ($cids) { empty($cids) && alert("请选择栏目"); is_array($cids) && ($cids = implode(",", $cids)); if (strstr($cids, 'all')) { unset($_catalog_array, $_parent_catalog_array); //catalogvars(0,true); catalogvars(0, false); //zhaoyanmin 第二个参数为true时代表栏目跳转地址不为空的不选出来,false代表不管地址为空不为空都选出来 $cids = substr(catalogID(), 0, -1); if (empty($cids)) { _redirect("生成列表", "文章更新完毕", 'create&action=catalog&cid=all', 'article'); } else { _header('admincp.php?do=html&operation=create&action=article&cid=' . $cids . $QUERY_STRING); } } else { $cArray = explode(',', $cids); $_Ccount = count($cArray); $k = isset($_GET['k']) ? $_GET['k'] : 0; $rs = $DreamCMS->db->get_results("SELECT id FROM #DC@__article WHERE cid in ({$cids}) and `visible`='1'"); empty($totle) && ($totle = count($rs)); $tloop = ceil($totle / $speed); if ($loop <= $tloop) { $max = $i + $speed > $totle ? $totle : $i + $speed; for ($j = $i; $j < $max; $j++) {
function catalogID($cid = "0", $type = 'cl') { global $_catalog_array; if (isset($_catalog_array[$cid])) { foreach ($_catalog_array[$cid] as $root => $cata) { if ($type == 'cl') { $cata['attrib'] != 'page' && ($_catalogID .= $cata['id'] . "," . catalogID($cata['id'])); } if ($type == 'page') { $cata['attrib'] == 'page' && ($_catalogID .= $cata['id'] . "," . catalogID($cata['id'], 'page')); } } } unset($_catalog_array); return $_catalogID; }
<?php break; case 'manage': checkpower(array("menu_article_manage", "menu_article_draft", "menu_article_user_manage", "menu_article_user_draft")); // include_once(DCPATH.'include/syscache/catalog.cache.php'); $cid = (int) $_GET['cid']; $act = $_GET['act']; $sql = " where "; $sql .= $_GET['type'] == 'draft' ? "`visible` ='0'" : "`visible` ='1'"; $sql .= $act == 'user' ? " AND `postype`!='0'" : " AND `postype`='0'"; $_GET['keywords'] && ($sql .= " AND CONCAT(title,keywords,description) REGEXP '{$_GET['keywords']}'"); $_GET['title'] && ($sql .= " AND `title` like '%{$_GET['title']}%'"); $_GET['tag'] && ($sql .= " AND `tags` REGEXP '[[:<:]]" . preg_quote(rawurldecode($_GET['tag']), '/') . "[[:>:]]'"); isset($_GET['at']) && ($sql .= " AND `type` REGEXP '[[:<:]]" . preg_quote($_GET['at'], '/') . "[[:>:]]'"); isset($_GET['userid']) && ($sql .= " AND `userid`='" . (int) $_GET['userid'] . "'"); $cid && ($sql .= " AND cid IN(" . catalogID($cid) . $cid . ")"); // if($_catalog_hidden_id){ // $sql.=" AND cid not IN($_catalog_hidden_id)"; // } $act == 'user' && ($uri .= '&act=user'); $_GET['type'] == 'draft' && ($uri .= '&type=draft'); isset($_GET['userid']) && ($uri .= '&userid=' . (int) $_GET['userid']); isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']); isset($_GET['tag']) && ($uri .= '&tag=' . $_GET['tag']); $at = $DreamCMS->db->get_results("SELECT * FROM `#DC@__articletype`"); for ($i = 0; $i < count($at); $i++) { $type_option .= "<option value='{$at[$i]['id']}'>{$at[$i]['name']}[type='{$at[$i]['id']}'] </option>"; } $maxperpage = 20; $total = $DreamCMS->db->get_var("SELECT count(*) FROM `#DC@__article` {$sql} order by id DESC"); page($total, $maxperpage, "篇文章");