Файл: anifun.ru/top.php
Строк: 196
<?
############################################
## By Holopsicon
## https://psgame.net
############################################
include_once("files/dop.php");
$act = html($_GET['act']);
switch($act){
default:
?>
<table class="block" cellpadding="0" cellspacing="0">
<td><a style="margin: 0 10px 0 0;" class="create" href="/top/">По просмотрам</a></td>
<td><a class="create" href="/top/likes/">По лайкам</a></td>
</table>
<?
# Просмотры
$num = 9;
$page = $_GET['page'];
$result = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM `anime` ");
$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` ORDER by `views` DESC LIMIT $start,$num");
while($array = $res -> fetch()) {
?>
<div class="block_video">
<div class="video">
<a href="/episode/<?=$array['id']?>">
<img src="/preview/<?=$array['preview']?>">
<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=/top/><strong>В начало</strong></a>';
if ($page != $total) $nextpage = '<a href=/top/' .$total. '/><strong>В конец</strong></a>';
if($page - 2 > 0) $page2left = '<a href=/top/'. ($page - 2) .'/><strong>'. ($page - 2) .'</strong></a>';
if($page - 1 > 0) $page1left = '<a href=/top/'. ($page - 1) .'/><strong>'. ($page - 1) .'</strong></a>';
if($page + 2 <= $total) $page2right = '<a href=/top/'. ($page + 2) .'/><strong>'. ($page + 2) .'</strong></a>';
if($page + 1 <= $total) $page1right = '<a href=/top/'. ($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><?
}
break;
case 'likes':
?>
<table class="block" cellpadding="0" cellspacing="0">
<td><a style="margin: 0 10px 0 0;" class="create" href="/top/">По просмотрам</a></td>
<td><a class="create" href="/top/likes/">По лайкам</a></td>
</table>
<?
# Лайки
$num = 9;
$page = $_GET['page'];
$result = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM `anime` ");
$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`,`likes` FROM `anime` ORDER by `likes` DESC LIMIT $start,$num");
while($array = $res -> fetch()) {
?>
<div class="block_video">
<div class="video">
<a href="/episode/<?=$array['id']?>">
<img src="/preview/<?=$array['preview']?>">
<b><?=$array['name']?></b>
</a>
<div class="video_rat"><span style="font-size: 15px; margin: 1px 6px 0 0;" class="material-icons">favorite</span> <?=$array['likes']?></div>
</div>
</div>
<?
}
?></div><?
###вывод страниц
if ($page != 1) $pervpage = '<a href=/top/likes/><strong>В начало</strong></a>';
if ($page != $total) $nextpage = '<a href=/top/likes/' .$total. '/><strong>В конец</strong></a>';
if($page - 2 > 0) $page2left = '<a href=/top/likes/'. ($page - 2) .'/><strong>'. ($page - 2) .'</strong></a>';
if($page - 1 > 0) $page1left = '<a href=/top/likes/'. ($page - 1) .'/><strong>'. ($page - 1) .'</strong></a>';
if($page + 2 <= $total) $page2right = '<a href=/top/likes/'. ($page + 2) .'/><strong>'. ($page + 2) .'</strong></a>';
if($page + 1 <= $total) $page1right = '<a href=/top/likes/'. ($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><?
}
break;
case 'hentai':
?>
<table class="block" cellpadding="0" cellspacing="0">
<td><a style="margin: 0 10px 0 0;" class="create" href="/top/hentai/">По просмотрам</a></td>
<td><a class="create" href="/top/hentai_likes/">По лайкам</a></td>
</table>
<?
# Просмотры
$num = 9;
$page = $_GET['page'];
$result = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM `hentai` ");
$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` ORDER by `views` DESC LIMIT $start,$num");
while($array = $res -> fetch()) {
?>
<div class="block_video">
<div class="video">
<a href="/xepisode/<?=$array['id']?>">
<img src="/preview/hentai/<?=$array['preview']?>">
<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=/top/hentai/><strong>В начало</strong></a>';
if ($page != $total) $nextpage = '<a href=/top/hentai/' .$total. '/><strong>В конец</strong></a>';
if($page - 2 > 0) $page2left = '<a href=/top/hentai/'. ($page - 2) .'/><strong>'. ($page - 2) .'</strong></a>';
if($page - 1 > 0) $page1left = '<a href=/top/hentai/'. ($page - 1) .'/><strong>'. ($page - 1) .'</strong></a>';
if($page + 2 <= $total) $page2right = '<a href=/top/hentai/'. ($page + 2) .'/><strong>'. ($page + 2) .'</strong></a>';
if($page + 1 <= $total) $page1right = '<a href=/top/hentai/'. ($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><?
}
break;
case 'hentai_likes':
?>
<table class="block" cellpadding="0" cellspacing="0">
<td><a style="margin: 0 10px 0 0;" class="create" href="/top/hentai/">По просмотрам</a></td>
<td><a class="create" href="/top/hentai_likes/">По лайкам</a></td>
</table>
<?
# Лайки
$num = 9;
$page = $_GET['page'];
$result = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM `hentai` ");
$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`,`likes` FROM `hentai` ORDER by `likes` DESC LIMIT $start,$num");
while($array = $res -> fetch()) {
?>
<div class="block_video">
<div class="video">
<a href="/xepisode/<?=$array['id']?>">
<img src="/preview/hentai/<?=$array['preview']?>">
<b><?=$array['name']?></b>
</a>
<div class="video_rat"><span style="font-size: 15px; margin: 1px 6px 0 0;" class="material-icons">favorite</span> <?=$array['likes']?></div>
</div>
</div>
<?
}
?></div><?
###вывод страниц
if ($page != 1) $pervpage = '<a href=/top/hentai_likes/><strong>В начало</strong></a>';
if ($page != $total) $nextpage = '<a href=/top/hentai_likes/' .$total. '/><strong>В конец</strong></a>';
if($page - 2 > 0) $page2left = '<a href=/top/hentai_likes/'. ($page - 2) .'/><strong>'. ($page - 2) .'</strong></a>';
if($page - 1 > 0) $page1left = '<a href=/top/hentai_likes/'. ($page - 1) .'/><strong>'. ($page - 1) .'</strong></a>';
if($page + 2 <= $total) $page2right = '<a href=/top/hentai_likes/'. ($page + 2) .'/><strong>'. ($page + 2) .'</strong></a>';
if($page + 1 <= $total) $page1right = '<a href=/top/hentai_likes/'. ($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><?
}
break;
}
include_once("files/d_one.php");
?>