Файл: pages/events/index.php
Строк: 40
<?php
/*
* Журнал событий
* DCMS Special
* Модифицировал densnet
* Файл index.php
*/
require_once '../../sys/inc/start.php';
require_once '../../sys/inc/compress.php';
require_once '../../sys/inc/sess.php';
require_once '../../sys/inc/settings.php';
require_once '../../sys/inc/db_connect.php';
require_once '../../sys/inc/ipua.php';
require_once '../../sys/inc/fnc.php';
require_once '../../sys/inc/user.php';
$set['title'] = 'Журнал событий';
require_once '../../sys/inc/thead.php';
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `events`"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
if ($k_post == 0) {
echo "<table class = 'razd'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет событий";
echo "</td></tr></table>";
} else {
if (isset($user)) {
echo "<div class = 'tabs t_bar clear_fix'>";
echo "<a href = '?page=$page&sort=1' class = '" . ($user['sort'] == 1 ? 'active' : null) . "'>Все</a>";
echo "<a href = '?page=$page&sort=0' class = '" . ($user['sort'] == 0 ? 'active' : null) . "'>Последние</a>";
echo "</div>";
}
}
$q = mysql_query("SELECT * FROM `events` ORDER BY id $sort LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q)) {
echo "<div class = 'razd'>";
echo "<img src = '/style/icons/bullet_feed.png' /> " . output_text($post['msg']) . "<br />";
echo "<img src = '/style/icons/time_mini.png' /> " . vremja($post['time']) . "";
echo "</div>";
}
if ($k_page > 1) {
str('?', $k_page, $page);
}
require_once '../../sys/inc/tfoot.php';