Example #1
0
function DelYMemberTranFile($file, $tf, $username = '')
{
    global $empire, $dbtbpre;
    if (empty($file)) {
        return "";
    }
    $r = explode("/", $file);
    $count = count($r);
    $filename = $r[$count - 1];
    $fr = $empire->fetch1("select filename,path,fileid,fpath,classid from {$dbtbpre}enewsfile_member where no='Member[" . $tf . "]' and filename='{$filename}' and adduser='******' limit 1");
    if ($fr['fileid']) {
        $sql = $empire->query("delete from {$dbtbpre}enewsfile_member where fileid='{$fr['fileid']}'");
        DoDelFile($fr);
    }
}
Example #2
0
function DelFile_all($fileid, $userid, $username)
{
    global $empire, $dbtbpre, $class_r;
    //操作权限
    if ($_POST['enews'] == 'TDelFile_all') {
        $userid = (int) $userid;
        $ur = $empire->fetch1("select groupid,adminclass,filelevel from {$dbtbpre}enewsuser where userid='{$userid}' limit 1");
        if ($ur['filelevel']) {
            $gr = $empire->fetch1("select dofile from {$dbtbpre}enewsgroup where groupid='{$ur['groupid']}'");
            if (!$gr['dofile']) {
                $classid = (int) $_POST['classid'];
                $searchclassid = (int) $_POST['searchclassid'];
                $classid = $searchclassid ? $searchclassid : $classid;
                if (!$class_r[$classid]['classid']) {
                    printerror("NotLevel", "history.go(-1)");
                }
                if (!strstr($ur['adminclass'], '|' . $classid . '|')) {
                    printerror("NotLevel", "history.go(-1)");
                }
            }
        } else {
            CheckLevel($userid, $username, $classid, "file");
        }
    } else {
        CheckLevel($userid, $username, $classid, "file");
    }
    $count = count($fileid);
    if (!$count) {
        printerror("NotFileid", "history.go(-1)");
    }
    $modtype = (int) $_POST['modtype'];
    $fstb = (int) $_POST['fstb'];
    for ($i = 0; $i < count($fileid); $i++) {
        $fileid[$i] = (int) $fileid[$i];
        $r = $empire->fetch1("select filename,path,classid,fpath from " . eReturnFileTable($modtype, $fstb) . " where fileid='{$fileid[$i]}' limit 1");
        $sql = $empire->query("delete from " . eReturnFileTable($modtype, $fstb) . " where fileid='{$fileid[$i]}'");
        DoDelFile($r);
    }
    if ($sql) {
        //操作日志
        insert_dolog("");
        printerror("DelFileAllSuccess", $_SERVER['HTTP_REFERER']);
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Example #3
0
function DelFreeFile($userid, $username)
{
    global $empire, $dbtbpre;
    //操作权限
    CheckLevel($userid, $username, $classid, "file");
    $sql = $empire->query("select filename,path,classid,fpath from {$dbtbpre}enewsfile where cjid<>0 and (id=0 or cjid=id)");
    while ($r = $empire->fetch($sql)) {
        DoDelFile($r);
    }
    $delsql = $empire->query("delete from {$dbtbpre}enewsfile where cjid<>0 and (id=0 or cjid=id)");
    if ($sql) {
        //操作日志
        insert_dolog("");
        printerror("DelFreeFileSuccess", $_SERVER['HTTP_REFERER']);
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Example #4
0
function DelNewsTheFile($id, $classid, $delpl = 0)
{
    global $empire, $dbtbpre;
    if (empty($id)) {
        return "";
    }
    $i = 0;
    $sql = $empire->query("select classid,filename,path,fpath from {$dbtbpre}enewsfile where id='{$id}' and classid='{$classid}'");
    while ($r = $empire->fetch($sql)) {
        $i = 1;
        DoDelFile($r);
    }
    if ($i) {
        $empire->query("delete from {$dbtbpre}enewsfile where id='{$id}' and classid='{$classid}'");
    }
    //删除评论
    if ($delpl == 0) {
        $empire->query("delete from {$dbtbpre}enewspl where id='{$id}' and classid='{$classid}'");
        $tbr = $empire->fetch1("select pldatatbs from {$dbtbpre}enewspublic limit 1");
        if ($tbr['pldatatbs']) {
            $dtbr = explode(',', $tbr['pldatatbs']);
            $count = count($dtbr) - 1;
            for ($i = 1; $i < $count; $i++) {
                $empire->query("delete from {$dbtbpre}enewspl_data_" . $dtbr[$i] . " where id='{$id}' and classid='{$classid}'");
            }
        }
    }
}
Example #5
0
function DelYQTranFile($classid, $id, $file, $tf, $fstb = '1')
{
    global $empire, $dbtbpre;
    //特殊字段
    if ($tf == "downpath" || $tf == "onlinepath") {
        $file = DoReqDownPath($file);
    }
    if (empty($file)) {
        return "";
    }
    $r = explode("/", $file);
    $count = count($r);
    $filename = $r[$count - 1];
    $fr = $empire->fetch1("select filename,path,fileid,fpath,classid from {$dbtbpre}enewsfile_{$fstb} where classid='{$classid}' and id='{$id}' and filename='{$filename}' limit 1");
    if ($fr['fileid']) {
        $sql = $empire->query("delete from {$dbtbpre}enewsfile_{$fstb} where fileid='{$fr['fileid']}'");
        DoDelFile($fr);
    }
}
Example #6
0
function DelNewsTheFile($id, $classid, $fstb = '1', $delpl = 0, $restb = '1')
{
    global $empire, $dbtbpre;
    if (empty($id)) {
        return "";
    }
    $pubid = ReturnInfoPubid($classid, $id);
    $i = 0;
    $sql = $empire->query("select classid,filename,path,fpath from {$dbtbpre}enewsfile_{$fstb} where pubid='{$pubid}'");
    while ($r = $empire->fetch($sql)) {
        $i = 1;
        DoDelFile($r);
    }
    if ($i) {
        $empire->query("delete from {$dbtbpre}enewsfile_{$fstb} where pubid='{$pubid}'");
    }
    //删除评论
    if ($delpl == 0) {
        $empire->query("delete from {$dbtbpre}enewspl_{$restb} where pubid='{$pubid}'");
    }
}