Файл: modules/video/handler/del_video.php
Строк: 9
<?php
if (!empty($_GET['del_video']) && is_numeric($_GET['del_video']))
{
$del_video = abs(intval($_GET['del_video']));
if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `video` WHERE `id` = '".$del_video."' AND `user_id` = '".$user_id."' LIMIT 1"),0) == true)
{
$arr = mysql_fetch_array(mysql_query("SELECT * FROM `video` WHERE `id` = '".$del_video."' AND `user_id` = '".$user_id."' LIMIT 1"));
mysql_query("DELETE FROM `video` WHERE `id` = '".$del_video."'");
mysql_query("DELETE FROM `video_comm` WHERE `fid` = '".$del_video."'");
mysql_query("DELETE FROM `video_view` WHERE `v_id` = '".$del_video."'");
if (file_exists(HOME .'/files/video/'. $user_id.'/'.$arr['file'])) {@unlink(HOME .'/files/video/'. $user_id.'/'.$arr['file']);}
if($arr['dir']==$user_id)
{
if (file_exists(HOME .''.$arr['img'].'')) {@unlink(HOME .''.$arr['img'].'');}
}
mysql_query("UPDATE `users` SET count_video=count_video-1 WHERE `id` = '".$user_id."'");
}
}
?>