Файл: anifun.ru/xanime.php
Строк: 71
<?
############################################
## By Holopsicon
## https://psgame.net
############################################
include_once("files/dop.php");
$s = DB::$dbs->queryFetch("SELECT `name`,`id` FROM `hentai_cat` WHERE `id` = ? LIMIT 1",array(num($_GET['id'])));
?><div class="title"><?=$s[name]?></div><?
if ($pirat==pirat){
echo '<table class="block" cellpadding="0" cellspacing="0">
<td><a style="margin: 0 10px 0 0;" class="create" href="/adc.php?mod=ed_cat_hentai&id='.$_GET['id'].'">Редактировать</a></td>
<td><a class="create" href="/adc.php?mod=xepisode&id='.$_GET['id'].'">Добавить хентай</a></td>
</table>';
}
$num = 12;
$page = $_GET['page'];
$result = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM `hentai` WHERE `cat` = ? ",array(num($_GET['id'])));
$posts = $result;
$total = intval(($posts - 1) / $num) + 1;
$page = intval($page);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $num - $num;
if (!empty($result)) {
?><div style="border-radius: 0 0 5px 5px;" class="video_content"><?
$res = DB::$dbs->query("SELECT `name`,`id`,`preview`,`views` FROM `hentai` WHERE `cat` = ? ORDER by `id` DESC LIMIT $start,$num",array(num($_GET['id'])));
while($array = $res -> fetch()) {
?><div class="block_video">
<div class="video">
<a href="/xepisode/<?=$array['id']?>/"><?
$filename = "/var/www/bop217/data/www/anifun.ru/preview/hentai/".$array[preview]."";
if (file_exists($filename)) {
?><img src="/preview/hentai/<?=$array[preview]?>"><?
}else{
?><img src="/style/no_hentai.png"><?
}
?><b><?=$array[name]?></b>
</a>
<div class="video_rat"><span class="material-icons">visibility</span> <?=$array[views]?></div>
</div>
</div>
<?
}
?></div><?
###вывод страниц
if ($page != 1) $pervpage = '<a href=/xanime/'.$_GET[id].'/><strong>В начало</strong></a>';
if ($page != $total) $nextpage = '<a href=/xanime/'.$_GET[id].'/' .$total. '/><strong>В конец</strong></a>';
if($page - 2 > 0) $page2left = '<a href=/xanime/'.$_GET[id].'/'. ($page - 2) .'/><strong>'. ($page - 2) .'</strong></a>';
if($page - 1 > 0) $page1left = '<a href=/xanime/'.$_GET[id].'/'. ($page - 1) .'/><strong>'. ($page - 1) .'</strong></a>';
if($page + 2 <= $total) $page2right = '<a href=/xanime/'.$_GET[id].'/'. ($page + 2) .'/><strong>'. ($page + 2) .'</strong></a>';
if($page + 1 <= $total) $page1right = '<a href=/xanime/'.$_GET[id].'/'. ($page + 1) .'/><strong>'. ($page + 1) .'</strong></a>';
?><div class="block_nav"><?
echo $pervpage.$page1left.'<b>'.$page.'</b>'.$page1right.$nextpage;
?></div><?
}else{
?><div class="no_hentai"><span class="material-icons">error_outline</span> Хентай еще не добавлен</div><?
}
include_once("files/d_one.php");
?>