first
This commit is contained in:
34
modules/post/action/a.deletecategory.php
Normal file
34
modules/post/action/a.deletecategory.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
checkAdmin(0);
|
||||
|
||||
include_once $g['path_module'].$m.'/_main.php';
|
||||
if (!$cat) getLink('./?m=admin&module='.$m.'&front=category','parent.','','');
|
||||
$CINFO = getUidData($table[$m.'category'],$cat);
|
||||
$subQue = getPostCategoryCodeToSql($table[$m.'category'],$CINFO['id']);
|
||||
|
||||
$subQue = str_replace('category=','uid=',$subQue);
|
||||
|
||||
if ($subQue)
|
||||
{
|
||||
$DAT = getDbSelect($table[$m.'category'],$subQue,'*');
|
||||
while($R=db_fetch_array($DAT))
|
||||
{
|
||||
|
||||
getDbDelete($table[$m.'category'],'uid='.$R['uid']); // 카테고리 삭제
|
||||
getDbDelete($table[$m.'category_index'],'category='.$R['uid']); //인덱스삭제
|
||||
|
||||
$_xfile = $g['path_file'].$m.'/code/'.sprintf('%05d',$R['uid']);
|
||||
@unlink($_xfile.'.header.php');
|
||||
@unlink($_xfile.'.footer.php');
|
||||
@unlink($g['path_file'].$m.'/category/'.$R['imghead']);
|
||||
@unlink($g['path_file'].$m.'/category/'.$R['imgfoot']);
|
||||
}
|
||||
|
||||
if ($parent)
|
||||
{
|
||||
if (!getDbRows($table[$m.'category'],'parent='.$parent))
|
||||
{
|
||||
getDbUpdate($table[$m.'category'],'is_child=0','uid='.$parent);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user