$fl = CMS_PATH . 'htm/' . $news_id['cate_fold_name'] . '/' . $addtime_rel[0] . '/' . $addtime_rel[1] . $addtime_rel[2] . '/' . $news_id['id'] . '.html';
            if (file_exists($fl)) {
                @unlink($fl);
            }
            if (!empty($news_id['id'])) {
                $GLOBALS['mysql']->query("delete from " . DB_PRE . "maintb where id=" . $news_id['id']);
            }
            if (!empty($news_id['id']) && !empty($news_id['table'])) {
                $GLOBALS['mysql']->query("delete from " . DB_PRE . $news_id['table'] . " where id=" . $news_id['id']);
            }
            show_htm("已经删除栏目【{$news_id['cate_name']}】下的文章【{$news_id['title']}】", '?action=del_channel&step=3&id=' . $id . '&cate_id=' . $cate_id . '&tb=' . $tb);
        } else {
            $GLOBALS['mysql']->query("delete from " . DB_PRE . "category where cate_parent=" . $cate_id);
            $GLOBALS['mysql']->query("delete from " . DB_PRE . "category where id=" . $cate_id);
            $GLOBALS['cache']->cache_category_all();
            show_htm("已经删除栏目({$cate_id})", '?action=del_channel&step=2&id=' . $id . '&tb=' . $tb);
        }
    }
} elseif ($action == 'fields') {
    if (!file_exists(DATA_PATH . "cache_channel/cache_fields.php")) {
        $GLOBALS['cache']->cache_fields();
    }
    $id = intval($_GET['id']);
    if (empty($id)) {
        msg('<span style="color:red">参数传递错误,请重新操作!</span>');
    }
    include DATA_PATH . "cache_channel/cache_fields.php";
    include 'template/admin_field.html';
} elseif ($action == 'add_field') {
    if (!check_purview('field_create')) {
        msg('<span style="color:red">操作失败,你的权限不足!</span>');
Example #2
0
                $msg['ago'] = $msg['ago'] + 1;
            } else {
                continue;
            }
        }
        //循环结束
        //更新缓存
        $msg_str = "<?php \n\$content_list=" . var_export($content_list, true) . ";\n?>";
        cache_write(DATA_PATH . 'cache_tpl/content_tpl.php', $msg_str);
        //信息缓存
        $msg_str = "<?php \n\$msg=" . var_export($msg, true) . ";\n?>";
        cache_write(DATA_PATH . 'cache_tpl/msg_tpl.php', $msg_str);
        $cate_msg = "已经生成" . $msg['ago'] . ",总共有" . $msg['all'];
        show_htm($cate_msg, '?action=content_htm&lang=' . $lang);
    } else {
        echo "已经生成" . $msg['ago'] . ",总共有" . $msg['all'] . "需要生成";
        show_htm('<p>完成所有内容的生成</p>', '?action=content&lang=' . $lang, 0);
    }
    //网站地图
} elseif ($action == 'map') {
    include 'template/admin_htm_map.html';
    //生成网站地图
} elseif ($action == 'save_map') {
    ob_start();
    $file = CMS_PATH . 'htm/' . $lang . '_sitemap.html';
    $tpl->display('sitemap');
    //载入模板
    creat_html($file);
    //生成文件
    err('【' . $lang . '】语言网站地图生成完成');
}
Example #3
0
            }
            show_htm('卷' . $page . '导入完成', '?action=save_import&fl=' . $fl . '&time=' . $time . '&rand=' . $rand . '&page=' . ($page + 1));
        } else {
            msg("数据还原成功", '?action=import');
        }
    } else {
        $db_handler = @opendir(DATA_PATH . 'backup/' . $fl);
        if ($db_handler) {
            while (false !== ($d_file = readdir($db_handler))) {
                $db_file = $d_file;
            }
        }
        if (!empty($db_file)) {
            $arr = explode('_', $db_file);
        }
        show_htm('准备数据恢复', '?action=save_import&fl=' . $fl . '&time=' . $arr[2] . '&rand=' . $arr[3] . '&page=1');
    }
} elseif ($action == 'del') {
    if (!check_purview('data_import')) {
        msg('<span style="color:red">操作失败,你的权限不足!</span>');
    }
    $fl = $_GET['fl'];
    if (empty($fl)) {
        err('<span style="color:red">参数传递错误,请重新操作</span>');
    }
    $db_handler = @opendir(DATA_PATH . 'backup/' . $fl);
    if ($db_handler) {
        while (false !== ($d_file = readdir($db_handler))) {
            @unlink(DATA_PATH . 'backup/' . $fl . '/' . $d_file);
        }
    }
    foreach ($lang_cache as $k => $v) {
        $sql = "select*from " . DB_PRE . "cmsinfo where info_tag='info' and lang_tag='{$v['lang_tag']}'";
        $rel = $mysql->fetch_asc($sql);
        $info = isset($rel[0]['info_array']) ? stripslashes($rel[0]['info_array']) : '';
        if (empty($info)) {
            continue;
        }
        $cache_str = "<?php\n\$_confing=" . $info . ";\n?>";
        cache_write(DATA_PATH . $v['lang_tag'] . '_info.php', $cache_str);
        unset($rel);
    }
    show_htm('网站配置更新完成', '?step=sys');
}
if ($step == 'sys') {
    $sql = "select*from " . DB_PRE . "cmsinfo where info_tag='sys'";
    $rel = $mysql->fetch_asc($sql);
    $info = isset($rel[0]['info_array']) ? stripslashes($rel[0]['info_array']) : '';
    $cache_str = "<?php\n\$_sys=" . $info . ";\n?>";
    cache_write(DATA_PATH . 'sys_info.php', $cache_str);
    unset($rel);
    show_htm('系统配置更新完成', '?step=index_info');
}
if ($step == 'index_info') {
    $sql = "select*from " . DB_PRE . "cmsinfo where info_tag='index_info'";
    $rel = $mysql->fetch_asc($sql);
    $info = isset($rel[0]['info_array']) ? stripslashes($rel[0]['info_array']) : '';
    $cache_str = "<?php\n\$_index=" . $info . ";\n?>";
    cache_write(DATA_PATH . 'index_info.php', $cache_str);
    unset($rel);
    show_htm('网站首页配置更新完成', 'admin_main.php');
}
        if (file_exists(DATA_PATH . 'cache_arr/content_arr.php')) {
            include DATA_PATH . 'cache_arr/content_arr.php';
        }
        if (!empty($arr)) {
            $id = array_shift($arr);
        }
        if (!empty($id)) {
            $sql = "select title from " . DB_PRE . "maintb where id={$id}";
            $id_arr = $GLOBALS['mysql']->fetch_asc($sql);
            $sql = "update " . DB_PRE . "maintb set verify=0 where id={$id}";
            $GLOBALS['mysql']->query($sql);
            $str = "<?php\n\$arr=" . var_export($arr, true) . ";\n?>";
            cache_write(DATA_PATH . 'cache_arr/content_arr.php', $str);
            show_htm("文章【{$id_arr[0]['title']}】通过审核", '?action=verify&channel_id=' . $channel_id . '&step=1&lang=' . $lang);
        } else {
            show_htm("选择文章审核完成", '?action=content_list&id=' . $channel_id . '&lang=' . $lang);
        }
    }
} elseif ($action == 'arc_move') {
    if (!check_purview('content_del')) {
        msg('<span style="color:red">操作失败,你的权限不足!</span>');
    }
    $all = $_REQUEST['all'];
    $channel = $_REQUEST['channel'];
    if (empty($all)) {
        msg('<span style="color:red">请选择需要转移的内容!</span>');
    }
    if (file_exists(DATA_PATH . 'cache_cate/cate_list_' . $lang . '.php')) {
        include DATA_PATH . 'cache_cate/cate_list_' . $lang . '.php';
    }
    include 'template/admin_content_move.html';
    $file = DATA_PATH . 'index_info.php';
    creat_inc($file, $s);
    //栏目缓存
    $GLOBALS['cache']->cache_category_all();
    $GLOBALS['cache']->cache_category(0, $lang);
    $GLOBALS['cache']->cache_category_child(0, $lang);
    cache_channel_category($lang);
    $sql = "select c.id,c.list_num,c.cate_pic1,c.cate_pic2,c.cate_pic3,c.cate_content,c.temp_id,c.custom_url,c.cate_channel,c.cate_fold_name,c.cate_nav,c.cate_is_open,c.cate_html,c.cate_url,c.cate_order,c.cate_hide,c.cate_tpl,c.cate_name,c.lang,c.cate_parent,c.is_content,COUNT(s.id) as haschild from " . DB_PRE . "category as c left join " . DB_PRE . "category as s on c.id=s.cate_parent where c.lang='" . $lang . "' group by c.id order by c.cate_order,c.id desc";
    $rel = $GLOBALS['mysql']->fetch_asc($sql);
    $str = "<?php\n\$cate_list=" . var_export($rel, true) . ";\n?>";
    $file = DATA_PATH . 'cache_cate/cate_list_' . $lang . '.php';
    creat_inc($file, $str);
    //模型缓存【公共】
    $GLOBALS['cache']->channel_cache($GLOBALS['lang']);
    $GLOBALS['cache']->cache_fields();
    //管理员分组【公共】
    $GLOBALS['cache']->cache_admin_group();
    //会员分组【公共】
    $GLOBALS['cache']->cache_member_group();
    //表单缓存【公共】
    $form_file = DATA_PATH . 'cache_form/form.php';
    $rel = $GLOBALS['mysql']->fetch_asc("select*from " . DB_PRE . "form order by id desc");
    $cache_str = "<?php\n\$form=" . var_export($rel, true) . ";\n?>";
    cache_write($form_file, $cache_str, '表单模型缓存');
    //表单字段字段【公共】
    $rel = $GLOBALS['mysql']->fetch_asc("select*from " . DB_PRE . "formfield order by form_order asc");
    $cache_str = "<?php\n\$field=" . var_export($rel, true) . ";\n?>";
    cache_write(DATA_PATH . 'cache_form/field.php', $cache_str);
    unset($rel);
    show_htm($lang . '语言缓存更新完成', '?lang=' . $lang);
}