'; // Horizontal $h_tag=' '; // Load Links include ("includes/links.php"); // Load libraries include ("includes/functions_utils.php"); include ("includes/functions_cache.php"); // Locate web $web=str_replace("www.","",$_SERVER['HTTP_HOST']); $web=str_replace(".turincon.com","",$web); // URI if (substr($_SERVER['REQUEST_URI'],strlen($_SERVER['REQUEST_URI'])-1)=="/") $uri=substr($_SERVER['REQUEST_URI'],strlen($_SERVER['REQUEST_URI'])); else $uri=$_SERVER['REQUEST_URI']; // Load webpage if (check_cache($web,$uri)) { echo get_cache_data($web,$uri); #shell_exec ("echo ".$web." - ".$data[1].$uri." loaded from cache on ".date("m-d-y H:i:s")." >> /var/log/turincon"); } else { // Load libraries for process html include ("includes/functions_processhtml.php"); // Get data from the web $data=get_info($web); // Detect redirections to it's own if ($data[1]==$_SERVER['HTTP_HOST'] or str_replace("www.","",$data[1])==$_SERVER['HTTP_HOST'] or "www.".$data[1]==$_SERVER['HTTP_HOST']) { # echo "
$h_tag
"; echo "

Error grave

"; echo "

No se puede redireccionar una web sobre si misma

"; # echo "
$h_tag
"; die(); } // Print the webpage REAL url //echo ""; // Get the content of the URL $html= html_fix(getcontent($data[1].$uri)); // Log #shell_exec ("echo Start ".$web." - ".$data[1].$uri." at ".date("m-d-y H:i:s")." >> /var/log/turincon"); // Get the URL Base $base=my_urlbase($data[1]); // Change relative to absolute URLs $str=preg_replace('#(href|src|HREF|SRC)="([^:"]*)(?:")#','$1="'.$base.'$2"',$html); // For Fix images in MSN Groups $str=str_replace($base."/isapi/fetch.dll","http://groups.msn.com/isapi/fetch.dll",$str); // Lowercase html tags $str=lower_html_tags($str); // Change internal URLs // Detect if URL have end / if (substr($data[1],strlen($data[1])-1)=="/") $slash="/"; // Make the replace if (!strstr($data[1],"groups.msn")) { $str=str_replace('href="'.$data[1],'href="http://'.$web.'.turincon.com'.$slash,$str); } else { $parts=split("/",$data[1]); $eurl=$parts[0]."//".$parts[2]."/".$parts[3]."//".$parts[3]; $str=str_replace('href="'.$eurl,'href="http://'.$_SERVER['HTTP_HOST'].$slash,$str); } // Some people add code after the tag, and I don't know why .... $afterhtml=substr($str,strpos($str,"")+7); $body=remove_publi(tag_create($str,"","","")); //$body=tag_create($str,"","",""); $head=create_head($data[6],$data[8],$data[7],$str); // Drop don't opened tags if (!stristr($body.$afterhtml,'1) { $body=str_replace("","",$body); $afterhtml=str_replace("","",$afterhtml); } // Headers $fhtml=get_tags($str,"\?xml",false); $fhtml.=get_tags($str,"\!DOCTYPE",false); // Final code creation $fhtml.="".chr(10); $fhtml.=$head.chr(10); if ($_GET['ads']=="yes") // For frames { // Create table block $fhtml="".$head.""; # $fhtml.=""; $fhtml.=""; //$fhtml.="
".$h_tag."
 ".assign_links($links,"v",$web)."
"; echo $fhtml; }else{ // Without frames // Create table block $v_tagtable=""; //$v_tagtable.=""; $v_tagtable.="
".assign_links($links,"h",$web)."
"; # $endtable="".$v_tag."
"; $endtable=" "; // If have Frames we don't have body, and if it have a full body with tags we don't put body if (strstr($str,"") and !strstr($str,"")) //That is because if there is more content after the > of the body it don't put the tags correctly $fhtml.=substr($line,0,strpos($line,">")+1).$v_tagtable.substr($line,strpos($line,">")+1); if (strstr($line,"")) //That is because if there is more content after the > of the body it don't put the tags correctly { $line=$lines[$x].chr(10).$lines[$x+1]; $jump=1; $fhtml.=substr($line,0,strpos($line,">")+1).$v_tagtable.substr($line,strpos($line,">")+1); } elseif (strstr($line,"http://Ads1.msn.com/library/dap.js")) $t=0; elseif (strstr($fhtml,""; } elseif (strstr($str,""; } if (!strstr($fhtml,"")) $fhtml.=""; // Repair detected bug $fhtml=str_replace('=" id','="" id',$fhtml); // Show echo $fhtml; } // Calculates the time in generate the web $ttime=time()-$init; // Log #shell_exec ("echo End ".$web." - ".$data[1].$uri." at ".date("m-d-y H:i:s")." Total: ".$ttime."s >> /var/log/turincon"); // Alert if page generation too slow #if ($ttime>5) shell_exec ("echo ALERT!! ".$web." with URL ".$data[1].$uri." is generated too slow. TOTAL OF: ".$ttime."s >> /var/log/turincon"); #shell_exec ("echo ".$web." - ".$data[1].$uri." cached on ".date("m-d-y H:i:s")." >> /var/log/turincon"); // We create the cache create_cache($web,$uri,$fhtml); } die(); ?>