-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/zbk_20220209_admin/php/board/
File Upload :
Current File : /var/www/html/zbk_20220209_admin/php/board/act.delete.php

<?php

	function delete_board ( $numid )
	{
		global $exe , $_POST , $total , $info_db , $config , $info_file , $info_thumb , $info_comment ;
		if ( empty($numid)) return false ;
		########################################################
		// info
		########################################################
		$info = $exe->qry_fetch ( " from tbl_{$total[table]} where keycode='{$total[code]}' and numid='{$numid}' " , " * " ) ;
		if ( empty($info['numid'])) return false ;
		if ( empty($_POST['pass']) || $_POST['pass'] != $info['pass'] )
		{
			if (!empty($total['loginid']) && !empty($total['loginno']) && $total['loginlevel'] == $info['real_level'] && $total['loginno'] == $info['real_no'] && $total['loginid'] == $info['real_id'] ) {}
			else {}
		}
		########################################################
		// use preview image
		########################################################
		#if ( $total['options']['preview'] == 'on' )
		#	file_delete( 'files/' . $total['table'] . $info_thumb['directory'] . '/' . $info['prev_image'] ) ;
		########################################################
		// use title(special) image
		########################################################
		if ( $total['options']['title_image'] == 'on' )
			file_delete( 'files/' . $total['table'] . ${$total['options']['title_info']}['directory'] . '/' . $info['main_image'] ) ;
		######################################################
		// use movie
		######################################################
		if ( $total['options']['movie'] == 'on' )
		{
			if ( file_info ( 'files/' . $info_file['mov_dir'] . '/' . $info['mov_image'] ) !== false )
				file_delete( 'files/' . $info_file['mov_dir'] . '/' . $info['mov_image'] ) ;
			if ( file_info ( 'files/' . $info_file['mov_dir'] . '/' . $info['mov_video'] ) !== false )
				file_delete( 'files/' . $info_file['mov_dir'] . '/' . $info['mov_video'] ) ;
		}
		########################################################
		// use file upload
		########################################################
		if ( $total['options']['file'] == 'on' )
		{
			$execute = $exe->qry_one( " from tbl_{$info_file[table]} where keycode='{$total[code]}' and parent_numid = '{$numid}' order by write_date asc " , " fileno , real_file_name " ) ;
			while ( $rs = $exe->fetch ( $execute))
			{
				file_delete ( 'files/' . $total['table'] . '/' . $rs['real_file_name'] ) ;
				if ( file_info($file_path) !== false) {
					if ( strpos($fileExe['file_type'], 'image') !== false ) // use Image Preview
						file_delete('files/' . $total['table'] . $info_thumb['directory'] . '/' . $info_thumb['head'] . $fileRs['real_file_name']);
					file_delete($file_path);
				}
			}
		}
		########################################################
		// act
		########################################################
		$exe->qry_delete( " tbl_{$info_file[table]} " , " keycode='{$info[keycode]}' and parent_numid = '{$info[numid]}' " ) ;
		$exe->qry_delete( " tbl_{$info_comment[table]} " , " keycode='{$info[keycode]}' and parent_numid = '{$info[numid]}' " ) ;
		$exe->qry_delete( " tbl_{$total[table]} " , " keycode='{$info[keycode]}' and numid = '{$info[numid]}' " ) ;
		return true ;
	}

########################################################
// approve
########################################################

	if ( is_array($_POST['chk_numid']))
	{
		foreach ( $_POST['chk_numid'] as $val )
		{
			if ( emptY($val)) continue ;
			$return = delete_board ( $val ) ;
		}
	}
	else
	{
		if ( empty($numid)) script_re($total['cmnall'] , ' Á¢±ÙÇÒ ¼ö ¾ø½À´Ï´Ù. ' ) ;
		$return = delete_board ( $numid ) ;
	}

########################################################
// end
########################################################

	script_re($total['cmnall'] ) ;

?>

Copyright © 2017 || Recoded By Mr.Bumblebee