<?php
define('PROTECTOR', 1);

$textl='Справка по смайлам';
include('../files/db.php');
include('../files/auth.php');
include('../files/func.php');
include('../files/core.php');
include('../files/head.php');
include('../files/zag.php');

$dir = opendir ("pic/smiles");
while ($file = readdir ($dir)) 
{ if (ereg (".gif$", "$file"))

closedir ($dir); 
sort($a);

$total = count($a); 
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){ 

$smkod=str_replace(".gif","",$a[$i]);

echo '<img src="pic/smiles/'.$a[$i].'" alt="">'; 
echo '- :'.$smkod.'<br>';
}


$a=count($a);
$ba=ceil($a/10);
$ba2=floor(($a-1)/10)*10;

echo'<br/>Страницы:';

?>