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

Размер файла: 2.41Kb
  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. $total = 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);
  30. if($total > 0)
  31. {
  32. $sql = mysql_query("select * from `library` where `type` = 'file' and `path` LIKE '/%' and `time` > '".($realtime -(3 * 24 * 3600) )."' and `moder` = '1' order by `time` DESC LIMIT ".$start.",".$kol_file."");
  33. while($res = mysql_fetch_array($sql))
  34. {
  35. $i = 1;
  36. echo ($i % 2) ? '<div class="list1">' : '<div class="list2">';
  37. echo '<a href="read.php?id='.$res['id'].'"><span class="red">'.$res['name'].'</span></a><br/>';
  38. echo '<ul>';
  39. echo '<li><strong>Прочтений:</strong> '.$res['count'].'</li>';
  40. $sd = mysql_fetch_array(mysql_query("select `name` from `library` where `id` = '".$res['fid']."'"));
  41. echo '<li>[<a href="index.php?id='.$res['fid'].'">'.$sd['name'].'</a>]</li>';
  42. echo '</ul>';
  43. echo '</div>';
  44. }
  45. if ($total > $kol_file) {
  46. echo '<p>' . pagenav('new.php?', $start, $total, $kol_file) . '</p>';
  47. }
  48. }
  49. echo '<br/><a href="index.php?">В библиотеку</a><br/>';
  50. require_once ('../incfiles/end.php');
  51. ?>