View file sys/add/delete_user_act/foto.php

File size: 1.61Kb
  1. <?
  2. $gallery_q=mysql_query("SELECT * FROM `gallery` WHERE `id_user` = '$ank[id]'");
  3. while ($gallery = mysql_fetch_assoc($gallery_q))
  4. {
  5. $q=mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$gallery[id]'");
  6. while ($post = mysql_fetch_assoc($q))
  7. {
  8. @unlink(H."sys/gallery/48/$post[id].jpg");
  9. @unlink(H."sys/gallery/128/$post[id].jpg");
  10. @unlink(H."sys/gallery/640/$post[id].jpg");
  11. @unlink(H."sys/gallery/foto/$post[id].jpg");
  12.  
  13. mysql_query("DELETE FROM `gallery_foto` WHERE `id` = '$post[id]' LIMIT 1");
  14. mysql_query("DELETE FROM `gallery_komm` WHERE `id_foto` = '$post[id]'");
  15. mysql_query("DELETE FROM `gallery_rating` WHERE `id_foto` = '$post[id]'");
  16. }
  17.  
  18. }
  19. mysql_query("DELETE FROM `gallery` WHERE `id_user` = '$ank[id]'");
  20. mysql_query("DELETE FROM `gallery_komm` WHERE `id_user` = '$ank[id]'");
  21.  
  22. if (isset($_GET['all']) && count($collisions)>1)
  23. {
  24. for ($i=1;$i<count($collisions);$i++)
  25. {
  26.  
  27. $gallery_q=mysql_query("SELECT * FROM `gallery` WHERE `id_user` = '$collisions[$i]'");
  28. while ($gallery = mysql_fetch_assoc($gallery_q))
  29. {
  30. $q=mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$gallery[id]'");
  31. while ($post = mysql_fetch_assoc($q))
  32. {
  33. @unlink(H."sys/gallery/48/$post[id].jpg");
  34. @unlink(H."sys/gallery/128/$post[id].jpg");
  35. @unlink(H."sys/gallery/640/$post[id].jpg");
  36. @unlink(H."sys/gallery/foto/$post[id].jpg");
  37.  
  38. mysql_query("DELETE FROM `gallery_foto` WHERE `id` = '$post[id]' LIMIT 1");
  39. mysql_query("DELETE FROM `gallery_komm` WHERE `id_foto` = '$post[$i]'");
  40. mysql_query("DELETE FROM `gallery_rating` WHERE `id_foto` = '$post[$i]'");
  41. }
  42.  
  43. }
  44. mysql_query("DELETE FROM `gallery` WHERE `id_user` = '$collisions[$i]'");
  45. }
  46.  
  47. }
  48.  
  49. ?>