Пример #1
0
function DelClass($classid, $userid, $username)
{
    global $empire, $dbtbpre;
    $classid = (int) $classid;
    if (!$classid) {
        printerror("NotDelClassid", "");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "class");
    $r = $empire->fetch1("select * from {$dbtbpre}enewsclass where classid='{$classid}'");
    if (empty($r[classid])) {
        printerror("NotClassid", "history.go(-1)");
    }
    DelClass1($classid);
    GetClass();
    GetSearch($r[modid]);
    //返回地址
    if ($_GET['from']) {
        $returnurl = "ListPageClass.php";
    } else {
        $returnurl = "ListClass.php";
    }
    TogNotReClass(1);
    insert_dolog("classid=" . $classid . "<br>classname=" . $r[classname]);
    //操作日志
    printerror("DelClassSuccess", $returnurl);
}
Пример #2
0
function DelClass($classid, $userid, $username)
{
    global $empire, $dbtbpre;
    $classid = (int) $classid;
    if (!$classid) {
        printerror("NotDelClassid", "");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "class");
    $r = $empire->fetch1("select * from {$dbtbpre}enewsclass where classid='{$classid}'");
    if (empty($r[classid])) {
        printerror("NotClassid", "history.go(-1)");
    }
    DelClass1($classid);
    GetClass();
    //GetSearch($r[modid]);
    //返回地址
    if ($_GET['from']) {
        $returnurl = "ListPageClass.php";
    } else {
        $returnurl = "ListClass.php";
    }
    TogNotReClass(1);
    //删除导航缓存
    $empire->query("delete from {$dbtbpre}enewsclassnavcache where navtype='listclass' or navtype='listenews' or navtype='jsclass' or navtype='userenews' or (navtype='modclass' and modid='{$r['modid']}')");
    $cache_enews = 'doclass,doinfo,douserinfo,domod,dostemp';
    $cache_ecmstourl = urlencode($returnurl . hReturnEcmsHashStrHref2(1));
    $cache_mess = 'DelClassSuccess';
    $cache_mid = $r[modid];
    $cache_url = "CreateCache.php?enews={$cache_enews}&mid={$cache_mid}&ecmstourl={$cache_ecmstourl}&mess={$cache_mess}" . hReturnEcmsHashStrHref2(0);
    insert_dolog("classid=" . $classid . "<br>classname=" . $r[classname]);
    //操作日志
    //printerror("DelClassSuccess",$returnurl);
    echo '<meta http-equiv="refresh" content="0;url=' . $cache_url . '">';
    db_close();
    $empire = null;
    exit;
}