Файл: modules/pages/smiles_cat.php
Строк: 43
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
#############____ Категории смайлов ____#############
if(isset($_GET['id']) && $db->query("SELECT * FROM `smiles` WHERE `id` = '".abs(intval($_GET['id']))."' AND `type` = '0'")->rowCount() != 0)
{
$locate = 'in_faq';
$title = _t('smiles');
include_header($title);
Template::div('title', _t($db->query("SELECT name FROM `smiles` WHERE `id` = '".abs(intval($_GET['id']))."'")->fetchColumn()) .' - '. _t('smiles'));
$smiles_cat = $db->query("SELECT * FROM `smiles` WHERE `cat` = '".abs(intval($_GET['id']))."' AND `type` = '1'")->rowCount();
$pages = new Paginator($smiles_cat, $ames);
if($smiles_cat == 0)
{
Template::div('menu', _t('smiles_no'));
}
else
{
echo '<div class="menu"><style type="text/css">
td {
border: 1px solid #eee;
width: 60%;
}
</style>
<table>';
$cat = $db->query("SELECT * FROM `smiles` WHERE `cat` = '".abs(intval($_GET['id']))."' AND `type` = '1' ORDER BY id ASC LIMIT $start, $ames");
foreach($cat as $cats)
{
echo '
<tr>
<td>
'.$cats['smile'].'
</td>
<td>
<img src="/files/smiles/'.$cats['id'].'.'.$cats['ext'].'" alt="." /> <br/></td>
</tr>';
}
echo '</table></div>';
$pages->view();
}
Template::div('block', img('smiley-smile.png').' <a href="/pages/smiles">'. _t('smiles') .'</a><br/>'.NAV .'<a href="/pages/faq">'. _t('faq').'</a></br/>'. HICO .'<a href="/">'. _t('home').'</a>');
include_footer();
exit;
} else { header('Location: /'); exit;}
?>