Просмотр файла engine/includes/head.php

Размер файла: 3.15Kb
  1. <?php
  2.  
  3.  
  4. /**
  5. * Определение темы.
  6. * Сначала проверяем печеньки, если нет таких печенек, берем пользовательское или системное
  7. */
  8.  
  9.  
  10. if (stristr($_SERVER['HTTP_USER_AGENT'], 'msie') && stristr($_SERVER['HTTP_USER_AGENT'], 'windows'))
  11. {
  12. header('Content-type: text/html; charset=UTF-8');
  13. }
  14. ?>
  15.  
  16. <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
  17. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
  18. <head>
  19. <title><?=$set['title']?></title>
  20. <link rel="shortcut icon" href="/favicon.ico" />
  21. <link rel="stylesheet" href="/style/themes/<?=$show_theme?>/style.css" type="text/css" />
  22. <meta name="Document-state" content="Dynamic"/>
  23. <meta name="viewport" content="width=device-width; initial-scale=1">
  24. <meta name="author" content="secwind.ru"/>
  25. <meta name="copyright" content="SecWind"/>
  26. <meta name="generator" content="SecWind"/>
  27. <?php
  28.  
  29. if (empty($meta_tags))
  30. {
  31. $meta_tags = $sql->query("SELECT * FROM `meta_tags` WHERE `title`='" . $set['title'] . "';");
  32. if ($meta_tags->num_rows() > 0)
  33. {
  34. $meta_tags = $meta_tags->fetch();
  35. }
  36. else
  37. {
  38. $get_title = parse_ini_file(H.'engine/files/data/settings.ini');
  39. $meta_tags = $sql->query("SELECT * FROM `meta_tags` WHERE `title`='" . $get_title['title'] . "';")->fetch();
  40. }
  41. }
  42.  
  43. if (!empty($meta_tags))
  44. {
  45. echo PHP_EOL . '<meta name="meta_keywords" content="' . $meta_tags['keywords'] . '" />';
  46. echo PHP_EOL . '<meta name="meta_description" content="' . $meta_tags['description'] . '" />';
  47. }
  48. // Обратите внимание - данные не фильтруются, значения массива заранее должны филтроваться
  49. foreach($meta_og as $key => $value)
  50. {
  51. echo '<meta property="og:'.$key.'" content="'.$value.'" />';
  52. }
  53. ?>
  54. </head>
  55. <body>
  56.  
  57. <?php
  58. if (file_exists(H.'style/themes/'.$show_theme.'/head.php'))
  59. {
  60. include_once H.'style/themes/'.$show_theme.'/head.php';
  61. }
  62. else
  63. {
  64. echo '<div class="title"> ' .$set['title'] . '</div><div class="aut"> ';
  65. if ($user_id)
  66. {
  67. $count_mail = $sql->query('SELECT COUNT(*) FROM `mail` WHERE `no` = "0" AND `user` = "' . $user['id'] . '"')->result();
  68. // if ($count_mail > 0)
  69. echo '<a href="/pages/mail.php">Почта '. $count_mail . '</a> | ';
  70. echo '<a href="/pages/menu.php">Кабинет</a> | <a href="/login.php?exit">Выход</a>';
  71. }
  72. else
  73. {
  74. echo '<a href="/login.php">Войти на сайт</a>';
  75. }
  76. echo '</div><div class="body">';
  77. }
  78.  
  79. $sql->query('SELECT `name`, `link`, `img`, `new_line` FROM `ads` WHERE `pos` = "top" AND `time` > '.$time.' AND `main` = "'. (int) MAIN.'"');
  80. while($ads = $sql->fetch())
  81. {
  82. if (!empty($ads['img']))
  83. {
  84. if (!empty($ads['new_line']))
  85. {
  86. echo '<br />';
  87. }
  88. ?>
  89. <a href="<?=$ads['link']?>"><img src="<?=$ads['img']?>" alt="" title="<?=$ads['name']?>"/></a>
  90. <?php
  91. }
  92. else
  93. {
  94. ?>
  95. <div class="rekl"><a href="<?=$ads['link']?>"><?=$ads['name']?></a></div>
  96. <?php
  97. }
  98. }
  99. $sql->free();