Файл: page/section.php
Строк: 24
<?php
require_once "../sys/func.php";
$id = filter(intval($_GET['id']));
$ss = mysql_query("SELECT * FROM `category` WHERE `id`='$id' ");
if (mysql_num_rows($ss) == 0) {
$title = "Ошибка";
require_once "../sys/head.php";
echo err('Нет такой категорий');
require_once "../sys/foot.php";
exit;
}
if (isset($_GET['like'])) like($_GET['like']);
$a = mysql_fetch_array($ss);
$title = $a['name'];
require_once "../sys/head.php";
$c_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `data_status` WHERE `category`='$id'"), 0);
$k_page = k_page($c_p, $onpage);
$page = page($k_page);
$start = $onpage*$page-$onpage;
if ($c_p == 0) echo err('На этой категории нет статусов!');
$s = mysql_query("SELECT * FROM `data_status` WHERE `category`='$id' ORDER BY `id` DESC LIMIT $start, $onpage");
while ($a = mysql_fetch_array($s)) {
echo '
<div class="menu">'.$a['text'].'</div>
<div class="share">
<a href="section.php?id='.$id.'&like='.$a['id'].'"><img src="/images/like.png" alt="like"></a> '.countLike($a['id']).'
<a href="/page/copy.php?id='.$a['id'].'"><img src="/images/copy.png" alt="Copy"></a>
'.share($urlsite.'/section.php?id='.$id, $a['text']).'
</div>';
}
if ($k_page > 1) {
echo '<div class="c"><center>';
str('section.php?id='.$id.'&', $k_page, $page);
echo '</center></div>';
}
echo '<div class="c"><a href="category.php"><img src="/images/arr_b.png" /> Назад</a></div>';
require_once "../sys/foot.php";
?>