/** * Function used to remove video files */ function remove_files($vdetails) { //Return nothing incase there is no input if (!$vdetails) { e("No input details specified"); return false; } //Callign Video Delete Functions call_delete_video_function($vdetails); //Getting list of files $files = get_video_file($vdetails, false, false, true); if (is_array($files)) { foreach ($files as $file) { if (file_exists(VIDEOS_DIR . '/' . $file) && is_file(VIDEOS_DIR . '/' . $file)) { unlink(VIDEOS_DIR . '/' . $file); } } } else { if (file_exists(VIDEOS_DIR . '/' . $files) && is_file(VIDEOS_DIR . '/' . $files)) { unlink(VIDEOS_DIR . '/' . $files); } } e(lang("vid_files_removed_msg"), 'm'); }
/** * Function used to remove video files */ function remove_files($vdetails) { //Return nothing incase there is no input if (!$vdetails) { e("No input details specified"); return false; } //Callign Video Delete Functions call_delete_video_function($vdetails); //Getting list of files $files = get_video_file($vdetails, false, false, true); if (is_array($files)) { foreach ($files as $file) { if (file_exists(VIDEOS_DIR . '/' . $file) && is_file(VIDEOS_DIR . '/' . $file)) { unlink(VIDEOS_DIR . '/' . $file); } $fn = substr($file, 0, -7); $result = db_select("SELECT * FROM " . tbl("video") . " WHERE file_name = '{$fn}'"); if ($result) { foreach ($result as $result1) { $str = '/' . $result1['file_directory'] . '/'; if (file_exists(VIDEOS_DIR . $str . $file) && is_file(VIDEOS_DIR . $str . $file)) { unlink(VIDEOS_DIR . $str . $file); } } } } } else { if (file_exists(VIDEOS_DIR . '/' . $files) && is_file(VIDEOS_DIR . '/' . $files)) { unlink(VIDEOS_DIR . '/' . $files); } $fn = substr($files, 0, -7); $result = db_select("SELECT * FROM " . tbl("video") . " WHERE file_name = '{$fn}'"); if ($result) { foreach ($result as $result1) { $str = '/' . $result1['file_directory'] . '/'; if (file_exists(VIDEOS_DIR . $str . $files) && is_file(VIDEOS_DIR . $str . $files)) { unlink(VIDEOS_DIR . $str . $files); } } } } e(lang("vid_files_removed_msg"), 'm'); }