View file engine/includes/head.php

File size: 3.15Kb
<?php


   /**
	* Определение темы.
	* Сначала проверяем печеньки, если нет таких печенек, берем пользовательское или системное
	*/


	if (stristr($_SERVER['HTTP_USER_AGENT'], 'msie') && stristr($_SERVER['HTTP_USER_AGENT'], 'windows'))
	{
		header('Content-type: text/html; charset=UTF-8');
	}
?>

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title><?=$set['title']?></title>
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style/themes/<?=$show_theme?>/style.css" type="text/css" />
<meta name="Document-state" content="Dynamic"/>
<meta name="viewport" content="width=device-width; initial-scale=1"> 
<meta name="author" content="secwind.ru"/>
<meta name="copyright" content="SecWind"/>
<meta name="generator" content="SecWind"/>
<?php

    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
        {
            $get_title = parse_ini_file(H.'engine/files/data/settings.ini');
            $meta_tags = $sql->query("SELECT * FROM `meta_tags` WHERE `title`='" . $get_title['title'] . "';")->fetch();
        }
    }

    if (!empty($meta_tags))
    {
        echo PHP_EOL . '<meta name="meta_keywords" content="' . $meta_tags['keywords'] . '" />';
        echo PHP_EOL . '<meta name="meta_description" content="' . $meta_tags['description'] . '" />';
    }
    
	// Обратите внимание - данные не фильтруются, значения массива заранее должны филтроваться
	foreach($meta_og as $key => $value)
	{
		echo '<meta property="og:'.$key.'" content="'.$value.'" />';
	}
?>
</head>
<body>

<?php
if (file_exists(H.'style/themes/'.$show_theme.'/head.php'))
{
	include_once H.'style/themes/'.$show_theme.'/head.php';
}
else
{
	echo  '<div class="title"> ' .$set['title'] . '</div><div class="aut"> ';
    if ($user_id)
    {
        $count_mail = $sql->query('SELECT COUNT(*) FROM `mail` WHERE `no` = "0" AND `user` = "' . $user['id'] . '"')->result();
       // if ($count_mail > 0)
        echo '<a href="/pages/mail.php">Почта '. $count_mail . '</a> | ';
        echo '<a href="/pages/menu.php">Кабинет</a> | <a href="/login.php?exit">Выход</a>';
    }
    else
    {
        echo '<a href="/login.php">Войти на сайт</a>';
    }
    
	echo '</div><div class="body">';
}

	$sql->query('SELECT `name`, `link`, `img`, `new_line` FROM `ads` WHERE `pos` = "top" AND `time` > '.$time.' AND `main` = "'. (int) MAIN.'"');
	while($ads = $sql->fetch())
	{
		if (!empty($ads['img']))
		{
			if (!empty($ads['new_line']))
			{
				echo '<br />';
			}
			?>
			<a href="<?=$ads['link']?>"><img src="<?=$ads['img']?>" alt="" title="<?=$ads['name']?>"/></a>
			<?php
		}
		else
		{
			?>
			<div class="rekl"><a href="<?=$ads['link']?>"><?=$ads['name']?></a></div>
			<?php
		}
	}
	$sql->free();