<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
$set['title']='Смайлы '.$_SERVER['HTTP_HOST'];
include_once '../sys/inc/thead.php';
title();



$set['p_str']="20";
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `smiles_dir`"),0);
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];

if($k_post==0){
	echo '<div class="err">Нет директорий.</div>';
	}

$q=mysql_query("SELECT * FROM `smiles_dir` ORDER BY `pos` ASC LIMIT $start, $set[p_str]");
while($post = mysql_fetch_array($q)){
if($num==1){
echo '<div class="frends">';
$num=0;
}else{
echo '<div class="frends2">';
$num=1;}
$smile = mysql_result(mysql_query("SELECT COUNT(*) FROM `smiles_spis` WHERE `id_dir` = '$post[id]'"),0);
echo '<img src="/images/kaktooz.png" alt="" /> <a href="dir.php?id='.$post['id'].'">'.esc(stripcslashes(htmlspecialchars($post['name']))).'</a> ('.$smile.')<br/>';
echo "</div>";
}

if($k_page>1){str('index.php?',$k_page,$page);}

include_once '../sys/inc/tfoot.php';
?>