Размер файла: 2.3Kb
- <?php
- define('_IN_JOHNCMS', 1);
-
- $headmod = 'lib';
- $textl = 'Библиотека';
- require_once ("../incfiles/core.php");
- require_once ("./inc/conf.php");
- // Ограничиваем доступ к Библиотеке
- if (!$set['mod_lib'] && $rights < 7)
- $error = 'Библиотека закрыта';
- elseif ($set['mod_lib'] == 1 && !$user_id)
- $error = 'Доступ в Библиотеку открыт только <a href="../in.php">авторизованным</a> посетителям';
- if ($error) {
- require_once ("../incfiles/head.php");
- echo '<div class="rmenu"><p>' . $error . '</p></div>';
- require_once ("../incfiles/end.php");
- exit;
- }
- require_once ("../incfiles/head.php");
- if($rights == 5 || $rights >= 6)
- {
- echo '<div class="gmenu"><a href="admin.php"><strong>Управление библиотекой</strong></a></div>';
- $co = mysql_result(mysql_query("select COUNT(*) from `library` where `moder` = '0' and `type` = 'file'"),0);
- if($co > 0)
- {
- echo '<div class="menu"><strong>'.$co.'</strong> статей ожидают модерации перейти к ним <a href="mod.php">>>></a></div>';
- }
- }
- $total = mysql_result(mysql_query("select COUNT(*) from `library` where `count` > '0' and `moder` = '1' and `type` = 'file'"),0);
- if($total > 0)
- {
- $sql = mysql_query("select * from `library` where `count` > '0' and `moder` = '1' and `type` = 'file' order by `count` DESC LIMIT ".$start.",".$kol_file."");
- while($res = mysql_fetch_array($sql))
- {
- $i = 1;
- echo ($i % 2) ? '<div class="list1">' : '<div class="list2">';
- echo '<a href="read.php?id='.$res['id'].'"><span class="red">'.$res['name'].'</span></a><br/>';
- echo '<ul>';
- echo '<li><strong>Прочтений:</strong> '.$res['count'].'</li>';
- $sd = mysql_fetch_array(mysql_query("select `name` from `library` where `id` = '".$res['fid']."'"));
- echo '<li>[<a href="index.php?id='.$res['fid'].'">'.$sd['name'].'</a>]</li>';
- echo '</ul>';
- echo '</div>';
- }
- if ($total > $kol_file) {
- echo '<p>' . pagenav('pop.php?', $start, $total, $kol_file) . '</p>';
- }
- }
- echo '<br/><a href="index.php?">В библиотеку</a><br/>';
- require_once ('../incfiles/end.php');
- ?>