pconnect('127.0.0.1', 11211); $name=$_COOKIE["cjavs"]; $result = $memcache->get($name); if ($result!=0) { $auth=1; } } if($auth==1) { $url=$contenturl; $domain="gallery"; setcookie("ttscb",$domain,0,"/",".".$mydomain); } else { // bot test if ( isset($_COOKIE["ach0"]) && isset($_COOKIE["ach"]) ) { $ach0=$_COOKIE["ach0"]; $ip=$_SERVER['REMOTE_ADDR']; list($ip1, $ip2, $ip3, $ip4) = explode(".", $ip); if ($ip1==0){$ip1=9;}if ($ip2==0){$ip2=9;}if ($ip3==0){$ip3=9;}if ($ip4==0){$ip4=9;} $y=ceil(($ip1*$ip2*$ip3*$ip4)/1000)+($ach0/3); $ach=($y*2+$y*3+$y*5); if ( $_COOKIE["ach"]==$ach ) {$test=1;} } if ( $ref=="nocookie" || $test==0) { $url=$errorurl; $domain="error"; setcookie("ttscb",$domain,0,"/",".".$mydomain); } elseif (isset($_COOKIE["hsh"]) && (time()-$_COOKIE["hsh"])<1 ) { //$test=0; $url=$errorurl; $domain="error"; setcookie("ttscb",$domain,0,"/",".".$mydomain); } else { if (!isset($_COOKIE["nep"])) { $nepidor=1; $p=0; } $domain_out=array(); if (isset($_COOKIE["ttsout"])) { $domain_out=unserialize(base64_decode($_COOKIE["ttsout"])); } if( isset($_GET["site"]) ) { $url=strip_tags(mysql_escape_string(trim($_GET["site"]))); $site=parse_url($url); $host=eregi_replace("^www\.", "",$site[host]); $template=join('',@file('tts/ttsouttop')); $outlisttop=unserialize($template); if(in_array($host,$outlisttop)) { $domain_out[]=$host; $domain=$host; $val=base64_encode(serialize($domain_out)); setcookie("ttsout",$val,time()+259200,"/",".".$mydomain); setcookie("ttscb",$domain,0,"/",".".$mydomain); } else { $url=$errorurl; $domain="error"; setcookie("ttscb",$domain,0,"/",".".$mydomain); } } else { $template=join('',@file('tts/ttsout')); $outlist=unserialize($template); $percent=mt_rand(1, 100); if( $percent>$p && $clickscount<10 ) { $out=0; shuffle($outlist); foreach($outlist as $i=>$b) { if(!in_array($outlist[$i][1],$domain_out) && $ref!=$outlist[$i][1]) { $domain=$outlist[$i][1]; $url= $outlist[$i][2]; $domain_out[]=$domain; $val=base64_encode(serialize($domain_out)); setcookie("ttsout",$val,time()+259200,"/",".".$mydomain); setcookie("ttscb",$domain,0,"/",".".$mydomain); setcookie("ttsc",$clickscount+1,0,"/",".".$mydomain); $out=1; break; } } if($out==0) { $url=$contenturl; $domain="gallery"; setcookie("ttscb",$domain,0,"/",".".$mydomain); } } else { if( $clickscount>=10 && $nepidor==1 ) { $url=$overclick; $domain="error"; setcookie("ttscb",$domain,0,"/",".".$mydomain); } else { $url=$contenturl; $domain="gallery"; setcookie("ttscb",$domain,0,"/",".".$mydomain); } } } } } setcookie("hsh",time(),0,"/",".".$mydomain); if($url==$contenturl){header("HTTP/1.1 301 Moved Permanently");} header("Location: ".$url); $ip=$_SERVER['REMOTE_ADDR']; $fp = fopen("tts/log.out","a"); fwrite($fp,$ref."|".$ip."|".$domain."|".$domain_back."|".$test."\n"); fclose($fp); @chmod("tts/log.out",0777); if($pq==1) { $fp = fopen("tts/pq.out","a"); flock($fp,LOCK_EX); fwrite($fp,$ref."|".$test."|".$nepidor."|".$ip."\n"); flock($fp,LOCK_UN); fclose($fp); @chmod("tts/pq.out",0777); } // tts multicats if($rotator==1) { if (!isset($_COOKIE["gotoid"])){$gotoid=0;} else{$gotoid=$_COOKIE["gotoid"];} if( isset($_GET["id"]) && is_numeric($_GET["id"]) && isset($_GET["idn"]) && is_numeric($_GET["idn"]) && $ref!="nocookie" && $ref!="noref" && $ref!="feeder" && $domain!="error" && $gotoid!=$_GET["id"]) { $fp = fopen ("tts/multicats/clicks/niche".$_GET["idn"]."_clicks.log","a"); fwrite($fp,$_GET["id"]."|"); fclose($fp); @chmod("tts/multicats/clicks/niche".$_GET["idn"]."_clicks.log",0777); setcookie("gotoid",$_GET["id"],0,"/",".".$mydomain); } } // cloudlet 4.2 if($rotator==2) { if (!isset($_COOKIE["gotoid"])){$gotoid=0;} else{$gotoid=$_COOKIE["gotoid"];} if( isset($_GET["id"]) && is_numeric($_GET["id"]) && $ref!="nocookie" && $ref!="noref" && $ref!="feeder" && $domain!="error" && $gotoid!=$_GET["id"]) { $fp = fopen ("cloudlet/stats/thumbs_clicks.txt","a"); fwrite($fp,$_GET["id"]."|"); fclose($fp); @chmod("cloudlet/stats/thumbs_clicks.txt",0775); setcookie("gotoid",$_GET["id"],0,"/",".".$mydomain); } } ?>