Example #1
0
function EditPrintTemp($add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    $tempid = (int) $add[tempid];
    if (!$tempid || !$add[tempname] || !$add[temptext]) {
        printerror("EmptyPrintTemp", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $add[tempname] = hRepPostStr($add[tempname], 1);
    $add[temptext] = RepPhpAspJspcode($add[temptext]);
    $add[modid] = (int) $add[modid];
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewsprinttemp", $gid) . " set tempname='" . $add[tempname] . "',temptext='" . eaddslashes2($add[temptext]) . "',showdate='{$add['showdate']}',modid='{$add['modid']}' where tempid='{$tempid}'");
    //备份模板
    AddEBakTemp('printtemp', $gid, $tempid, $add[tempname], $add[temptext], 0, 0, '', 0, $add[modid], $add[showdate], 0, 0, 0, $userid, $username);
    //更新页面
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        GetPrintPage($tempid);
    }
    if ($sql) {
        //操作日志
        insert_dolog("tempid={$tempid}&tempname={$add['tempname']}&gid={$gid}");
        printerror("EditPrintTempSuccess", "ListPrinttemp.php?gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Example #2
0
function ReDtPage($userid, $username)
{
    //操作权限
    CheckLevel($userid, $username, $classid, "changedata");
    GetPlTempPage();
    //评论列表模板
    GetPlJsPage();
    //评论JS模板
    ReCptemp();
    //控制面板模板
    GetSearch();
    //三搜索表单模板
    GetPrintPage();
    //打印模板
    GetDownloadPage();
    //下载地址页面
    ReGbooktemp();
    //留言板模板
    ReLoginIframe();
    //登陆状态模板
    ReSchAlltemp();
    //全站搜索模板
    //操作日志
    insert_dolog("");
    printerror("ReDtPageSuccess", "history.go(-1)");
}
Example #3
0
function Moreport_ChangeData($portr, $ecms = 0)
{
    global $empire, $dbtbpre, $public_r, $ecms_config;
    $ecms_config['sets']['deftempid'] = $portr['tempgid'];
    if ($ecms == 1) {
        GetPlTempPage();
        //评论列表模板
        GetPlJsPage();
        //评论JS模板
        ReCptemp();
        //控制面板模板
        GetSearch();
        //三搜索表单模板
        GetPrintPage();
        //打印模板
        GetDownloadPage();
        //下载地址页面
        ReGbooktemp();
        //留言板模板
        ReLoginIframe();
        //登陆状态模板
        ReSchAlltemp();
        //全站搜索模板
        //防采集缓存
        $yfile = ECMS_PATH . DASHBOARD . '/data/dbcache/notcj.php';
        $nfile = ECMS_SELFPATH . DASHBOARD . '/data/dbcache/notcj.php';
        @copy($yfile, $nfile);
    } elseif ($ecms == 2) {
        //临时文件目录
        $tmppath = ECMS_SELFPATH . DASHBOARD . '/data/tmp';
        $hand = @opendir($tmppath);
        while ($file = @readdir($hand)) {
            if ($file == '.' || $file == '..' || $file == 'test.txt' || $file == 'index.html' || $file == 'mod' || $file == 'temp' || $file == 'titlepic' || $file == 'cj') {
                continue;
            }
            $filename = $tmppath . '/' . $file;
            if (!is_dir($filename)) {
                DelFiletext($filename);
            }
        }
    } elseif ($ecms == 3) {
        $ypath = ECMS_PATH . 'd/js';
        $npath = ECMS_SELFPATH . 'd/js';
        CopyPath($ypath, $npath);
        $ypath = ECMS_PATH . DASHBOARD . '/data/fc';
        $npath = ECMS_SELFPATH . DASHBOARD . '/data/fc';
        CopyPath($ypath, $npath);
        $ypath = ECMS_PATH . DASHBOARD . '/data/html';
        $npath = ECMS_SELFPATH . DASHBOARD . '/data/html';
        CopyPath($ypath, $npath);
        $ypath = ECMS_PATH . DASHBOARD . '/data/template';
        $npath = ECMS_SELFPATH . DASHBOARD . '/data/template';
        CopyPath($ypath, $npath);
    } elseif ($ecms == 4) {
        if ($portr['mustdt'] || $public_r['indexpagedt']) {
            DelFiletext(ECMS_SELFPATH . 'index' . $public_r['indextype']);
            @copy(ECMS_SELFPATH . DASHBOARD . '/data/template/dtindexpage.txt', ECMS_SELFPATH . 'index.php');
        }
    } else {
        //更新参数设置
        GetConfig(1);
        //更新类别
        GetClass();
        //更新会员组
        GetMemberLevel();
        //更新全站搜索数据表
        GetSearchAllTb();
    }
}
    WriteFiletext_n($filename, $allface);
}
//更新其它数据
if ($ecms == 'ChangeInstallOtherData') {
    //--- 删除缓存文件 ---
    DelListEnews();
    //--- 更新动态页面 ---
    GetPlTempPage();
    //评论列表模板
    GetPlJsPage();
    //评论JS模板
    ReCptemp();
    //控制面板模板
    GetSearch();
    //三搜索表单模板
    GetPrintPage();
    //打印模板
    GetDownloadPage();
    //下载地址页面
    ReGbooktemp();
    //留言板模板
    ReLoginIframe();
    //登陆状态模板
    ReSchAlltemp();
    //全站搜索模板
    //生成首页
    $indextemp = GetIndextemp();
    NewsBq(0, $indextemp, 1, 0);
    //--- 更新反馈表单 ---
    $sql = $empire->query("select bid,btemp from {$dbtbpre}enewsfeedbackclass order by bid");
    while ($r = $empire->fetch($sql)) {