Файл: setk/ajax/php/smiles.php
Строк: 33
<?
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';
if (isset($_GET['dir'])) {
$ID = (int) $_GET['dir'];
}
if (isset($ID) && mysql_result(mysql_query("SELECT COUNT(*) FROM `smile_dir` WHERE `id` = '$ID'"),0) == 1) {
$category = mysql_fetch_assoc(mysql_query("SELECT * FROM `smile_dir` WHERE `id` = '$ID' LIMIT 1"));
$ID = $category['id'];
}
?><div style="text-align: right; border-bottom: 1px solid #bcbcbc; padding: 6px;"><a href="#" onclick="smilesOpen('0', '1')">× Закрыть</a></div><?
if (isset($category['id'])) {
$q = mysql_query("SELECT * FROM `smile` WHERE `dir` = '$ID' ORDER BY id DESC ");
?><div><?
while($post = mysql_fetch_array($q)) {
echo '<a href="javascript:tag('', ' ' . $post['smile'] . ' ', '')" onclick="smilesOpen('0', '1')"><img src="/style/smiles/' . $post['id'] . '.gif" title="' . htmlspecialchars($post['smile']) . '" /></a>';
}
?></div><?
}
$q = mysql_query("SELECT * FROM `smile_dir` ORDER BY id ASC");
while ($dir = mysql_fetch_assoc($q)) {
echo ' <a onclick="smilesOpen('' . $dir['id'] . '', '0')" class="onclick">' . htmlspecialchars($dir['name']) . '</a> ';
echo '(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `smile` WHERE `dir` = '$dir[id]'"),0) . ') ';
}
?>