Файл: all/smile.php
Строк: 14
<?
include '../system/sys.php';
include '../system/funcs.php';
if (!isset ($us)) {
header ('location: /');
exit;
}
if (!isset ($_GET['id'])) {
header ('location: /');
exit;
}
$query = DB :: $dbs -> query ("SELECT * FROM `smiles_r` WHERE (`id`=?)", array (intval ($_GET['id'])));
if ($query -> rowCount () == 0) {
header ('location: /');
exit;
}
$r = $query -> fetch ();
H ('Смайлы', '<a href="/all/smiles_r.php" style="color:white;">Категории</a> | ' . $r['name']);
if (DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `smile` WHERE (`id_r`='" . $r['id'] . "')") != 0) {
$query = DB :: $dbs -> query ("SELECT * FROM `smile` WHERE (`id_r`='" . $r['id'] . "') ORDER BY `id`");
while ($smile = $query -> fetch ()) {
echo '<div class="lst">';
echo $smile['name'] . ' - <img src="/design/smiles/' . $smile['filename'] . '" alt=""/>';
echo '</div>';
}
}
else {
echo '<div class="list1">Смайлов нет!</div>';
}
F ();
?>