Вход Регистрация
Файл: includes/style.php
Строк: 252
<?
header
('Cache-Control: no-store, no-cache, must-revalidate');

// Определение версии
if (isset($_GET['ver']))$_SESSION['ver'] = check($_GET['ver']);

if (isset(
$user))$ver check($user['ver']);
else if (isset(
$_SESSION['ver'])) $ver check($_SESSION['ver']);
else if (isset(
$_GET['ver'])) $ver check($_GET['ver']);

if (empty(
$ver)) $ver 'xhtml';

// Шрифт :)
if(isset($user['id'])){
if(
$user['fsize'] == 'small') {$fs1 '<small>';$fs2 '</small>';}
else if(
$user['fsize'] == 'big') {$fs1 '<big>';$fs2 '</big>';}
else {
$fs1 '';$fs2 '';}
}
// Стиль
if (isset($user['style'])) $them $user['style'];
else if (isset(
$set['style'])) $them $set['style'];
else 
$them 'go-wap';


ob_start();
// Основные дивы
if ($ver!='wml'){
define('hdrs','<div class="hdrs">');
define('gb','<div class="gb">');
define('gbinroom','<div class="gbinroom">');
define('links','<div class="links">');
define('menu','<div class="menu">');
define('footer','<div class="footer">');
define('citata','<div class="citata">');
define('copyr','<div class="copy">');

define('div','</div>');
}else{
define('copyr',''); define('citata','');
define('footer','');
define('hdrs','');
define('gb','');
define('gbinroom','');
define('links','');
define('menu','');

define('div','<br />');

}


// Собственно верх
function head ()
{

global 
$db,  $them$title$set$align$ver$user$_GET$head$fs1$fs2$_SERVER;
if (empty(
$head)) $head $title;
$title $set['name'].'|'.$title;
if (
$ver!='wml'){


// Если стиль не WEB if (!isset($user)||$them != 'WEB'){
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Last-Modified: " gmdate("D, d M Y H:i:s") . "GMT");
header("Content-type:text/html; charset=utf-8");
echo 
'<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo 
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<head><meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" />
'
;
echo 
'<link rel="stylesheet" type="text/css" href="/style/'.$them.'.css"/>
<title>'
.$title.'</title>';

if (isset(
$user)){
if (isset(
$_GET['rm']) && $_GET['rm'] != ''||$_SERVER['PHP_SELF']=='/oroom.php'){ $rm intval($_GET['rm']);

if (
$user['avr']==0){ echo "<meta http-equiv="Pragma" content="no-cache"/><meta http-equiv="Content-Type" content="text/htmlcharset=utf-8"/>";
}else{
if (
$_SERVER['PHP_SELF']!='/oroom.php')echo "<META HTTP-EQUIV="Refresh" CONTENT="".$user['avr']."URL=".H."room?rm=$rm&amp;".SID."">";
else echo 
"<META HTTP-EQUIV="Refresh" CONTENT="".$user['avr']."URL=".H."oroom?".SID."">";
}
}else{
echo 
'<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>'
;
}
}else{
echo 
'<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>'
;
}
echo 
'</head><body>';

$r query ("Select * from banners WHERE `v_n` = '2' order by id");
while(
$a = @mysql_fetch_assoc($r)){

if((
$a['gde']==1&&$_SERVER['PHP_SELF']=='/index.php')||($a['gde']==2&&($_SERVER['PHP_SELF']=='/index.php'||$_SERVER['PHP_SELF']=='/enter.php'))||$a['gde']==3){
echo 
'<div align="center">';
if(
$a['tip']==1)echo '<a href="'.$a['link'].'">'.$a['link_name'].'</a><br />';
else if(
$a['tip']==2)echo '<a href="'.$a['link'].'"><img src="'.$a['link_name'].'" alt="Баннер"/></a><br />';
echo 
'</div>';
}
}

$r2 query ("Select * from sbanners WHERE `v_n` = '2' order by id");
while(
$a = @mysql_fetch_assoc($r2)){

if((
$a['gde']==1&&$_SERVER['PHP_SELF']=='/index.php')||($a['gde']==2&&($_SERVER['PHP_SELF']=='/index.php'||$_SERVER['PHP_SELF']=='/enter.php'))||$a['gde']==3){
echo 
'<div align="center">';
if(
$a['tip']==1)echo '<a href="'.$a['link'].'">'.$a['link_name'].'</a><br />';
else if(
$a['tip']==2)echo '<a href="'.$a['link'].'"><img src="'.$a['link_name'].'" alt="Баннер"/></a><br />';
echo 
'</div>';
}
}


if (isset(
$user['id'])){
$pr_n mysql_result(query("select count(*) as num from privat where to_id = '".$user['id']."' and `readin` = '0'"),0);
if (
$pr_n>0)echo menu.'<img src="/img/new.gif" alt="*"/> <b><a href="/my/privat?mod=in">Приватное сообщение('.$pr_n.')</a></b>'.div;
}


echo 
'<div class="hdrs">'.$fs1.$head.$fs2.'</div><div class="main" align="'.$align.'">';



}else{ require_once
'web.php'// Подключаем верх WEB стиля
}


echo 
$fs1;
}else{

header("Content-type: text/vnd.wap.wml; charset=utf-8");
echo 
'
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd"><wml>'
;

if (isset(
$user['id'])){

if (isset(
$_GET['rm']) && $_GET['rm'] != ''||$_SERVER['PHP_SELF']=='/oroom.php'){
$rm intval($_GET['rm']);

if (
$user['avr']!=0){
if (
$_SERVER['PHP_SELF']!='/oroom.php')echo "<card id="chat" title="".$title."" ontimer="".H."room?rm=$rm&amp;".SID.""><timer value="".($user['avr']*10).""/>";
else echo 
"<card id="chat" title="".$title."" ontimer="".H."oroom?".SID.""><timer value="".($user['avr']*10).""/>";
}else echo 
"<card id="chat" title="".$title."">";
}else echo 
"<card id="chat" title="".$title."">";
}else echo 
"<card id="chat" title="".$title."">";



if (isset(
$user)){
$pr_n mysql_result(query("select count(*) as num from privat WHERE to_id = '".$user['id']."' and `readin` = '0'"),0);
if (
$pr_n>0)echo menu.'<img src="/img/new.gif" alt="*"/> <b><a href="/my/privat?mod=in">Приватное сообщение('.$pr_n.')</a></b>'.div;
}

echo 
"<p align="".$align."">";
echo 
$fs1;

$r query ("Select * from banners WHERE `v_n` = '2' order by id");
while(
$a = @mysql_fetch_assoc($r)){

if(
$a['gde']==1)$gde 'Только на главной';
else if(
$a['gde']==2)$gde 'На главной и в Прихожей';
else if(
$a['gde']==3)$gde 'На всех страницах чата';

if((
$a['gde']==1&&$_SERVER['PHP_SELF']=='/index.php')||($a['gde']==2&&($_SERVER['PHP_SELF']=='/index.php'||$_SERVER['PHP_SELF']=='/enter.php'))||$a['gde']==3){
echo 
'<div align="center">';
if(
$a['tip']==1)echo '<a href="'.$a['link'].'">'.$a['link_name'].'</a><br />';
else if(
$a['tip']==2)echo '<a href="'.$a['link'].'"><img src="'.$a['link_name'].'" alt="Баннер"/></a><br />';
echo 
'</div>';
}
}

}

}

// Низ
function foot()
{
global 
$db,  $them,$title,$set,$align,$ver,$user,$_GET,$Content_Encoding,$theme,$ip,$ua,$starttime,$pagesize,$fs2,$copy,$copir,$debag,$sql_time,$queries;

$Contents ob_get_contents();
$gzib_file strlen($Contents);
$gzib_file_out strlen(gzcompress($Contents9));
$gzib_pro round(100 - (100 / ($gzib_file $gzib_file_out)), 1);

$pagesize=round(($gzib_file_out)/1024,1);

$pagesize $pagesize/2;


if (isset(
$user['id']))query ("Update users set alltraf='".($user["alltraf"]+$pagesize)."', lasttraf='".$pagesize."' where id='".$user['id']."'");

// Подключаем низ WEB стиля
if (isset($user) && $ver!='wml' && $them == 'WEB')
{ require_once
'webf.php';
$r query ("Select * from banners WHERE `v_n` = '1' order by id");
while(
$a = @mysql_fetch_assoc($r)){

if((
$a['gde']==1&&$_SERVER['PHP_SELF']=='/index.php')||($a['gde']==2&&($_SERVER['PHP_SELF']=='/index.php'||$_SERVER['PHP_SELF']=='/enter.php'))||$a['gde']==3){

echo 
'<div align="center">';
if(
$a['tip']==1)echo '<a href="'.$a['link'].'">'.$a['link_name'].'</a><br />';
else if(
$a['tip']==2)echo '<a href="'.$a['link'].'"><img src="'.$a['link_name'].'" alt="Баннер"/></a><br />';
echo 
'</div>';
}

}

$r2 query ("Select * from sbanners WHERE `v_n` = '1' order by id");
while(
$a = @mysql_fetch_assoc($r2)){

if((
$a['gde']==1&&$_SERVER['PHP_SELF']=='/index.php')||($a['gde']==2&&($_SERVER['PHP_SELF']=='/index.php'||$_SERVER['PHP_SELF']=='/enter.php'))||$a['gde']==3){

echo 
'<div align="center">';
if(
$a['tip']==1)echo '<a href="'.$a['link'].'">'.$a['link_name'].'</a><br />';
else if(
$a['tip']==2)echo '<a href="'.$a['link'].'"><img src="'.$a['link_name'].'" alt="Баннер"/></a><br />';
echo 
'</div>';
}

}
echo 
$fs2;
if (
$ver!='wml')echo '</div></body></html>';
else echo 
'</p></card></wml>';

}else{
$gen = ($debag->endTimer()/10);
$gen=round($gen4);


$pagesize=round(($gzib_file_out)/1024,1);


if(isset(
$user['id'])&&$user['menu']==1&&$_SERVER['PHP_SELF']!='/index.php'&&$_SERVER['PHP_SELF']!='/enter.php'){
echo 
copyr.'<sub><small><small>[<a href="/my/index">ЛИЧН</a>|<a href="/love/">ЗНАК</a>|<a href="/games">ИГРЫ</a>|<a href="/games/fermer/">ФЕРМЕР</a>|<a href="/groups">ГРУППЫ</a>|<a href="/diaries">БЛОГИ</a>|<a href="/forum/index">ФОРУМ</a>|<a href="/fo/">ОБМЕН</a>';
if (
$user['level']>6)echo '|<a href="/admin/">АДМИН</a>';
echo 
']</small></small></sub>'.div;
}
if(isset(
$user['id'])&&isset($user['id']))echo copyr.'<a href="/report">Сообщить об ошибке</a>'.div;
echo 
copyr.'['.$gzib_pro.' %|'.$pagesize.' Кб<img src="http://top.masteram.us/count.php?226" width="1" height="1" alt="" border="0"/>|'.$gen.' сек<img src="http://c.waplog.net/184075.cnt" width="1" height="1" alt="" border="0"/>]'.div;
//echo '<small><a href="/servis">(c) -=ШАХТЕР=-</a></small>';
//echo '<br />';

$r query ("Select * from banners WHERE `v_n` = '1' order by id");
while(
$a = @mysql_fetch_assoc($r)){

if((
$a['gde']==1&&$_SERVER['PHP_SELF']=='/index.php')||($a['gde']==2&&($_SERVER['PHP_SELF']=='/index.php'||$_SERVER['PHP_SELF']=='/enter.php'))||$a['gde']==3){
echo 
'<div align="center">';
if(
$a['tip']==1)echo '<a href="'.$a['link'].'">'.$a['link_name'].'</a><br />';
else if(
$a['tip']==2)echo '<a href="'.$a['link'].'"><img src="'.$a['link_name'].'" alt="Баннер"/></a><br />';
echo 
'</div>';
}

}

$r2 query ("Select * from sbanners WHERE `v_n` = '1' order by id");
while(
$a = @mysql_fetch_assoc($r2)){

if((
$a['gde']==1&&$_SERVER['PHP_SELF']=='/index.php')||($a['gde']==2&&($_SERVER['PHP_SELF']=='/index.php'||$_SERVER['PHP_SELF']=='/enter.php'))||$a['gde']==3){

echo 
'<div align="center">';
if(
$a['tip']==1)echo '<a href="'.$a['link'].'">'.$a['link_name'].'</a><br />';
else if(
$a['tip']==2)echo '<a href="'.$a['link'].'"><img src="'.$a['link_name'].'" alt="Баннер"/></a><br />';
echo 
'</div>';
}

}
echo 
"Затраченное время: ".$sql_time." сек.<br />nЗапросов к БД: ".$queries;
echo 
$fs2;
if (
$ver!='wml')echo '</div></body></html>';
else echo 
'</p></card></wml>';
}

exit;
ob_end_flush();
}






?>
Онлайн: 1
Реклама