Файл: setk/plugins/notes/index.php
Строк: 76
<?
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
/* Бан пользователя */
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `razdel` = 'notes' AND `id_user` = '$user[id]' AND (`time` > '$time' OR `view` = '0' OR `navsegda` = '1')"), 0)!=0)
{
header('Location: /ban.php?'.SID);exit;
}
$set['title']='Дневники';
include_once '../../sys/inc/thead.php';
title();
echo "<div class='hide'>";
echo "Дневники</a>";
echo "</div>";
echo "<div class='hide'><form method="post" action="search.php?go">";
echo "<input type="text" name="usearch" maxlength="16" value="" placeholder='Введите пару слов для поиска...' style='width: 70%;' />n";
echo "<input type="submit" value="Искать" />";
echo "</form></div>n";
if (isset($_GET['go']))
echo "<div id='comments' class='menus'>";
if (isset($user)){
echo '<div class="block"><img src="/iconc/diaries.png"><a href="add.php"> Написать в дневник</a></div>';
}
if (isset($_GET['sort']) && $_GET['sort'] =='t')$order='order by `time` desc';
elseif (isset($_GET['sort']) && $_GET['sort'] =='c') $order='order by `count` desc';
else $order='order by `time` desc';
if (isset($_GET['sort']) && $_GET['sort'] =='t'){
echo'<div class="b_switcher" style="padding-bottom:0px;">
<table width="100%"><tr><td>
<span class="active_item">Новые</span>
</td><td>
<a href="?sort=c">Популярные</a></td></tr>
</table></div>';
}elseif (isset($_GET['sort']) && $_GET['sort'] =='c'){
echo'
<div class="b_switcher" style="padding-bottom:0px;">
<table width="100%"><tbody><tr><td><a href="?sort=t">Новые</a>
</td><td><span class="active_item">Популярные</span>
</td></tr></tbody></table></div>';
}else{
echo'<div class="b_switcher" style="padding-bottom:0px;">
<table width="100%"><tr><td>
<span class="active_item">Новые</span>
</td><td>
<a href="?sort=c">Популярные</a></td></tr>
</table>';
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes` "),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 `notes` $order LIMIT $start, $set[p_str]");
echo "<table class='post'>n";
if ($k_post==0)
{
echo " <div class='block'>n";
echo "Нет дневниковn";
echo "</div>n";
}
while ($post = mysql_fetch_assoc($q))
{
echo "<a class='touch_white' href='list.php?id=$post[id]'>";
echo htmlspecialchars($post['name'])."";
echo " <span class='color' style='float: right;'>".vremja($post['time'])."</span></a>n";
echo " </div>n";
}
echo "</table>n";
if (isset($_GET['sort'])) $dop="sort=$_GET[sort]&";
else $dop='';
if ($k_page>1)str('?'.$dop.'',$k_page,$page); // Вывод страниц
include_once '../../sys/inc/tfoot.php';
?>