示例#1
0
<?php

if (!$uid) {
    putErrPage(getErrorMsg(3));
}
$UID_DATA = db_fetch_array(db_query("SELECT * FROM kimsbod7_" . $table . "_dat WHERE BB_UID='{$uid}'", $DB_CONNECT));
if (!getPassCheck($COMP_PASS, $UID_DATA[BB_PASS], $UID_DATA[BB_MB_ID])) {
    putErrPage(getErrorMsg(4));
}
$KEY_UPDATE = db_query("SELECT * FROM kimsbod7_" . $table . "_key WHERE KY_PID <= " . $UID_DATA[BB_PID] . " ORDER BY KY_KEY DESC", $DB_CONNECT);
$ROW_DATA = db_fetch_array(db_query("SELECT MIN(BB_PID) FROM kimsbod7_" . $table . "_dat", $DB_CONNECT));
$NKEY = $ROW_DATA[0];
while ($KEY = db_fetch_array($KEY_UPDATE)) {
    $DEL_QUE = "SELECT BB_PID FROM kimsbod7_" . $table . "_dat ";
    $DEL_QUE .= "WHERE BB_PID >= {$NKEY} AND BB_PID < " . $KEY[KY_PID] . " ORDER BY BB_PID DESC LIMIT 0,1";
    $UKEY = db_fetch_array(db_query($DEL_QUE, $DB_CONNECT));
    $NKEY = $KEY[KY_PID];
    if ($UKEY[BB_PID]) {
        db_query("UPDATE kimsbod7_" . $table . "_key SET KY_PID='" . $UKEY[BB_PID] . "' WHERE KY_KEY='" . $KEY[KY_KEY] . "'", $DB_CONNECT);
    } else {
        db_query("DELETE FROM kimsbod7_" . $table . "_key WHERE KY_KEY='" . $KEY[KY_KEY] . "'", $DB_CONNECT);
    }
}
$CMT_DATA = db_query("SELECT * FROM kimsbod7_" . $table . "_rpl WHERE RP_PARENT='{$uid}'", $DB_CONNECT);
while ($CMT = db_fetch_array($CMT_DATA)) {
    getUpfileDelete($CMT[RP_FILE], $table);
}
getUpfileDelete($UID_DATA[BB_FILE], $table);
db_query("DELETE FROM kimsbod7_" . $table . "_dat WHERE BB_UID='" . $uid . "'", $DB_CONNECT);
db_query("DELETE FROM kimsbod7_" . $table . "_rpl WHERE RP_PARENT='" . $uid . "'", $DB_CONNECT);
if ($bbs[rec_give]) {
示例#2
0
switch ($write_type) {
    case "reply":
        //---------------------------------------------------------------------------[답변]
        $ReplyPerm = getEnterPerm($bbs[ReplyPm], "", true, true);
        if (!$ReplyPerm) {
            putErrPage(getErrorMsg(2));
        }
        $wSetHomeurl = "http://";
        $write_Stype = $write_type;
        $wSetSubject = "RE:" . $RCD[BB_SUBJECT];
        $wStartHtml = $RCD[BB_HTML];
        $wSetContent = htmlspecialchars(stripslashes($RCD[BB_CONTENT]));
        break;
    case "modify":
        //--------------------------------------------------------------------------[수정]
        if (!getPassCheck($COMP_PASS, $RCD[BB_PASS], $RCD[BB_MB_ID])) {
            putErrPage(getErrorMsg(2));
        }
        if ($RCD[BB_FILE]) {
            $wSetUpArry = explode(';', $RCD[BB_FILE]);
            for ($i = 0; $i < sizeof($wSetUpArry); $i++) {
                if (!trim($wSetUpArry[$i])) {
                    continue;
                }
                $tmp_Size = @filesize("./bbs/table/{$table}/upload/" . $wSetUpArry[$i]);
                $wSetUpload .= $wSetUpArry[$i] . "=" . $tmp_Size . ";";
                $wSetUpSize += $tmp_Size;
            }
            unset($i, $tmp_Size);
        }
        $wSetLink = $RCD[BB_LINK];