File size: 1.92Kb
<?php
session_start();
include "file/db.php";
include "file/config.php";
include "file/aut.php";
include "style/".$autorize['skin']."/head.php";
echo "</center><div class='menu'><center>Смайлы</center></div><div class='tab'>";
$smile_arr=scandir('smile');
$smile_arr[1]=natsort($smile_arr);
$fr=array();
foreach($smile_arr as $key => $value)
{
if(preg_match("/[gif]+$/",$value))array_push($fr,$value);
}
if(empty($_GET['page']))$_GET['page']=1;$page=$_GET['page'];
$num = $autorize['kol_smile'];
$all=sizeof($fr);
$num_pages=ceil($all/$num);
if($page<1)$page=1;
if($page>$num_pages)$page=$num_pages;
$start = (($page -1)*$num);
$end = ($page*$num);
if($all){
for($i=$start; $i<$end; $i++)
{
if(empty($fr[$i]))continue;
print '<div class="hr"></div>'.'<input size="2" value=":'.($i+1).':" class="main"/>'.'<img src="smile/'.$fr[$i].'" alt="smile"/><br/>';
}
print '<div class="str">Стр:';
for($pr='', $i=1; $i<=$num_pages; $i++)
{
echo $pr=(($i==1 || $i==$num_pages || abs($i-$page)<2) ? ($i==$page ? " <b>$i</b> " : ' <a href="'. $_SERVER['SCRIPT_NAME']
.'?page='.$i.'?'.session_name()."=".session_id().'/">'.$i.'</a> ') : (($pr == ' ... ' || $pr == '')? '' : ' ... '));
}
print "</div>";
echo "<img src=\"style/".$autorize['skin']."/home.png\" alt=\"*\"/>";
echo "<a href=\"news.php?".session_name()."=".session_id()."\">К Новостям</a> | ";
echo "<a href=\"chat.php?".session_name()."=".session_id()."\">В Чат</a> | ";
echo "<a href=\"enter.php?".session_name()."=".session_id()."\">Панель</a><div class='hr'></div>";
}
else
{
print 'Смайлов нет !!!<br/>';
echo "<img src=\"style/".$autorize['skin']."/home.png\" alt=\"*\"/>";echo "<a href=\"enter.php?".session_name()."=".session_id()."\">Панель</a><div class='hr'></div>";
}
print "</div>";
include "style/".$autorize['skin']."/foot2.php";
?>