<?php
  
IF (GET('comment_delete') && DB::GET_COLUMN("SELECT COUNT(*) FROM `PHOTOS_COMMENTS` WHERE `ID` = '".INTVAL(GET('comment_delete'))."' LIMIT 1") == 1){
  
  DB::GET_SET("DELETE FROM `PHOTOS_COMMENTS_LIKES` WHERE `COMMENT_ID` = '".INTVAL(GET('comment_delete'))."'");
  
  DB::GET_SET("DELETE FROM `PHOTOS_COMMENTS` WHERE `ID` = '".INTVAL(GET('comment_delete'))."' LIMIT 1");
  
  DB::GET_SET("DELETE FROM `ATTACHMENTS` WHERE `ID_POST` = '".INTVAL(GET('comment_delete'))."' AND `TYPE_POST` = 'photos_comments'");
  
  REDIRECT('/modules/?path=photos&section=show&photo_id='.$photo['ID'].'&page='.$page.'');

}
  
ECHO "<a href='/modules/?path=photos&section=show&photo_id=".$photo['ID']."&page=".$page."&comment_delete=".$list['ID']."' class='btn-o'>".ICONS('trash', 12, 'fa-fw')." ".LG('Удл.')."</a>";
  
?>