Файл: themes/wap/index.php
Строк: 97
<?php
if (!defined('BLOG')) { die('Access Denied!'); }
define('ICONS','/themes/wap/icons/');
define('SMILES_ROWS',2);
# Валидный xHTML
function valid_xhtml($str) {
//$str = str_replace(' />', '>', $str);
//$str = str_replace('"/>', '">', $str);
//$str = str_replace('class="downlist2"', 'class="main"', $str);
return $str;
}
/**
* Шапка страницы
* @param string $title
* @param string $desc
* @param string $header
*/
function show_header($title = '', $keys = '', $desc = '', $header = 'Y') {
global $db, $config, $categories;
header('Content-Type: text/html; charset=utf-8');
$title = StripMeta($title);
$keys = !empty($keys) ? $keys : $config['site_keys'];
$desc = !empty($desc) ? $desc : $config['site_desc'];
echo "n" . '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">';
echo "n" . '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">';
echo "n" . "<head><meta http-equiv='content-type' content='application/xhtml+xml; charset=utf-8'/><meta name='yandex-verification' content='6f1f0d9df9f2f5b3' />
";
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru" dir="ltr">
<head>
<title>' . $title . '</title>
<meta name="keywords" content="' . $keys . '" />
<meta name="description" content="' . $desc . '" />
<style type="text/css">' . file_get_contents(dirname(__FILE__) . '/style.css') . '</style>
' . ($config['allow_rss'] == 1 ? '<link rel="alternate" type="application/rss+xml" title="' . $config['rss_title'] . '" href="/rss.xml" />' : '') . '
</head><body>';
echo '<center><div class="logo"><a href="/index.html"><img src="/themes/wap/images/logo.png" alt="" /></a></center></div>';
//ob_start('valid_html');
if ($config['show_ads'] == 1 && !defined('IS_ADMINKA')) {
$ads = $db->select("SELECT * FROM ?_ads WHERE (`time` - UNIX_TIMESTAMP()) > 0 ORDER BY rand() LIMIT 0," . $config['ads_num']);
if (!empty($ads)) {
foreach( $ads as $ad ) echo '<div class="ads"><img src="' . ICONS . 'site.png" align="left" alt="" /> <a href="http://' . $ad['url'] . '">' . $ad['name'] . '</a></div>';
}
}
if (!empty($_SESSION['core_message'][0][0]) && !empty($_SESSION['core_message'][0][1])) {
echo '<div class="message_' . $_SESSION['core_message'][0][0] . '">' . $_SESSION['core_message'][0][1] . '</div>';
unset($_SESSION['core_message']);
}
//echo '<div class="kab">' . $config['site_name'] . '</div>';
if (!empty($header) && $header != 'N') {
switch($header):
case 'Y':
echo '<div class="razdel">' . $title . '</div>';
break;
default:
echo '<div class="razdel">' . $header . '</div>';
break;
endswitch;
}
if (defined('IS_INDEX')) {
echo loadTemplate( 'header_index' );
}
else {
echo loadTemplate( 'header' );
}
}
# Ноги
function show_footer() {
global $db, $mts, $config, $count_posts;
if (!defined('IS_ADMINKA')) {
echo '<div class="banners">';
if (defined('IS_INDEX')) {
echo loadTemplate( 'footer_index' );
}
else {
echo loadTemplate( 'footer' );
}
echo '</div>';
}
echo '<center><div class="copy"><a href="index.xhtml#">' . $config['site_copy'] . '</center></a></div>';
//echo '<div class="version">Версия: ' . show_version() . '</div>';
echo '<center><div class="version">' . ChangeSkin('Дизaйн:') . '</center></div>';
echo '</body></html>';
//ob_end_flush();
exit;
}
?>