Просмотр файла stat.php

Размер файла: 2.15Kb
  1. <?php
  2. define('_IN_JOHNCMS', 1);
  3.  
  4. $headmod = 'lib';
  5. $textl = 'Библиотека';
  6. require_once ("../incfiles/core.php");
  7. require_once ("./inc/conf.php");
  8. // Ограничиваем доступ к Библиотеке
  9. if (!$set['mod_lib'] && $rights < 7)
  10. $error = 'Библиотека закрыта';
  11. elseif ($set['mod_lib'] == 1 && !$user_id)
  12. $error = 'Доступ в Библиотеку открыт только <a href="../in.php">авторизованным</a> посетителям';
  13. if ($error) {
  14. require_once ("../incfiles/head.php");
  15. echo '<div class="rmenu"><p>' . $error . '</p></div>';
  16. require_once ("../incfiles/end.php");
  17. exit;
  18. }
  19. require_once ("../incfiles/head.php");
  20. if($rights == 5 || $rights >= 6)
  21. {
  22. echo '<div class="gmenu"><a href="admin.php"><strong>Управление библиотекой</strong></a></div>';
  23. $co = mysql_result(mysql_query("select COUNT(*) from `library` where `moder` = '0' and `type` = 'file'"),0);
  24. if($co > 0)
  25. {
  26. echo '<div class="menu"><strong>'.$co.'</strong> статей ожидают модерации перейти к ним <a href="mod.php">&gt;&gt;&gt;</a></div>';
  27. }
  28. }
  29. $count_dir = mysql_result(mysql_query("select COUNT(*) from `library` where `type` = 'dir'"),0);
  30. $count_file = mysql_result(mysql_query("select COUNT(*) from `library` where `type` = 'file' and `moder` = '1'"),0);
  31. $count_new_file = mysql_result(mysql_query("select COUNT(*) from `library` where `type` = 'file' and `path` LIKE '/%' and `time` > '".($realtime -($new_fil * 24 * 3600) )."' and `moder` = '1'"),0);
  32. $count_s = mysql_result(mysql_query("select SUM(count) from `library` where `type` = 'file' and `moder` = '1'"),0);
  33. echo '<div class="gmenu">';
  34. echo 'Всего категорий:<strong>'.$count_dir.'</strong><br/>';
  35. echo 'Всего книг:<strong>'.$count_file.'</strong><br/>';
  36. echo 'Всего новых книг:<strong>'.$count_new_file.'</strong><br/>';
  37. echo 'Всего прочтений:<strong>'.$count_s.'</strong><br/>';
  38. echo '</div>';
  39.  
  40. echo '<br/><a href="index.php?">В библиотеку</a><br/>';
  41. require_once ('../incfiles/end.php');
  42. ?>