<?php
require_once('system/func.php');
auth(); // Закроем от не авторизованных
$title = 'Клановый журнал';
require_once('system/header.php');
$clan = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '" . $user['id_clan'] . "'"));

$set['p_str'] = 10;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `clan_journal` WHERE `clan` = '$clan[id]'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
$q = mysql_query("SELECT * FROM `clan_journal` WHERE `clan` = '$clan[id]' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)) {
    echo div('text_p1');
    echo " $post[text] <span style='float:right;'> " . color('lime') . " " . tl(time() - $post['time']) . " </span></font> <br>";
    echo "</div>";
}
if ($k_post > 10) {
    echo "<div class='header'>";
    str('?', $k_page, $page); // Вывод страниц
    echo "</div>";
}

include 'system/footer.php';
