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

Размер файла: 4.36Kb
  1. <?php
  2. error_reporting(0);
  3. $PREFER_DEFLATE=true;
  4. $FORCE_COMPRESSION=false;
  5.  
  6. function head_return_replaced_str($o){
  7. $o=ereg_replace("<:([^\:>]*):>","",$o);
  8. $o=str_replace('href=""','href="'.$_SERVER['SCRIPT_NAME'].'"',$o);
  9. $o=str_replace('action=""','action="'.$_SERVER['SCRIPT_NAME'].'"',$o);
  10. $o=str_replace('href="?','href="'.$_SERVER['SCRIPT_NAME'].'?',$o);
  11. $o=str_replace('action="?','action="'.$_SERVER['SCRIPT_NAME'].'?',$o);
  12. $o=str_replace('URL=?','URL='.$_SERVER['SCRIPT_NAME'].'?',$o);
  13. return $o;
  14. }
  15.  
  16. function compress_output_gzip($output) {
  17. global $_CONF;
  18.  
  19. If (isset($_CONF)){
  20. foreach($_CONF as $key=>$value){
  21. $output=formating($key,$value);
  22. }
  23. }
  24.  
  25. $o=utf_encode($output);
  26. $o=head_return_replaced_str($o);
  27. return gzencode($o);}
  28.  
  29. function compress_output_deflate($output) {
  30. global $_CONF;
  31.  
  32. If (isset($_CONF)){
  33. foreach($_CONF as $key=>$value){
  34. $output=formating($key,$value,$output);
  35. }
  36. }
  37. $o=utf_encode($output);
  38. $o=head_return_replaced_str($o);
  39.  
  40.  
  41. return gzdeflate($o);}
  42.  
  43. function compress_output_x_gzip($output) {
  44. global $_CONF;
  45.  
  46. If (isset($_CONF)){
  47. foreach($_CONF as $key=>$value){
  48. $output=formating($key,$value,$output);
  49. }
  50. }
  51. $o=utf_encode($output);
  52. $o=head_return_replaced_str($o);
  53. return gzcompress($o);}
  54.  
  55. function standart($output) {
  56. global $_CONF;
  57.  
  58. If (isset($_CONF)){
  59. foreach($_CONF as $key=>$value){
  60. $output=formating($key,$value,$output);
  61. }
  62. }
  63. $output=utf_encode($output);
  64. $output=head_return_replaced_str($output);
  65.  
  66.  
  67. return $output;
  68. }
  69.  
  70. if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {$AE=$_SERVER['HTTP_ACCEPT_ENCODING'];}
  71. elseif (isset($_SERVER['HTTP_TE'])) {$AE=$_SERVER['HTTP_TE'];}
  72. else {$AE="";}
  73.  
  74. $support_gzip=(strpos($AE, 'gzip')!== FALSE)||$FORCE_COMPRESSION;
  75. $support_deflate=(strpos($AE, 'deflate')!== FALSE)||$FORCE_COMPRESSION;
  76. $support_x_gzip=(strpos($AE, 'x-gzip')!== FALSE)||$FORCE_COMPRESSION;
  77.  
  78. if($support_gzip && $support_deflate) {$support_deflate=$PREFER_DEFLATE;}
  79.  
  80. if ($support_deflate) {header("Content-Encoding: deflate"); ob_start("compress_output_deflate");}
  81. elseif($support_gzip) {header("Content-Encoding: gzip"); ob_start("compress_output_gzip");}
  82. elseif($support_x_gzip) {header("Content-Encoding: x_gzip"); ob_start("compress_output_x_gzip");}
  83. else {ob_start("standart");}
  84.  
  85. $_CONF['index_align']="left";
  86. $_CONF['index_page']="index.php";
  87.  
  88. ini_set('display_errors', 'off');
  89. header ("Content-type: text/html; charset=utf-8");
  90. header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
  91. header("Cache-Control: no-cache, must-relative");
  92. echo '<?xml version="1.0" encoding="UTF-8"?>
  93. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  94. <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  95. <meta name="keywords" content="КликМан, ClickMan, Новочебоксарск, загрузки, магазин, аська, казино, халява, бесплатно, мобила, смарт, symbian, клик, клуб"/>
  96. <meta name="description" content="ClickMan.h2m.ru - Раскрутись!"/>
  97. <link rel="shortcut icon" href="http://clickman.h2m.ru/images/favicon.ico" />
  98. <title>'.$_CONF['title'].'</title>
  99. <link rel="stylesheet" href="style.css" type="text/css" />
  100. <body><div class="contur"><div class="header"><div class="contur_rek"><div class="header_rek"><div style="color:#000000; text-align:center;">'.$_CONF['index_title'].'</div></div></div>';
  101. echo '<div class="contur_rek"><div class="header"><div style="color:#000000; text-align:left;">';
  102. include 'rekverh.php';
  103. echo '</div></div></div>';
  104. $num=@count($_GET); $num+=@count($_POST);
  105. If ($num>maxnumrequest){
  106. echo '<wml><card id="card0" title="<:title:>">
  107. <p align="center"><u>HTTP ! (Too much parametres)</u></p>';
  108. include "header/end.inc.php";
  109. }else{
  110. If (isset($_GET))
  111. foreach ($_GET as $value)
  112. if (strlen($value)>maxlengthrequest){
  113. echo '<wml><card id="card0" title="<:title:>">
  114. <p align="center"><u>HTTP ! (Very much lenght of GET parametres)</u></p>';
  115. include "header/end.inc.php";
  116. }
  117.  
  118. If (isset($_POST))
  119. foreach ($_POST as $value)
  120. if (strlen($value)>maxlengthrequest){
  121. echo '<wml><card id="card0" title="<:title:>">
  122. <p align="center"><u>HTTP ! (Very much lenght of POST parametres)</u></p>';
  123. include "header/end.inc.php";
  124. }
  125. //
  126. If (isset($_GET))
  127. foreach ($_GET as $key=>$value) $_GET[$key]=txt($_GET[$key]);
  128. If (isset($_POST))
  129. foreach ($_POST as $key=>$value) $_POST[$key]=txt($_POST[$key]);
  130. }
  131.  
  132. ?>