示例#1
0
function catalog_cache()
{
    global $_catalog_array, $_parent_catalog_array, $DreamCMS;
    catalogvars();
    writefile(DCPATH . 'include/syscache/catalog.sub.cache.php', "<?php\n\$_catalog_array=" . da_var_export($_catalog_array) . '?>');
    writefile(DCPATH . 'include/syscache/catalog.parent.cache.php', "<?php\n\$_parent_catalog_array=" . da_var_export($_parent_catalog_array) . '?>');
    $rs = $DreamCMS->db->get_results("SELECT * FROM `#DC@__catalog` ORDER BY `order` , `id` ASC", ARRAY_A);
    $_count = count($rs);
    for ($i = 0; $i < $_count; $i++) {
        if ($rs[$i]['ishidden'] == "1") {
            $_catalog_hidden_id .= $rs[$i]['id'] . ',';
        }
        $_rs[$rs[$i]['id']] = $rs[$i];
    }
    $_catalog_hidden_id && ($_catalog_hidden_id = substr($_catalog_hidden_id, 0, -1));
    writefile(DCPATH . 'include/syscache/catalog.cache.php', "<?php\n\$_catalog=" . da_var_export($_rs) . ";\n\t\$_catalog_hidden_id='" . $_catalog_hidden_id . "';\n?>");
}
示例#2
0
             catalog_cache();
             redirect("栏目编辑完成!", 'admincp.php?do=catalog');
         }
     }
     if ($action == 'edit') {
         foreach ($_POST['order'] as $cid => $order) {
             $DreamCMS->db->query("UPDATE `#DC@__catalog` SET `name` = '" . $_POST['name'][$cid] . "',`order` = '" . intval($order) . "' WHERE `id` ='" . intval($cid) . "' LIMIT 1");
         }
         catalog_cache();
         _Header("admincp.php?do=catalog");
     }
     break;
 case 'del':
     $id = (int) $_GET['id'];
     if ($id) {
         catalogvars($id);
         if (empty($_catalog_array)) {
             $DreamCMS->db->query("DELETE FROM `#DC@__catalog` WHERE `id` = '{$id}'");
             $art = $DreamCMS->db->get_results("SELECT id FROM `#DC@__article` WHERE `cid` = '{$id}'");
             if ($art) {
                 foreach ($art as $a) {
                     delArticle($a['id']);
                 }
             }
             catalog_cache();
             alert("删除成功!", 'url:admincp.php?do=catalog');
         } else {
             alert("请先删除本栏目下的子栏目", 'url:admincp.php?do=catalog');
         }
     }
     break;
示例#3
0
 //生成速度
 $cids = $_GET['cid'];
 $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) {
示例#4
0
         if ($rs['cid'] && in_array($rs['cid'], $catids) || !$rs['cid'] && in_array($_GET['cid'], $catids)) {
             $show = 'yes';
         }
     }
     if ($show == 'yes') {
         $checked = '';
         if (is_array($typearr) && in_array($at[$i]['id'], $typearr)) {
             $checked = " checked='checked' ";
         }
         $type_option .= "<input type='checkbox' {$checked} name='type[]' value='{$at[$i]['id']}' />{$at[$i]['name']}[type='{$at[$i]['id']}']&nbsp;&nbsp;";
         //zhaoyanmin
     }
 }
 //zhaoyanmin end
 $rs['pubdate'] = empty($id) ? _getdate("Y-m-d H:i:s") : _getdate("Y-m-d H:i:s", $rs['pubdate']);
 catalogvars();
 $rootid = empty($rs['cid']) ? intval($_GET['cid']) : $rs['cid'];
 //zhaoyanmin start
 //查询本栏目
 $catalog = $DreamCMS->db->get_row("SELECT * FROM `#DC@__catalog` WHERE id='{$rootid}' LIMIT 1", ARRAY_A);
 $modelid = intval($catalog['modelid']);
 if ($modelid) {
     //查询此模型下的字段
     $fields = $DreamCMS->db->get_results("SELECT * FROM `#DC@__model_field` WHERE `modelid`='{$modelid}' AND `state`=1 ORDER BY `disorder` ASC,`fieldid` ASC");
     //查询此模型
     $model = $DreamCMS->db->get_row("SELECT * FROM `#DC@__model` WHERE `modelid`='{$modelid}'", ARRAY_A);
     //查询此模型副表
     if ($rs['id'] && $model['table']) {
         $modelotherdata = $DreamCMS->db->get_row("SELECT * FROM `#DC@__" . $model['table'] . "` WHERE `aid`='{$rs['id']}'", ARRAY_A);
         $modelotherdata && ($rs = array_merge($rs, $modelotherdata));
     }