Файл: engine/includes/head.php
Строк: 53
<?php
// Новые сообщения
$count_mail = $user_id ? $sql->query('SELECT COUNT(*) FROM `mail` WHERE `no` = "0" AND `user` = "' . $user['id'] . '"')->result() : 0;
// Мета теги
$head_tags = '
<meta name="Document-state" content="Dynamic"/>
<meta name="author" content="secwind.ru"/>
<meta name="copyright" content="SecWind"/>
<meta name="generator" content="SecWind"/>';
if (empty($meta_tags))
{
$meta_tags = $sql->query("SELECT * FROM `meta_tags` WHERE `title`='" . $set['title'] . "';");
if ($meta_tags->num_rows() > 0){
$meta_tags = $meta_tags->fetch();
}
else{
$meta_tags = $sql->query("SELECT * FROM `meta_tags` WHERE `title`='" . Core::$set['title'] . "';")->fetch();
}
}
if (!empty($meta_tags))
{
$head_tags .= '
<meta name="meta_keywords" content="' . $meta_tags['keywords'] . '" />
<meta name="meta_description" content="' . $meta_tags['description'] . '" />';
}
// Получение Open Graph тегов
foreach ($meta_og as $key => $value){
$head_tags .= '<meta property="og:' . $key . '" content="' . $value . '" />';
}
// Получение рекламных ссылок
$tpl_ads = array();
$sql->query('SELECT `name`, `link`, `img`, `new_line` FROM `ads` WHERE `pos` = "top" AND `time` > ' . $time . ' AND `main` = "' . (int) MAIN . '"');
while ($ads = $sql->fetch())
{
$tpl_ads[] = array(
'new_line' => $ads['new_line'],
'link' => $ads['link'],
'image' => $ads['img'],
'name' => $ads['name'],
);
}
$vars = array();
$vars['set'] = Core::$set;
$vars['lang'] = Core::$language;
$vars['site_name'] = $_SERVER['SERVER_NAME'];
$vars['head_tags'] = $head_tags;
$vars['user'] = $user_id ? $user : array();
$vars['new_messages'] = $count_mail;
$fenom->display('header.tpl', $vars);