Файл: public_html/cl_journal.php
Строк: 45
<?php
include './system/common.php';
include './system/functions.php';
include './system/user.php';
$title = 'Клановый журнал';
include './system/h.php';
echo '<div style="font-family:Comic Sans MS, Arial;font-size: 13px;">';
echo '<div class=wrapper>'.$title.'</div><div class=hr></div>';
$max = 9;
$count = mysql_result(mysql_query('SELECT COUNT(*) FROM `clan_journal` WHERE `clan` = "'.$clan['id'].''),0);
$pages = ceil($count/$max);
$page = _string(_num($_GET['page']));
if($page > $pages) {$page = $pages;}
if($page < 1) {
$page = 1;}
$start = $page * $max - $max;
if($count == '0') { echo "<font color='#909090'>Журнал чист</font>";}else{
$viso = mysql_num_rows(mysql_query("SELECT text FROM clan_journal WHERE clan = ".$clan['id'].""));
$puslap = floor($viso/10);
mysql_query('update `clan_journal` set `new`="0" where `clan`="'.$clan['id'].'"');
$q = mysql_query("SELECT * FROM `clan_journal` WHERE `clan` = '".$clan['id']."' ORDER BY `time` DESC LIMIT $start, $max");
while($dsa = mysql_fetch_array($q)){
echo '<div class="wrapper">';
echo ''.$dsa['text'].' в <span class=vmz bold>'.date('d.m').' ['._times(time() - $dsa['time']).'] </span>';
echo '</div><div class="hr"></div>';
}
}
echo '</div>';
echo '<a class="wrapper" href="?clear">Очистить журнал</a>';
echo '<div class="hr"></div>';
//Очистка
if(isset($_GET[clear])){
mysql_query("DELETE FROM `clan_journal` WHERE `clan` = '".$user['clan']."'");
$_SESSION['not']="Журнал клана успешно почищена";
header("location:?");
}
# page
str('?',$k_page,$page); // Вывод страниц
include './system/f.php';
?>