Файл: anifun.ru/anime.php
Строк: 78
<?
############################################
## By Holopsicon
## https://psgame.net
############################################
include_once("files/dop.php");
$s = DB::$dbs->queryFetch("SELECT `name`,`id` FROM `anime_cat` WHERE `id` = ? LIMIT 1",array(num($_GET['id'])));
?><div class="title"><?=$s[name]?></div><?
if ($pirat==pirat){
?><table class="block" cellpadding="0" cellspacing="0">
<td><a style="margin: 0 10px 0 0;" class="create" href="/adc.php?mod=ed_cat&id=<?=$_GET['id']?>">Редактировать</a></td>
<td><a class="create" href="/adc.php?mod=cr_anime&id=<?=$_GET['id']?>">Добавить Аниме</a></td>
</table><?
}
$num = 12;
$page = $_GET['page'];
$result = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM `anime` WHERE (`cat1` = ? or `cat2` = ? or `cat3` = ? or `cat4` = ? or `cat5` = ?) ",array(num($_GET['id']),num($_GET['id']),num($_GET['id']),num($_GET['id']),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 `anime` WHERE (`cat1` = ? or `cat2` = ? or `cat3` = ? or `cat4` = ? or `cat5` = ?) ORDER by `id` DESC LIMIT $start,$num",array(num($_GET['id']),num($_GET['id']),num($_GET['id']),num($_GET['id']),num($_GET['id'])));
while($array = $res -> fetch()) {
?><div class="block_video">
<div class="video">
<a href="/episode/<?=$array['id']?>/"><?
$filename = "/var/www/bop217/data/www/anifun.ru/preview/".$array[preview]."";
if (file_exists($filename)) {
?><img src="/preview/<?=$array[preview]?>" title="<?=$array[name]?>"><?
}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=/anime/'.$_GET[id].'/><strong>В начало</strong></a>';
if ($page != $total) $nextpage = '<a href=/anime/'.$_GET[id].'/' .$total. '/><strong>В конец</strong></a>';
if($page - 2 > 0) $page2left = '<a href=/anime/'.$_GET[id].'/'. ($page - 2) .'/><strong>'. ($page - 2) .'</strong></a>';
if($page - 1 > 0) $page1left = '<a href=/anime/'.$_GET[id].'/'. ($page - 1) .'/><strong>'. ($page - 1) .'</strong></a>';
if($page + 2 <= $total) $page2right = '<a href=/anime/'.$_GET[id].'/'. ($page + 2) .'/><strong>'. ($page + 2) .'</strong></a>';
if($page + 1 <= $total) $page1right = '<a href=/anime/'.$_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");
?>