Example #1
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
$tbn = $this->TBN();
$key = GV::Number($this->KN());
$tbn_write = Write::Inst()->TBN();
// 게시판의 모든 게시글의 첨부파일 삭제
$sql = "\n\tSELECT wr_no\n\tFROM `{$tbn_write}`\n\tWHERE bo_no='{$key}'\n";
$write_list = DB::Get()->sql_query_list($sql);
if (is_array($write_list)) {
    foreach ($write_list as $k => $v) {
        $file = new File($board, $v['wr_no']);
        $file->DeleteAll();
    }
}
// 게시글 모두 삭제
$sql = "\n\tDELETE FROM `{$tbn_write}` \n\tWHERE bo_no='{$key}'\n";
DB::Get()->sql_query($sql);
// 게시판 삭제
$sql = "\n\tDELETE FROM {$tbn}\n\tWHERE bo_no={$key}\n\tLIMIT 1\n";
DB::Get()->sql_query($sql);
Dialog::Alert("게시판의 모든 게시글/파일 삭제 완료!\n게시판 삭제 완료!", $this->Link('list'));