Просмотр файла templates/header.php

Размер файла: 3.39Kb
<?php
// coding by Felis

error_reporting(0);
if($_SERVER['HTTP_ACCEPT_ENCODING']){
$compress = strtolower($_SERVER['HTTP_ACCEPT_ENCODING']);
}
else{
$compress = strtolower($_SERVER['HTTP_TE']);
}
if(substr_count($compress,'deflate'))
{
function compress_output_deflate($output){
return gzdeflate($output, 5);
}
$method = 'deflate';
header('Content-Encoding: deflate');
ob_start('compress_output_deflate');
ob_implicit_flush(0);
}
elseif(substr_count($compress,'gzip'))
{
function compress_output_gzip($output){
return gzencode($output, 5);
}

$method = 'gzip';
header('Content-Encoding: gzip');
ob_start('compress_output_gzip');
ob_implicit_flush(0);
}
elseif(substr_count($compress,'x-gzip'))
{
function compress_output_x_gzip($output){
$size = strlen($output);
$crc = crc32($output);
$output = gzcompress($output, 5);
$output = substr($output, 0, strlen($output) - 4);
return "\x1f\x8b\x08\x00\x00\x00\x00\x00".$output.pack('V',$crc).pack('V',$size);
}
$method = 'x-gzip';
header('Content-Encoding: x-gzip');
ob_start('compress_output_x_gzip');
ob_implicit_flush(0);
}
function info()
{
global $method;
$contents = ob_get_contents();
$in = strlen($contents);
switch($method){
default:
print 'выкл';
break;
case 'deflate':
$out = strlen(gzdeflate($contents, 5));
print round(100-(100/($in/$out)),1).' %';
break;
case 'gzip':
$out = strlen(gzencode($contents, 5));
print round(100-(100/($in/$out)),1).' %';
break;
case 'x-gzip':
$out = strlen(gzcompress($contents, 5));
print round(100-(100/($in/$out)),1).' %';
break;
}
return;
}
?>
<!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">
<head>
<title><? echo $sitename; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Description" content="Русско-албанский переводчик by Felis">
<meta name="Keywords" content="переводчик, русский, албанский, олбанскей, слова, образование, криветизатор, грамматика, пиздец, падонки">
<style type="text/css">
body {
padding: 1px;
border: 1px solid #454545;
background: #2e2e2e;
font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #afafaf;
}

a:link,
a:visited,
a:active {
font-size: 12px;
background: transparent;
color: #888888;
text-decoration: none;
}

a:hover {
font-size: 12px;
background: transparent;
color: #777777;
text-decoration: underline;
}

.main {
background-color: #afafaf;
text-align: left;
}

.head {
color: #636696;
border-top: 1px solid #454545;
border-bottom: 1px solid #454545;
border-left: 1px solid #454545;
border-right: 1px solid #454545;
background: #272727 url(images/bg_header.gif);
padding: 5px;
}

.cont {
border: 1px solid #454545;
background-color: #303030;
padding: 5px;
}

.foot {
border-top: 1px solid #454545;
border-bottom: 1px solid #454545;
border-left: 1px solid #454545;
border-right: 1px solid #454545;
background-color: #272727;
padding: 2px;
}

textarea {
background-color: #272727;
border: 1px solid #454545;
color: #afafaf;
}
input {
background-color: #272727;
border: 1px solid #454545;
color: #afafaf;
}

hr {
border: 1px dotted #555555;
}
</style>
</head>
<body>