Файл: index.php
Строк: 34
<?php
/**
* Author: Elime;
* ICQ: 618878;
* E-mail: elime4@gmail.com;
*/
require 'system/core.php';
/* Считаем видеозаписи */
$count2 = $db->result("SELECT COUNT(*) FROM `data`");
/* Запрашиваем 5 последних видео */
$query2 = $db->query("SELECT * FROM `data` ORDER BY `id` DESC LIMIT 5");
/* Если есть файлы */
if($count2 > 0)
{
$array2 = array();
while($result2 = $db->fetch($query2))
{
$result2['name'] = out($result2['name']);
$result2['mini_scr'] = out($result2['mini_scr']);
$array2[] = $result2;
}
$data['result2'] = $array2;
}
//Скачиваемые
$dquery = $db->query("SELECT * FROM `data` WHERE `like` > 50 ORDER BY RAND() LIMIT 5");
$darray = array();
while($dresult = $db->fetch($dquery))
{
$dresult['name'] = out($dresult['name']);
$dresult['mini_scr'] = out($dresult['mini_scr']);
$darray[] = $dresult;
}
$data['dresult'] = $darray;
/* Выводим категории */
$count = $db->result("SELECT COUNT(*) FROM `categories`");
$query = $db->query("SELECT `id`,`name`,`translit`,`about`,`count` FROM `categories` ORDER BY `name`");
if($count > 0)
{
$array = array();
while($result = $db->fetch($query))
{
$result['name'] = out($result['name']);
$result['translit'] = out($result['translit']);
$array[] = $result;
}
$data['result'] = $array;
}
/* Выводим страницу */
$data['title'] = $config['index_title'];
$data['description'] = $config['description_index'];
$data['keywords'] = $config['keywords_index'];
$data['count'] = $count;
$data['count2'] = $count2;
$tpl->display('index', $data);
?>