Просмотр файла shouts/remove_all.php

Размер файла: 1.45Kb
  1. <?
  2. /*
  3. =============================================
  4. Движок: SHCMS Engine
  5. =============================================
  6. Название файла: Удаление всех сообщений в мини чате
  7. =============================================
  8. Official website: http://shcms.ru
  9. =============================================
  10. */
  11. define('SHCMS', true);
  12. include_once'../system/inc/basic_settings.php';
  13. $shcmsengine['title'] = 'Очистка мини чате';
  14. include_once'../template/head.php';
  15. registrat();
  16. $adminka ->admin();
  17.  
  18.  
  19. if(!$user_id) {
  20. errors('Доступ запрещен!!!');
  21. include_once'../template/foot.php';
  22. exit();
  23. }
  24.  
  25.  
  26. echo "<div class='posts'>Сообщений в мини-чате: (".mysql_result(mysql_query("SELECT COUNT(*) FROM `shouts`"),0).")</div>";
  27. echo "<a class='link_reg' href='?id=delete'>Очистить мини-чат</a>";
  28. if($_GET['id'] == 'delete') {
  29. $delete_shouts = mysql_query("DELETE FROM `shouts`");
  30. mysql_query("TRUNCATE TABLE `shouts`");
  31. if($delete_shouts == true) {
  32. messag('Мини-чат успешно очищен');
  33. header('Refresh: 1; url=index.php');
  34. include_once'../template/foot.php';
  35. exit();
  36. }
  37. else {
  38. errors('Ошибка очистки мини чата.');
  39. header('Refresh: 1; url=index.php');
  40. include_once'../template/foot.php';
  41. exit();
  42. }
  43. }
  44.  
  45. echo '<div class="link_str"><a href="/shouts/">Назад</div>';
  46.  
  47. include_once'../template/foot.php';
  48.  
  49. ?>