Файл: modules/videos/plugins/delete_video.php
Строк: 9
<?php
/*
--------------------------------------
Удаление комментариев и лайков к видео
--------------------------------------
*/
DB::GET_SET("DELETE FROM `VIDEOS_LIKES` WHERE `VIDEO_ID` = '".$video['ID']."'");
$data = DB::GET_STRING_ALL("SELECT `ID` FROM `VIDEOS_COMMENTS` WHERE `VIDEO_ID` = '".$video['ID']."'");
WHILE ($list = $data->FETCH()){
DB::GET_SET("DELETE FROM `VIDEOS_COMMENTS_LIKES` WHERE `COMMENT_ID` = '".$list['ID']."'");
DB::GET_SET("DELETE FROM `VIDEOS_COMMENTS` WHERE `ID` = '".$list['ID']."' LIMIT 1");
DB::GET_SET("DELETE FROM `ATTACHMENTS` WHERE `ID_POST` = '".$list['ID']."' AND `TYPE_POST` = 'videos_comments'");
}
/*
---------------------
Удаление самого видео
---------------------
*/
@UNLINK(ROOT.'/files/upload/videos/source/'.$video['ID'].'.'.$video['EXT'].'');
@UNLINK(ROOT.'/files/upload/videos/screen/240x240/'.$video['ID'].'.jpg');
@UNLINK(ROOT.'/files/upload/videos/screen/'.$video['ID'].'.jpg');
DB::GET_SET("DELETE FROM `VIDEOS_SHOW` WHERE `VIDEO_ID` = '".$video['ID']."' AND `USER_ID` = '".$account['ID']."'");
DB::GET_SET("DELETE FROM `VIDEOS` WHERE `ID` = '".$video['ID']."' AND `USER_ID` = '".$account['ID']."'");
SUCCESS('Видео успешно удалено', 'session');
REDIRECT('/modules/?path=videos§ion=users&id='.$account['ID'].'&dir='.$id_dir.'');
?>