Файл: social12/fo/index.php
Строк: 28
<?php
require '../sid.php';
require '../config.php';
$link = connect_db();
if (!empty($_SESSION['us'])) {
list($user, $id, $ps) = check_login($link);
whorm(0, 'fo');
}
include '../head.php';
include '../navigator.php';
echo $div_title . 'Зона обмена' . $div_end . $div_aut . '
<a href="../faq.php?do=fo">Правила зоны обмена</a>
' . $div_end . $div_left . $div_menu . '
<img src="../ico/up.gif" alt=""/> <b>Зона обмена</b>
' . $block . '
<a href="search.php?'.$ref.'">Поиск</a><br/>
<a href="pop.php?'.$ref.'">Популярные</a> |
<a href="new.php?'.$ref.'">Новые</a>
' . $div_end;
$look = mysql_result(mysql_query("SELECT COUNT(*) FROM `fo_cat`"), 0);
$n = new navigator($look, 25, '?');
$view = mysql_query("SELECT `fo_cat`.*,
(SELECT COUNT(*) FROM `fo_files` WHERE `fo_cat`.`id` = `fo_files`.`rid` AND `moder` = '0') AS c,
(SELECT COUNT(*) FROM `fo_files` WHERE `fo_cat`.`id` = `fo_files`.`rid`
AND `fo_files`.`time` > '" . (time() - 86400) . "' AND `moder` = '0') AS a FROM `fo_cat` ORDER BY `fo_cat`.`id` ASC {$n->limit}");
if ($look != FALSE) {
$i = 0;
while($a = mysql_fetch_assoc($view)) {
$new_file = (!empty($a['a'])) ? '<span style="color: #FF0000;">+' . $a['a'] . '</span>' : '';
echo ($i ++ % 2) ? $div_tworazdel : $div_razdel;
echo '<img src="../ico/dir.gif" alt=""/> <a href="view.php?r='.$a['id'].'">' . $a['title'] . '</a> (' . $a['c'] . ') ' . $new_file . $div_end;
}
echo $n->navi();
} else {
echo 'Разделы не созданы!<br/>';
}
$NumModers = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `level` = '1'"), 0);
echo '<a href="../faq.php?do=moders_z">Модераторы</a> (' . $NumModers . ')';
echo $div_end;
include '../foot.php';
?>