".date("H-i-s").":".$clienturl.":".$trafficdata.":".$testdoorwork.":".$clientreshash.":".$getautosettsornot.":".$clfilenamehere.":".$sepositions;$fod=fopen($clientdatapath."/clientdata.txt","w+");flock($fod,LOCK_EX);fwrite($fod,trim($clientdata));fclose($fod);if(!empty($sepositions)){$sebyses=explode("|",$sepositions);$sepositions=trim($sepositions);$fod=fopen($clientdatapath."/indexhistory.txt","a+");flock($fod,LOCK_EX);fwrite($fod,date("d.m.y")." ".date("H:i")."\tGoogle: ".$sebyses[0]."\tYahoo: ".$sebyses[1]."\tBing: ".$sebyses[2]."\tYandex: ".$sebyses[3]."\n");fclose($fod);}if(!file_exists($clientdatapath."/"."setts.txt")&&!empty($currentsetts)){$fod=fopen($clientdatapath."/setts.txt","w+");flock($fod,LOCK_EX);fwrite($fod,$currentsetts);fclose($fod);if(file_exists($clientdatapath."/newsetts.txt")){$oldnewsetts=file_get_contents($clientdatapath."/"."newsetts.txt");$oldnewsetts=trim($oldnewsetts);$fod=fopen($clientdatapath."/newsetts.txt","w+");flock($fod,LOCK_EX);fwrite($fod,$oldnewsetts."\n".$currentsetts);fclose($fod);}}if(file_exists($clientdatapath."/"."newsetts.txt")){echo file_get_contents($clientdatapath."/"."newsetts.txt")."THENEWSETTSHERE";@unlink($clientdatapath."/"."newsetts.txt");die();}}if(!empty($_GET['ineednewkeys'])&&$_GET['ineednewkeys']=="yes"&&!empty($keyfilename)){if(file_exists($clientdatapath."/newkeys.txt")){echo file_get_contents($clientdatapath."/newkeys.txt");@unlink($clientdatapath."/newkeys.txt");die();}else{$error.="Client wants new key file, but i have not it\t";}}if(!empty($_GET['ineednewuseragents'])&&$_GET['ineednewuseragents']=="yes"){if(file_exists("workdir/cloackdata/useragents.txt")){echo codedata(file_get_contents("workdir/cloackdata/useragents.txt"));die();}else{$error.="Client wants new useragents file, but i have not it\t";}}if(!empty($_GET['ineednewreffs'])&&$_GET['ineednewreffs']=="yes"){if(file_exists("workdir/cloackdata/referers.txt")){echo codedata(file_get_contents("workdir/cloackdata/referers.txt"));die();}else{$error.="Client wants new referers file, but i have not it\t";}}if(!empty($_GET['ineednewbotips'])&&$_GET['ineednewbotips']=="yes"){if(file_exists("workdir/cloackdata/botips.txt")){echo file_get_contents("workdir/cloackdata/botips.txt");die();}else{$error.="Client wants new botips file, but i have not it\t";}}if(empty($keysfilestatus)&&$workstatus=="work"&&!empty($keyfilename)){$error.="No key file on client\t";if(!file_exists("workdir/keys/".$keyfilename)){$error.="No key file on server\t";}}if(!empty($keysfilestatus)&&!empty($keyfilename)&&$workstatus=="work"){if(file_exists("workdir/keys/".$keyfilename)){$allkeys=file("workdir/keys/".$keyfilename);}else{$error.="No key file ".$keyfilename." on server\t";}}$themes="";if(!empty($themesfilename)){if(file_exists("workdir/themes/".$themesfilename)){$themes=file_get_contents("workdir/themes/".$themesfilename);}else{$error.="No theme file ".$themesfilename."\t";$themes="";}}$text="";if(!empty($themes)){$themetextdir=tematickey_text($themes,$q);$goodthemetextfiles=array();if(!empty($themetextdir)){$themetextdir=trim($themetextdir);$tehemetextfiles=scandir("workdir/text/".$themetextdir);foreach($tehemetextfiles as$tehemetextfile){$tehemetextfile=trim($tehemetextfile);if(trim($tehemetextfile)!=".DS_Store"&&trim($tehemetextfile)!="."&&trim($tehemetextfile)!=".."){$goodthemetextfiles[]=$tehemetextfile;}}srand((float)microtime()*1000000);shuffle($goodthemetextfiles);$goodthemetextfile=trim($goodthemetextfiles[0]);$text=file("workdir/text/".$themetextdir."/".$goodthemetextfile);srand((float)microtime()*1000000);shuffle($text);$text=implode($text);if(substr_count($text,"[:::")>=1){$regular="/(\[:::.*:::\])/iU";preg_match_all($regular,$text,$matches);if($matches[1]){foreach($matches[1] as$randspin){$randspin=trim($randspin);$spinwords=str_ireplace("[:::","",$randspin);$spinwords=str_ireplace(":::]","",$spinwords);$spinwords=explode("|",$spinwords);srand((float)microtime()*1000000);shuffle($spinwords);if(!empty($spinwords[0])){$text=preg_replace('|'.preg_quote($randspin).'|iU',trim($spinwords[0]),$text,1);}else{$text=str_ireplace($randspin,"",$text);}}}}}}if($workstatus=="work"&&!empty($templatename)&&!empty($keyfilename)&&file_exists("workdir/keys/".$keyfilename)&&empty($text)){if($wherecontent=="gentext"||$wherecontent=="binggentext"){$text=getgentext($q,200);if($wherecontent=="binggentext"){$text=$text." ".getbingcontent($q,5);}if(mb_detect_encoding($text)=="UTF-8"){$text=trim($text);}else{$text=iconv(mb_detect_encoding($text),"UTF-8",$text);$text=trim($text);}}if($wherecontent=="bingsnippets"){$text=getbingcontent($q,10);if(mb_detect_encoding($text)=="UTF-8"){$text=trim($text);}else{$text=iconv(mb_detect_encoding($text),"UTF-8",$text);$text=trim($text);}}if($wherecontent=="dogpilesnippets"){$text=getdogpilecontent($q,10);if(mb_detect_encoding($text)=="UTF-8"){$text=trim($text);}else{$text=iconv(mb_detect_encoding($text),"UTF-8",$text);$text=trim($text);}}if($wherecontent=="bingdogpile"){$text1=getdogpilecontent($q,5);if(mb_detect_encoding($text1)=="UTF-8"){$text1=trim($text1);}else{$text1=iconv(mb_detect_encoding($text1),"UTF-8",$text1);$text1=trim($text1);}$text2=getbingcontent($q,5);if(mb_detect_encoding($text2)=="UTF-8"){$text2=trim($text2);}else{$text2=iconv(mb_detect_encoding($text2),"UTF-8",$text2);$text2=trim($text2);}$text=$text1.". ".$text2;}if(($wherecontent=="textfmfile"||$wherecontent=="bingtextfmfile")&&!empty($textfilename)){$text="";if(is_dir("workdir/text/".$textfilename)){$textfiles=scandir("workdir/text/".$textfilename);foreach($textfiles as$k=>$textfile){if(trim($textfile)==".DS_Store"||trim($textfile)=="."||trim($textfile)==".."||filesize("workdir/text/".$textfilename."/".$textfile)==0){unset($textfiles[$k]);}}if(count($textfiles)>0){srand((float)microtime()*1000000);shuffle($textfiles);$text=file_get_contents("workdir/text/".$textfilename."/".$textfiles[0]);}}elseif(file_exists("workdir/text/".$textfilename)){$text=file_get_contents("workdir/text/".$textfilename);}if(!empty($text)){if(substr_count($text,"[:::")>=1){$regular="/(\[:::.*:::\])/iU";preg_match_all($regular,$text,$matches);if($matches[1]){foreach($matches[1] as$randspin){$randspin=trim($randspin);$spinwords=str_ireplace("[:::","",$randspin);$spinwords=str_ireplace(":::]","",$spinwords);$spinwords=explode("|",$spinwords);srand((float)microtime()*1000000);shuffle($spinwords);if(!empty($spinwords[0])){$text=preg_replace('|'.preg_quote($randspin).'|iU',trim($spinwords[0]),$text,1);}else{$text=str_ireplace($randspin,"",$text);}}}}if($wherecontent=="bingtextfmfile"){$text=$text." ".getbingcontent($q,5);if(mb_detect_encoding($text)=="UTF-8"){$text=trim($text);}else{$text=iconv(mb_detect_encoding($text),"UTF-8",$text);$text=trim($text);}}}else{$error.="Text file ".$textfilename." problem\t";}}if(($wherecontent=="keytextfmfile")&&!empty($textfilename)){$text="";if(is_dir("workdir/text/".$textfilename)){if(file_exists("workdir/text/".$textfilename."/".str_ireplace(" ","-",$q).".txt")){$text=file_get_contents("workdir/text/".$textfilename."/".str_ireplace(" ","-",$q).".txt");}}if(!empty($text)){if(substr_count($text,"[:::")>=1){$regular="/(\[:::.*:::\])/iU";preg_match_all($regular,$text,$matches);if($matches[1]){foreach($matches[1] as$randspin){$randspin=trim($randspin);$spinwords=str_ireplace("[:::","",$randspin);$spinwords=str_ireplace(":::]","",$spinwords);$spinwords=explode("|",$spinwords);srand((float)microtime()*1000000);shuffle($spinwords);if(!empty($spinwords[0])){$text=preg_replace('|'.preg_quote($randspin).'|iU',trim($spinwords[0]),$text,1);}else{$text=str_ireplace($randspin,"",$text);}}}}if($wherecontent=="bingtextfmfile"){$text=$text." ".getbingcontent($q,5);if(mb_detect_encoding($text)=="UTF-8"){$text=trim($text);}else{$text=iconv(mb_detect_encoding($text),"UTF-8",$text);$text=trim($text);}}}else{$error.="Text file ".$textfilename." problem\t";}}if($wherecontent=="bookcontent"||$wherecontent=="bingbookcontent"){$text=contentrubook();if(mb_detect_encoding($text)=="UTF-8"){$text=trim($text);}else{$text=iconv(mb_detect_encoding($text),"UTF-8",$text);$text=trim($text);}if($wherecontent=="bingbookcontent"){$text=$text." ".getbingcontent($q,5);if(mb_detect_encoding($text)=="UTF-8"){$text=trim($text);}else{$text=iconv(mb_detect_encoding($text),"UTF-8",$text);$text=trim($text);}}}if(empty($text)&&$wherecontent!="notext"){$error.="No text for page\t";}else{$text=str_ireplace("....",".",$text);$text=str_ireplace("...",".",$text);$text=str_ireplace("..",".",$text);}}$text=explode(".",$text);$text=array_unique($text);$text=implode(".",$text);$text=explode("!",$text);$text=array_unique($text);$text=implode("!",$text);$text=explode("?",$text);$text=array_unique($text);$text=implode("?",$text);if(file_exists("workdir/stopwords.txt")){$stopwords=file("workdir/stopwords.txt");if(!empty($stopwords)){foreach($stopwords as$stopword){$stopword=trim($stopword);$text=str_ireplace($stopword,"",$text);}$text=str_ireplace(" "," ",$text);}}if(!empty($extlinksfilename)){if(!file_exists("workdir/extlinks/".$extlinksfilename)){$error.="No extlinks file ".$extlinksfilename."\t";$extlinkstatus="";}else{$extlinkstatus="good";}}if($workstatus=="work"&&empty($templatename)){$error.="Template not setted\t";}if($workstatus=="work"&&!empty($templatename)){if(file_exists("workdir/templates/".$templatename)){$doortemplate=file_get_contents("workdir/templates/".$templatename);}else{$error.="No template file ".$templatename."\t";}}if(!empty($doortemplate)&&(!empty($text)||$wherecontent=="notext")&&!empty($q)&&!empty($allkeys)&&!empty($clienturl)){if(substr_count($doortemplate,"[RAND:")>=1){$regular="/(\[RAND:[0-9]*:[0-9]*\])/";preg_match_all($regular,$doortemplate,$matches);if(!empty($matches[1])){foreach($matches[1] as$currranddigitstr){$currranddigit=explode(":",trim(str_ireplace("[","",str_ireplace("]","",$currranddigitstr))));$doortemplate=preg_replace("/".str_ireplace("[","\[",str_ireplace("]","\]",$currranddigitstr))."/",rand(trim($currranddigit[1]),trim($currranddigit[2])),$doortemplate,1);}}}$doortemplate=str_ireplace("female-dbol-cycle",str_ireplace(" ","-",strtolower($q)),$doortemplate);$doortemplate=str_ireplace("[UPKEY]",mb_strtoupper(mb_substr($q,0,1,'UTF-8'),'UTF-8').mb_substr($q,1,mb_strlen($q),'UTF-8'),$doortemplate);$doortemplate=str_ireplace("[LKEY]",strtolower($q),$doortemplate);if(substr_count($doortemplate,"[PHPSNIPPET:")>=1){$doortemplate=urlencode($doortemplate);$regular="/(%5BPHPSNIPPET%3A.*%3AENDOFSNIPPET%5D)/iUsm";preg_match_all($regular,$doortemplate,$matches);if(!empty($matches[1])){foreach($matches[1] as$currranddigitstr){$currranddigitstrfreval=str_ireplace("%5BPHPSNIPPET%3A","",$currranddigitstr);$currranddigitstrfreval=str_ireplace("%3AENDOFSNIPPET%5D","",$currranddigitstrfreval);$snippetresult="";eval(urldecode($currranddigitstrfreval));$currranddigitstr=str_ireplace(".","\.",$currranddigitstr);$currranddigitstr=str_ireplace("+","\+",$currranddigitstr);$currranddigitstr=str_ireplace("?","\?",$currranddigitstr);$snippetresult=urlencode($snippetresult);if(!empty($snippetresult)){$doortemplate=preg_replace("/".$currranddigitstr."/",$snippetresult,$doortemplate,1);}else{$doortemplate=preg_replace("/".$currranddigitstr."/","",$doortemplate,1);}}}$doortemplate=urldecode($doortemplate);}$themeranddir="";if(stripos("qqqq".$doortemplate,"[RANDOMLINES")){$regular="#(\[RANDOMLINES:.*\])#iU";preg_match_all($regular,$doortemplate,$matches);if(!empty($themes)){$themeranddir=tematickey_text($themes,$q);$themeranddir=trim($themeranddir);if(is_dir("./workdir/randomlines/".$themeranddir)){$themeranddir=$themeranddir."/";}}if(!empty($matches[1])){foreach($matches[1] as$currrandlnstr){$needrandlines="";$currrandln=trim($currrandlnstr);$currrandln=str_ireplace("[","",$currrandln);$currrandln=str_ireplace("]","",$currrandln);$currrandln=explode(":",$currrandln);$currrandln[1]=trim($currrandln[1]);if(stripos("qqq".$currrandln[1],"IDENT")){if(!empty($needident)){$currrandln[1]=str_ireplace("IDENT",trim($needident),$currrandln[1]);}else{$doortemplate=preg_replace("#(".trim(str_ireplace("[","\[",str_ireplace("]","\]",str_ireplace("^","\^",$currrandlnstr)))).")#iU","",$doortemplate,1);continue;}}if(file_exists("./workdir/randomlines/".$themeranddir."".trim($currrandln[1]))){$lines=file("./workdir/randomlines/".$themeranddir."".trim($currrandln[1]));srand((float)microtime()*1000000);shuffle($lines);if(trim($currrandln[2])>=count($lines)){$currrandln[2]=count($lines)-1;}else{$currrandln[2]--;}for($i=0;$i<=trim($currrandln[2]);$i++){$needrandlines.=trim($lines[$i])."".$currrandln[3];}$doortemplate=preg_replace("#(".trim(str_ireplace("[","\[",str_ireplace("]","\]",str_ireplace("^","\^",$currrandlnstr)))).")#iU",trim($needrandlines,$currrandln[3]),$doortemplate,1);}else{$error.="No file ".trim($currrandln[1])." for random lines\t";$doortemplate=preg_replace("#(".trim(str_ireplace("[","\[",str_ireplace("]","\]",str_ireplace("^","\^",$currrandlnstr)))).")#iU","",$doortemplate,1);}}}}if(substr_count($doortemplate,"[:::")>=1){$regular="/(\[:::.*:::\])/iU";preg_match_all($regular,$doortemplate,$matches);if($matches[1]){foreach($matches[1] as$randspin){$randspin=trim($randspin);$spinwords=str_ireplace("[:::","",$randspin);$spinwords=str_ireplace(":::]","",$spinwords);$spinwords=explode("|",$spinwords);srand((float)microtime()*1000000);shuffle($spinwords);if(!empty($spinwords[0])){$doortemplate=preg_replace('|'.preg_quote($randspin).'|iU',$spinwords[0],$doortemplate,1);}else{$doortemplate=str_ireplace($randspin,"",$doortemplate);}}}}if(stripos("qqqq".$doortemplate,"[SENTENCE")){$regular="/(\[SENTENCE:.*\])/iU";preg_match_all($regular,$doortemplate,$matches);if(!empty($matches[1])){foreach($matches[1] as$currsentstr){$currsent=trim($currsentstr);$currsent=str_ireplace("[","",$currsent);$currsent=str_ireplace("]","",$currsent);$currsent=explode(":",$currsent);$textpart=sentence_new($currsent[1],$currsent[2],$text,$currsent[3],$currsent[4],''.$currsent[5],$q,$allkeys,$themes,"workdir/extlinks/".$extlinksfilename,$clienturl,''.$currsent[6],$extlinkstatus,$currsent[7]);$textpart=str_ireplace("\$","\\\$",$textpart);if(!empty($textpart)){$doortemplate=preg_replace("/(".trim(str_ireplace("[","\[",str_ireplace("]","\]",str_ireplace("^","\^",$currsentstr)))).")/iUm",ucfirst($textpart),$doortemplate,1);}else{$doortemplate=preg_replace("/(".trim(str_ireplace("[","\[",str_ireplace("]","\]",str_ireplace("^","\^",$currsentstr)))).")/iUm","",$doortemplate,1);}}}}$doortemplate=str_ireplace("[UPKEY]",mb_strtoupper(mb_substr($q,0,1,'UTF-8'),'UTF-8').mb_substr($q,1,mb_strlen($q),'UTF-8'),$doortemplate);if(stripos("qqqq".$doortemplate,"[DOPKEYDATA")){$regular="/(\[DOPKEYDATA:.*\])/iU";preg_match_all($regular,$doortemplate,$matches);if(!empty($matches[1])){$matches[1]=array_unique($matches[1]);$needopkeydata="";foreach($allkeys as$curkeyfrdop){$curkeyfrdop=trim($curkeyfrdop);$curkeyfrdop=explode("***",$curkeyfrdop);if(!empty($curkeyfrdop[1])){unset($curkeyfrdop[1]);}$curkeyfrdop=implode($curkeyfrdop);$curkeyfrdop=explode("|",$curkeyfrdop);if(strtolower(trim($q))==strtolower($curkeyfrdop[0])){$needopkeydata=$curkeyfrdop;break;}}if(!empty($needopkeydata)&&count($needopkeydata)>1){foreach($matches[1] as$dopkeydata){$dopkeydata=trim($dopkeydata);$dopkeydata=str_ireplace("[","",$dopkeydata);$dopkeydata=str_ireplace("]","",$dopkeydata);$dopkeydata=explode(":",$dopkeydata);if(!empty($needopkeydata[$dopkeydata[1]])){$doortemplate=str_ireplace("[DOPKEYDATA:".$dopkeydata[1]."]",$needopkeydata[$dopkeydata[1]],$doortemplate);}else{$doortemplate=str_ireplace("[DOPKEYDATA:".$dopkeydata[1]."]","",$doortemplate);}}}}}if(!empty($themes)){if(substr_count($doortemplate,"[RANDTEMATICKEY]")>=1){$howmany=substr_count($doortemplate,"[RANDTEMATICKEY]");for($i=0;$i<=$howmany;$i++){$themkey=tematickey_frurls($allkeys,$themes,$q,1);$themkey=explode("***",trim(implode($themkey)));$themkey=trim($themkey[0]);$themkey=explode("|",$themkey);$themkey=$themkey[0];if(!empty($themkey)){$doortemplate=preg_replace("/\[RANDTEMATICKEY\]/",$themkey,$doortemplate,1);}else{$doortemplate=preg_replace("/\[RANDTEMATICKEY\]/","",$doortemplate,1);}}}}else{$doortemplate=str_ireplace("[RANDTEMATICKEY]","",$doortemplate);}if(substr_count($doortemplate,"[RANDKEYWORD]")>=1){srand((float)microtime()*1000000);shuffle($allkeys);$howmany=substr_count($doortemplate,"[RANDKEYWORD]");for($i=0;$i<=$howmany;$i++){$tempallkeys=explode("***",trim($allkeys[$i]));$allkeys[$i]=trim($tempallkeys[0]);$allkeys[$i]=explode("|",$allkeys[$i]);$allkeys[$i]=$allkeys[$i][0];$doortemplate=preg_replace("/\[RANDKEYWORD\]/",ucfirst(trim($allkeys[$i])),$doortemplate,1);}}if(substr_count($doortemplate,"[RANDOMLINK]")>=1){srand((float)microtime()*1000000);shuffle($allkeys);$howmany=substr_count($doortemplate,"[RANDOMLINK]");for($i=0;$i<=$howmany;$i++){$tempallkeys=explode("***",trim($allkeys[$i]));$allkeys[$i]=trim($tempallkeys[0]);$allkeys[$i]=explode("|",$allkeys[$i]);$allkeys[$i]=$allkeys[$i][0];$doortemplate=preg_replace("/\[RANDOMLINK\]/"," ".ucfirst(trim($allkeys[$i]))."",$doortemplate,1);}}if(substr_count($doortemplate,"[SIMPLERANDOMLINK]")>=1){srand((float)microtime()*1000000);shuffle($allkeys);$howmany=substr_count($doortemplate,"[SIMPLERANDOMLINK]");for($i=0;$i<=$howmany;$i++){$tempallkeys=explode("***",trim($allkeys[$i]));$allkeys[$i]=trim($tempallkeys[0]);$allkeys[$i]=explode("|",$allkeys[$i]);$allkeys[$i]=$allkeys[$i][0];$doortemplate=preg_replace("/\[SIMPLERANDOMLINK\]/","http://".str_ireplace("[KEY]",str_ireplace(" ","-",trim($allkeys[$i])),$clienturl),$doortemplate,1);}}if(substr_count($doortemplate,"[EXTRANDLINK]")>=1&&$extlinkstatus=="good"){$howmany=substr_count($doortemplate,"[EXTRANDLINK]");$extlinksfrmacros=getextlinkarray("workdir/extlinks/".$extlinksfilename,$howmany);if($howmany>count($extlinksfrmacros)){$howmany=count($extlinksfrmacros);}for($i=0;$i<=$howmany;$i++){$doortemplate=preg_replace("/\[EXTRANDLINK\]/",trim($extlinksfrmacros[$i]),$doortemplate,1);}}else{$doortemplate=str_ireplace("[EXTRANDLINK]","",$doortemplate);}$doortemplate=str_ireplace("female-dbol-cycle",str_ireplace(" ","-",strtolower($q)),$doortemplate);if(!empty($themeranddir)){$themeranddir=trim($themeranddir,"/");$doortemplate=str_ireplace("[CAT]",$themeranddir,$doortemplate);}else{$doortemplate=str_ireplace("[CAT]","",$doortemplate);}$doortemplate=str_ireplace("[THISDOMAIN]","http://".$clientdomain,$doortemplate);$doortemplate=str_ireplace("[THISDOMAINNOHTTP]",$clientdomain,$doortemplate);if(substr_count($doortemplate,"[UPKEY:")>=1){$stopkey="";preg_match_all("/(\[UPKEY:.*\])/iUm",$doortemplate,$matches);if(!empty($matches[1])){foreach($matches[1] as$currstopupkey){$stopkey=$q;$stops=str_ireplace("[UPKEY:","",$currstopupkey);$stops=str_ireplace("]","",$stops);$stops=explode(",",$stops);foreach($stops as$stopword){$stopkey=str_ireplace($stopword,"",$stopkey);}$stopkey=str_ireplace(" "," ",$stopkey);$stopkey=trim($stopkey);$doortemplate=str_ireplace($currstopupkey,mb_strtoupper(mb_substr($stopkey,0,1,'UTF-8'),'UTF-8').mb_substr($stopkey,1,mb_strlen($stopkey),'UTF-8'),$doortemplate);}}}if(substr_count($doortemplate,"[MIXCURRKEY]")>=1){$keyfrmix=explode(" ",$q);$howmany=substr_count($doortemplate,"[MIXCURRKEY]");for($i=0;$i<=$howmany;$i++){srand((float)microtime()*1000000);shuffle($keyfrmix);$doortemplate=preg_replace("/\[MIXCURRKEY\]/",ucfirst(implode(" ",$keyfrmix)),$doortemplate,1);}}$needimgscount="";if(substr_count($doortemplate,"[CURKEYIMG:S]")>=1){$needimgscount=substr_count($doortemplate,"[CURKEYIMG:S]");$simages=bingimages($q,$needimgscount,"S");if(count($simages)>0){for($i=0;$i<=$needimgscount;$i++){$doortemplate=preg_replace("/\[CURKEYIMG:S\]/",trim($simages[$i]),$doortemplate,1);}}else{$doortemplate=str_ireplace("[CURKEYIMG:S]","",$doortemplate);}}$needimgscount="";if(substr_count($doortemplate,"[CURKEYIMG:M]")>=1){$needimgscount=substr_count($doortemplate,"[CURKEYIMG:M]");$simages=bingimages($q,$needimgscount,"M");if(count($simages)>0){for($i=0;$i<=$needimgscount;$i++){$doortemplate=preg_replace("/\[CURKEYIMG:M\]/",trim($simages[$i]),$doortemplate,1);}}else{$doortemplate=str_ireplace("[CURKEYIMG:M]","",$doortemplate);}}$needimgscount="";if(substr_count($doortemplate,"[CURKEYIMG:L]")>=1){$needimgscount=substr_count($doortemplate,"[CURKEYIMG:L]");$simages=bingimages($q,$needimgscount,"L");if(count($simages)>0){for($i=0;$i<=$needimgscount;$i++){$doortemplate=preg_replace("/\[CURKEYIMG:L\]/",trim($simages[$i]),$doortemplate,1);}}else{$doortemplate=str_ireplace("[CURKEYIMG:L]","",$doortemplate);}}$needimgscount="";if(substr_count($doortemplate,"[CURKEYIMG:VL]")>=1){$needimgscount=substr_count($doortemplate,"[CURKEYIMG:VL]");$simages=bingimages($q,$needimgscount,"VL");if(count($simages)>0){for($i=0;$i<=$needimgscount;$i++){$doortemplate=preg_replace("/\[CURKEYIMG:VL\]/",trim($simages[$i]),$doortemplate,1);}}else{$doortemplate=str_ireplace("[CURKEYIMG:VL]","",$doortemplate);}}$doortemplate=str_ireplace("[LKEY]",strtolower($q),$doortemplate);if(substr_count($doortemplate,"[RAND:")>=1){$regular="/(\[RAND:[0-9]*:[0-9]*\])/";preg_match_all($regular,$doortemplate,$matches);if(!empty($matches[1])){foreach($matches[1] as$currranddigitstr){$currranddigit=explode(":",trim(str_ireplace("[","",str_ireplace("]","",$currranddigitstr))));$doortemplate=preg_replace("/".str_ireplace("[","\[",str_ireplace("]","\]",$currranddigitstr))."/",rand(trim($currranddigit[1]),trim($currranddigit[2])),$doortemplate,1);}}}$door["template"]=$doortemplate;$door["key"]=$q;$door["text"]=$text;$door["ident"]=$needident;$allkeydata="";foreach($allkeys as$curallkeydata){$curallkeydata=trim($curallkeydata);$tempcurallkeydata=explode("***",$curallkeydata);if(!empty($tempcurallkeydata[1])){unset($tempcurallkeydata[1]);}$tempcurallkeydata=implode($tempcurallkeydata);$tempcurallkeydata=explode("|",$tempcurallkeydata);if(strtolower(trim($q))==strtolower($tempcurallkeydata[0])){$allkeydata=$curallkeydata;break;}}$door["full_key"]=$allkeydata;$door["key_file"]=$keyfilename;$door["door_url"]="http://".str_ireplace("[KEY]",str_ireplace(" ","-",trim($q)),$clienturl);if(is_dir("workdir/mymacros")){$usermacroses=scandir("workdir/mymacros");if(count($usermacroses)>0){sort($usermacroses,SORT_NUMERIC);foreach($usermacroses as$usermacrose){$curusermacros="";$usermacrose=trim($usermacrose);if($usermacrose!=".DS_Store"&&$usermacrose!="."&&$usermacrose!=".."&&filesize(trim("workdir/mymacros/".$usermacrose))>0){@include("workdir/mymacros/".$usermacrose);}}}}if(!empty($door["template"])){$doortemplate=$door["template"];}$doortemplate=html_entity_decode($doortemplate);if($pdfiswork=="yes"&&$clienttype=="pdftype"){$doortemplate=str_ireplace("","",$doortemplate);$mpdf=new mPDF('utf-8');$mpdf->ignore_invalid_utf8=true;$mpdf->WriteHTML($doortemplate);$mpdf->Output();}elseif($clienttype=="doctype"){$doortemplate=explode("====================",$doortemplate);if(count($doortemplate)>=3){$doctemplate="%09%09%09+%3Chtml+xmlns%3Av%3D%22urn%3Aschemas-microsoft-com%3Avml%22%0A%09%09%09xmlns%3Ao%3D%22urn%3Aschemas-microsoft-com%3Aoffice%3Aoffice%22%0A%09%09%09xmlns%3Aw%3D%22urn%3Aschemas-microsoft-com%3Aoffice%3Aword%22%0A%09%09%09xmlns%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FREC-html40%22%3E%0A%09%09%09%0A%09%09%09%3Chead%3E%0A%09%09%09%3Cmeta+http-equiv%3DContent-Type+content%3D%22text%2Fhtml%3B+charset%3Dutf-8%22%3E%0A%09%09%09%3Cmeta+name%3DProgId+content%3DWord.Document%3E%0A%09%09%09%3Cmeta+name%3DGenerator+content%3D%22Microsoft+Word+9%22%3E%0A%09%09%09%3Cmeta+name%3DOriginator+content%3D%22Microsoft+Word+9%22%3E%0A%09%09%09%3C%21--%5Bif+%21mso%5D%3E%0A%09%09%09%3Cstyle%3E%0A%09%09%09v%5C%3A%2A+%7Bbehavior%3Aurl%28%23default%23VML%29%3B%7D%0A%09%09%09o%5C%3A%2A+%7Bbehavior%3Aurl%28%23default%23VML%29%3B%7D%0A%09%09%09w%5C%3A%2A+%7Bbehavior%3Aurl%28%23default%23VML%29%3B%7D%0A%09%09%09.shape+%7Bbehavior%3Aurl%28%23default%23VML%29%3B%7D%0A%09%09%09%3C%2Fstyle%3E%0A%09%09%09%3C%21%5Bendif%5D--%3E%0A%09%09%09%3Ctitle%3E%5BHEREAREDOCTITLE%5D%3C%2Ftitle%3E%0A%09%09%09%3C%21--%5Bif+gte+mso+9%5D%3E%3Cxml%3E%0A%09%09%09+%3Cw%3AWordDocument%3E%0A%09%09%09++%3Cw%3AView%3EPrint%3C%2Fw%3AView%3E%0A%09%09%09++%3Cw%3ADoNotHyphenateCaps%2F%3E%0A%09%09%09++%3Cw%3APunctuationKerning%2F%3E%0A%09%09%09++%3Cw%3ADrawingGridHorizontalSpacing%3E9.35+pt%3C%2Fw%3ADrawingGridHorizontalSpacing%3E%0A%09%09%09++%3Cw%3ADrawingGridVerticalSpacing%3E9.35+pt%3C%2Fw%3ADrawingGridVerticalSpacing%3E%0A%09%09%09+%3C%2Fw%3AWordDocument%3E%0A%09%09%09%3C%2Fxml%3E%3C%21%5Bendif%5D--%3E%0A%09%09%09%3Cstyle%3E%0A%09%09%09%3C%21--%0A%09%09%09+%2F%2A+Font+Definitions+%2A%2F%0A%09%09%09%40font-face%0A%09%09%09%09%7Bfont-family%3AVerdana%3B%0A%09%09%09%09panose-1%3A2+11+6+4+3+5+4+4+2+4%3B%0A%09%09%09%09mso-font-charset%3A0%3B%0A%09%09%09%09mso-generic-font-family%3Aswiss%3B%0A%09%09%09%09mso-font-pitch%3Avariable%3B%0A%09%09%09%09mso-font-signature%3A536871559+0+0+0+415+0%3B%7D%0A%09%09%09+%2F%2A+Style+Definitions+%2A%2F%0A%09%09%09p.MsoNormal%2C+li.MsoNormal%2C+div.MsoNormal%0A%09%09%09%09%7Bmso-style-parent%3A%22%22%3B%0A%09%09%09%09margin%3A0in%3B%0A%09%09%09%09margin-bottom%3A.0001pt%3B%0A%09%09%09%09mso-pagination%3Awidow-orphan%3B%0A%09%09%09%09font-size%3A7.5pt%3B%0A%09%09%09++++++++mso-bidi-font-size%3A8.0pt%3B%0A%09%09%09%09font-family%3A%22Verdana%22%3B%0A%09%09%09%09mso-fareast-font-family%3A%22Verdana%22%3B%7D%0A%09%09%09p.small%0A%09%09%09%09%7Bmso-style-parent%3A%22%22%3B%0A%09%09%09%09margin%3A0in%3B%0A%09%09%09%09margin-bottom%3A.0001pt%3B%0A%09%09%09%09mso-pagination%3Awidow-orphan%3B%0A%09%09%09%09font-size%3A1.0pt%3B%0A%09%09%09++++++++mso-bidi-font-size%3A1.0pt%3B%0A%09%09%09%09font-family%3A%22Verdana%22%3B%0A%09%09%09%09mso-fareast-font-family%3A%22Verdana%22%3B%7D%0A%09%09%09%40page+Section1%0A%09%09%09%09%7Bsize%3A8.5in+11.0in%3B%0A%09%09%09%09margin%3A1.0in+1.25in+1.0in+1.25in%3B%0A%09%09%09%09mso-header-margin%3A.5in%3B%0A%09%09%09%09mso-footer-margin%3A.5in%3B%0A%09%09%09%09mso-paper-source%3A0%3B%7D%0A%09%09%09div.Section1%0A%09%09%09%09%7Bpage%3ASection1%3B%7D%0A%09%09%09--%3E%0A%09%09%09%3C%2Fstyle%3E%0A%09%09%09%3C%21--%5Bif+gte+mso+9%5D%3E%3Cxml%3E%0A%09%09%09+%3Co%3Ashapedefaults+v%3Aext%3D%22edit%22+spidmax%3D%221032%22%3E%0A%09%09%09++%3Co%3Acolormenu+v%3Aext%3D%22edit%22+strokecolor%3D%22none%22%2F%3E%0A%09%09%09+%3C%2Fo%3Ashapedefaults%3E%3C%2Fxml%3E%3C%21%5Bendif%5D--%3E%3C%21--%5Bif+gte+mso+9%5D%3E%3Cxml%3E%0A%09%09%09+%3Co%3Ashapelayout+v%3Aext%3D%22edit%22%3E%0A%09%09%09++%3Co%3Aidmap+v%3Aext%3D%22edit%22+data%3D%221%22%2F%3E%0A%09%09%09+%3C%2Fo%3Ashapelayout%3E%3C%2Fxml%3E%3C%21%5Bendif%5D--%3E%0A%09%09%09++%0A%09%09%09%09%09%09%09%09%09%09%09%0A%09%09%09%09%09%09%09%09%09%09%09%3Cmeta+name%3D%27description%27+content%3D%27%5BHEREAREDOCDESC%5D%27%3E%0A%09%09%09%09%09%09%09%09%09%09%09%3Cmeta+name%3D%27keywords%27+content%3D%27%5BHEREAREDOCTITLE%5D%27%3E%0A%09%09%09%09%09%09%09%09+++++%0A%09%09%09%3C%2Fhead%3E%0A%09%09%09%3Cbody%3E%0A%09%09%09%09%09%09%09%09%5BHEREAREDOCCONTENT%5D%0A%09%09%09%09%09%09%09%09%3C%2Fbody%3E%3C%2Fhtml%3E";$doctemplate=str_ireplace("[HEREAREDOCTITLE]",trim($doortemplate[0]),$doctemplate);$doctemplate=str_ireplace("[HEREAREDOCDESC]",trim($doortemplate[1]),$doctemplate);$doctemplate=str_ireplace("[HEREAREDOCCONTENT]",trim($doortemplate[2]),$doctemplate);echo$doctemplate;}}else{echo$doortemplate;}}}if(!empty($error)){$error=date("d F Y H:i:s")."\t".$q."\t".$error;if(file_exists($clientdatapath."/errors.txt")&&count(file($clientdatapath."/errors.txt"))>500){$fod=fopen($clientdatapath."/errors.txt","w+");}else{$fod=fopen($clientdatapath."/errors.txt","a+");}flock($fod,LOCK_EX);fwrite($fod,$error."\n");fclose($fod);}function sentence_new($fm,$to,$text,$curdensity,$othdensity,$thislinkscount,$currkey,$allkeys,$themes,$extlinksfilename,$clienturl,$extlinkscount,$extlinkstatus,$tagornot){$curdensitydigit="";$othdensitydigit="";if(stripos("qqq".$curdensity,"dg")){$curdensity=str_ireplace("dg","",$curdensity);$curdensity=explode("^",$curdensity);$curdensity=rand($curdensity[0],$curdensity[1]);$curdensitydigit="yes";}if(stripos("qqq".$othdensity,"dg")){$othdensity=str_ireplace("dg","",$othdensity);$othdensity=explode("^",$othdensity);$othdensity=rand($othdensity[0],$othdensity[1]);$othdensitydigit="yes";}if($fm==0){$fm=1;}if($to==0){$to=1;}$thislinkscount=explode("^",$thislinkscount);$thislinkscount=rand($thislinkscount[0],$thislinkscount[1]);if($extlinkstatus=="good"){$extlinkscount=explode("^",$extlinkscount);$extlinkscount=rand($extlinkscount[0],$extlinkscount[1]);}else{$extlinkscount=0;}$currkey=trim($currkey);$currkey=strtolower($currkey);$text=preg_replace('/\\n/'," ",$text);preg_match_all("/(.+?)(\.|\?|!|:){1,}(\s||<\/p>|<\/div>)/is",$text,$text);$text=$text[0];if(count($text)<=3){$text=implode(".",$text);$text=explode(",",$text);}srand((float)microtime()*1000000);shuffle($text);$needtext=array();for($i=0;$i<=rand($fm,$to)-1;$i++){$needtext[]=$text[$i];}unset($text);$needtext=implode($needtext);$needtext=preg_replace('/\\s{2,}/'," ",$needtext);$needtext=explode(" ",$needtext);if($curdensity>0){$tempdensityarray=array(" ".$currkey." "," ".$currkey." ",$currkey,$currkey,$currkey);if(empty($curdensitydigit)){$currkeywordcount=substr_count(strtolower(implode($needtext)),strtolower($currkey));$needtoadd=ceil(count($needtext)*$curdensity/100)-$currkeywordcount;if($needtoadd<=0){$needtoadd=$currkeywordcount;}}else{$needtoadd=$curdensity;}for($i=1;$i<=$needtoadd;$i++){if($tagornot==1){$currkey=trim($tempdensityarray[array_rand($tempdensityarray)]);}$needtext[rand(0,count($needtext)-1)].=" ".$currkey;}}if($othdensity>0){srand((float)microtime()*1000000);shuffle($allkeys);if(empty($othdensitydigit)){$needtoadd=ceil(count($needtext)*$othdensity/100);}else{$needtoadd=$othdensity;}if(count($allkeys)>$needtoadd-1){$themekeystest="";if(!empty($themes)){$themekeys=tematickey_new($allkeys,$themes,$currkey,$needtoadd);if(!empty($themekeys)){$themekeystest="good";foreach($themekeys as$themekey){$themekey=trim($themekey);$themekey=explode("***",trim($themekey));$themekey=trim($themekey[0]);$themekey=explode("|",$themekey);$themekey=$themekey[0];if($tagornot==1){$tempdensityarray=array(" ".$themekey." "," ".$themekey." ",$themekey,$themekey,$themekey);$themekey=trim($tempdensityarray[array_rand($tempdensityarray)]);}$needtext[rand(0,count($needtext)-1)].=" ".$themekey;}}}if(empty($themekeystest)){for($i=1;$i<=$needtoadd;$i++){$tempallkeys=explode("***",trim($allkeys[$i]));$allkeys[$i]=trim($tempallkeys[0]);$allkeys[$i]=explode("|",$allkeys[$i]);$allkeys[$i]=$allkeys[$i][0];if($tagornot==1){$tempdensityarray=array(" ".$allkeys[$i]." "," ".$allkeys[$i]." ",$allkeys[$i],$allkeys[$i],$allkeys[$i]);$keyinline=trim($tempdensityarray[array_rand($tempdensityarray)]);}else{$keyinline=trim($allkeys[$i]);}$needtext[rand(0,count($needtext)-1)].=" ".strtolower($keyinline);}}}}if($thislinkscount>0){srand((float)microtime()*1000000);shuffle($allkeys);if(count($allkeys)<$thislinkscount-1){$thislinkscount=count($allkeys);}$themekeystest="";if(!empty($themes)){$themekeys=tematickey_frurls($allkeys,$themes,$currkey,$thislinkscount);if(!empty($themekeys)){$themekeystest="good";foreach($themekeys as$themekey){$themekey=trim($themekey);$themekey=explode("***",trim($themekey));$themekey=trim($themekey[0]);$themekey=explode("|",$themekey);$themekey=$themekey[0];$themekey=strtolower($themekey);$needtext[rand(0,count($needtext)-1)].=" ".$themekey."";}}}if(empty($themekeystest)){for($i=1;$i<=$thislinkscount;$i++){$tempallkeys=explode("***",trim($allkeys[$i]));$allkeys[$i]=trim($tempallkeys[0]);$allkeys[$i]=explode("|",$allkeys[$i]);$allkeys[$i]=$allkeys[$i][0];$needtext[rand(0,count($needtext)-1)].=" ".trim(strtolower($allkeys[$i]))."";}}}if($extlinkscount>0){$extlinks=getextlinkarray($extlinksfilename,$extlinkscount);srand((float)microtime()*1000000);shuffle($extlinks);foreach($extlinks as$extlinkone){$extlinkone=trim($extlinkone);$needtext[rand(0,count($needtext)-1)].=" ".$extlinkone;}}$needtext=trim(implode(" ",$needtext));$needtext=str_ireplace("..",".",$needtext);$needtext=str_ireplace("?.","?",$needtext);$needtext=str_ireplace("!.","!",$needtext);$needtext=htmlentities($needtext);return$needtext;}function getdogpilecontent($keyword,$ciclecount){if(empty($ciclecount)){$ciclecount=10;}$uas=array("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; FDM)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Avant Browser [avantbrowser.com]; Hotbar 4.4.5.0)","Mozilla/4.61 [en] (X11; U; ) - BrowseX (2.0.0 Windows)","Mozilla/3.0 (x86 [en] Windows NT 5.1; Sun)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; KKman2.0)","Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)","Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0 ; .NET CLR 2.0.50215; SL Commerce Client v1.0; Tablet PC 2.0","Mozilla/6.0 (compatible; MSIE 7.0a1; Windows NT 5.2; SV1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; TheFreeDictionary.com; .NET CLR 1.1.4322; .NET CLR 1.0.3705; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; x64; SV1; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; XMPP Tiscali Communicator v.10.0.2; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Netscape/8.0.4","Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.2; Windows NT 5.1; SV1; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90; Creative)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322; PeoplePal 6.2)","Mozilla/4.0 (compatible; MSIE 6.0; Windows XP)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; APC; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50215; InfoPath.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Deepnet Explorer 1.5.0; .NET CLR 1.0.3705)","Mozilla/4.0 (compatible- MSIE 6.0- Windows NT 5.1- SV1- .NET CLR 1.1.4322","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Media Center PC","Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler)","Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; Alexa Toolbar; (R1 1.5))","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; AMD64)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; AMD64)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Crazy Browser 2.0.0 Beta 1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)","Mozilla/4.0 (compatible; MSIE 6.0; Update a; AOL 6.0; Windows 98)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; YPC 3.0.2; .NET CLR 1.1.4322; yplus 4.4.02b)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.40607)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Babya Discoverer 8.0:","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Crazy Browser 1.0.5)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT) ::ELNSB50::000061100320025802a00111000000000507000 900000000","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2; Deepnet Explorer)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FREE; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)","Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90)","Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; .NET CLR 1.0.2914)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)","Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)","Mozilla/4.0 (compatible; MSIE 5.5; Windows 95; BCD2000)","Mozilla/4.0 (compatible; MSIE 4.01; Digital AlphaServer 1000A 4/233; Windows NT; Powered By 64-Bit Alpha Processor)","Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320)","Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)","Mozilla/1.22 (compatible; MSIE 2.0d; Windows NT)","Mozilla/4.0 (compatible; MSIE 5.0; Windows 3.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) NS8/0.9.6","Mozilla/4.79 [en] (Windows NT 5.0; U)","Mozilla/4.76 [en] (Windows NT 5.0; U)","Mozilla/0.91 Beta (Windows)","Mozilla/0.6 Beta (Windows)","Mozilla/4.7 (compatible; OffByOne; Windows 2000) Webster Pro V3.4","Opera/9.00 (Windows NT 4.0; U; en)","Opera/9.00 (Windows NT 5.1; U; en)","Opera/9.0 (Windows NT 5.1; U; en)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.0","Opera/8.01 (Windows NT 5.1)","Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.01","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)","Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.00","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.00","Opera/8.00 (Windows NT 5.1; U; en)","Opera/7.60 (Windows NT 5.2; U) [en] (IBM EVV/3.0/EAK01AG9/LE)","Opera/7.54 (Windows NT 5.1; U) [pl]","Opera/7.11 (Windows NT 5.1; U) [en]","Mozilla/4.0 (compatible; MSIE 6.0; Windows ME) Opera 7.11 [en]","Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.02 Bork-edition [en]","Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0 [en]","Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.0 [en]","Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 6.01 [en]","Mozilla/3.0 (compatible; WebCapture 2.0; Auto; Windows)","Mozilla/4.0 (compatible; Powermarks/3.5; Windows 95/98/2000/NT)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FREE; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; KTXN)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.50","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MRA 4.3 (build 01218); .NET CLR 1.1.4322)","Opera/9.01 (Windows NT 5.1; U; en)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.54 [en]","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MRA 4.6 (build 01425))","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.01","Opera/9.00 (Windows NT 5.1; U; ru)","Opera/9.0 (Windows NT 5.1; U; en)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; MRA 4.6 (build 01425); .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.01","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MRA 4.6 (build 01425); MRSPUTNIK 1, 5, 0, 19 SW)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1)");srand((float)microtime()*1000000);shuffle($uas);$currua=trim($uas[0]);if(mb_detect_encoding($keyword)=="UTF-8"){$keyword=trim($keyword);}else{$keyword=iconv(mb_detect_encoding($keyword),"UTF-8",$keyword);$keyword=trim($keyword);}$keyword=urlencode($keyword);$keyword=str_ireplace(" ","+",$keyword);$keyword=str_ireplace("_","+",$keyword);$keyword=str_ireplace("-","+",$keyword);$goodcontent=array();$lastcontent="";for($i=0;$i<=$ciclecount;$i++){$site="http://www.dogpile.com/search/web?qsi=".$i."1&q=".$keyword."&fcoid=4&fcop=results-bottom&fpid=2";$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$site);curl_setopt($ch,CURLOPT_HEADER,true);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);curl_setopt($ch,CURLOPT_USERAGENT,$currua);curl_setopt($ch,CURLOPT_REFERER,$site);$content=curl_exec($ch);$content=str_ireplace("\n"," ",$content);curl_close($ch);$regular="|class=\"resultDescription\">(.*)<\/div>|iU";preg_match_all($regular,$content,$matches);if(!empty($matches)){$tempgoodcontent=array_unique($matches[1]);$tempgoodcontent=implode(". ",$tempgoodcontent);$tempgoodcontent=str_ireplace(" ...","",$tempgoodcontent);$tempgoodcontent=str_ireplace("...","",$tempgoodcontent);$tempgoodcontent=str_ireplace("....","",$tempgoodcontent);$tempgoodcontent=str_ireplace("..","",$tempgoodcontent);$tempgoodcontent=str_ireplace("!.","!",$tempgoodcontent);$tempgoodcontent=str_ireplace("?.","?",$tempgoodcontent);if($lastcontent==$tempgoodcontent){break;}$lastcontent=$tempgoodcontent;$goodcontent[]=$tempgoodcontent.". ";}}$goodcontent=array_unique($goodcontent);$goodcontent=implode($goodcontent);$goodcontent=strip_tags_smart($goodcontent);if(mb_detect_encoding($goodcontent)=="UTF-8"){$goodcontent=trim($goodcontent);}else{$goodcontent=iconv(mb_detect_encoding($goodcontent),"UTF-8",$goodcontent);$goodcontent=trim($goodcontent);}return$goodcontent;}function getbingcontent($keyword,$ciclecount){if(empty($ciclecount)){$ciclecount=10;}global $whatlang;if(mb_detect_encoding($keyword)=="UTF-8"){$keyword=trim($keyword);}else{$keyword=iconv(mb_detect_encoding($keyword),"UTF-8",$keyword);$keyword=trim($keyword);}$keyword=urlencode($keyword);$keyword=str_ireplace(" ","+",$keyword);$keyword=str_ireplace("_","+",$keyword);$keyword=str_ireplace("-","+",$keyword);$goodcontent=array();$lastcontent="";for($i=0;$i<=$ciclecount;$i++){$site="http://www.bing.com/search?q=".$keyword."&qs=n&pq=".$keyword."&sc=1-14&sp=-1&sk=&first=".$i."1&FORM=PERE1&m=".$whatlang."&u=".$whatlang."&setmkt=".$whatlang."&setlang=".$whatlang."&setplang=".$whatlang;$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$site);curl_setopt($ch,CURLOPT_HEADER,true);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.17 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.17");curl_setopt($ch,CURLOPT_REFERER,$site);$content=curl_exec($ch);$content=str_ireplace("\n"," ",$content);curl_close($ch);$regular="|<\/span><\/div>

(.*)<\/p><\/div|iU";preg_match_all($regular,$content,$matches);if(empty($matches[1])){$regular="|<\/a><\/div>

(.*)<\/p><\/div|iU";preg_match_all($regular,$content,$matches);}if(!empty($matches)){$tempgoodcontent=array_unique($matches[1]);$tempgoodcontent=implode(". ",$tempgoodcontent);$tempgoodcontent=str_ireplace(" ...","",$tempgoodcontent);$tempgoodcontent=str_ireplace("...","",$tempgoodcontent);$tempgoodcontent=str_ireplace("....","",$tempgoodcontent);$tempgoodcontent=str_ireplace("..","",$tempgoodcontent);$tempgoodcontent=str_ireplace("!.","!",$tempgoodcontent);$tempgoodcontent=str_ireplace("?.","?",$tempgoodcontent);if($lastcontent==$tempgoodcontent){break;}$lastcontent=$tempgoodcontent;$goodcontent[]=$tempgoodcontent.". ";}}$goodcontent=array_unique($goodcontent);$goodcontent=implode($goodcontent);$goodcontent=strip_tags_smart($goodcontent);if(mb_detect_encoding($goodcontent)=="UTF-8"){$goodcontent=trim($goodcontent);}else{$goodcontent=iconv(mb_detect_encoding($goodcontent),"UTF-8",$goodcontent);$goodcontent=trim($goodcontent);}return$goodcontent;}function bingimages($keyword,$count,$size){global $whatlang;$uas=array("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; FDM)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Avant Browser [avantbrowser.com]; Hotbar 4.4.5.0)","Mozilla/4.61 [en] (X11; U; ) - BrowseX (2.0.0 Windows)","Mozilla/3.0 (x86 [en] Windows NT 5.1; Sun)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; KKman2.0)","Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)","Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0 ; .NET CLR 2.0.50215; SL Commerce Client v1.0; Tablet PC 2.0","Mozilla/6.0 (compatible; MSIE 7.0a1; Windows NT 5.2; SV1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; TheFreeDictionary.com; .NET CLR 1.1.4322; .NET CLR 1.0.3705; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; x64; SV1; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; XMPP Tiscali Communicator v.10.0.2; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Netscape/8.0.4","Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.2; Windows NT 5.1; SV1; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90; Creative)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322; PeoplePal 6.2)","Mozilla/4.0 (compatible; MSIE 6.0; Windows XP)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; APC; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50215; InfoPath.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Deepnet Explorer 1.5.0; .NET CLR 1.0.3705)","Mozilla/4.0 (compatible- MSIE 6.0- Windows NT 5.1- SV1- .NET CLR 1.1.4322","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Media Center PC","Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler)","Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; Alexa Toolbar; (R1 1.5))","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; AMD64)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; AMD64)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Crazy Browser 2.0.0 Beta 1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)","Mozilla/4.0 (compatible; MSIE 6.0; Update a; AOL 6.0; Windows 98)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; YPC 3.0.2; .NET CLR 1.1.4322; yplus 4.4.02b)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.40607)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Babya Discoverer 8.0:","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Crazy Browser 1.0.5)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT) ::ELNSB50::000061100320025802a00111000000000507000 900000000","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2; Deepnet Explorer)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FREE; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)","Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90)","Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; .NET CLR 1.0.2914)","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)","Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)","Mozilla/4.0 (compatible; MSIE 5.5; Windows 95; BCD2000)","Mozilla/4.0 (compatible; MSIE 4.01; Digital AlphaServer 1000A 4/233; Windows NT; Powered By 64-Bit Alpha Processor)","Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320)","Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)","Mozilla/1.22 (compatible; MSIE 2.0d; Windows NT)","Mozilla/4.0 (compatible; MSIE 5.0; Windows 3.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) NS8/0.9.6","Mozilla/4.79 [en] (Windows NT 5.0; U)","Mozilla/4.76 [en] (Windows NT 5.0; U)","Mozilla/0.91 Beta (Windows)","Mozilla/0.6 Beta (Windows)","Mozilla/4.7 (compatible; OffByOne; Windows 2000) Webster Pro V3.4","Opera/9.00 (Windows NT 4.0; U; en)","Opera/9.00 (Windows NT 5.1; U; en)","Opera/9.0 (Windows NT 5.1; U; en)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.0","Opera/8.01 (Windows NT 5.1)","Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.01","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)","Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.00","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.00","Opera/8.00 (Windows NT 5.1; U; en)","Opera/7.60 (Windows NT 5.2; U) [en] (IBM EVV/3.0/EAK01AG9/LE)","Opera/7.54 (Windows NT 5.1; U) [pl]","Opera/7.11 (Windows NT 5.1; U) [en]","Mozilla/4.0 (compatible; MSIE 6.0; Windows ME) Opera 7.11 [en]","Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.02 Bork-edition [en]","Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0 [en]","Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.0 [en]","Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 6.01 [en]","Mozilla/3.0 (compatible; WebCapture 2.0; Auto; Windows)","Mozilla/4.0 (compatible; Powermarks/3.5; Windows 95/98/2000/NT)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FREE; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; KTXN)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.50","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MRA 4.3 (build 01218); .NET CLR 1.1.4322)","Opera/9.01 (Windows NT 5.1; U; en)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.54 [en]","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MRA 4.6 (build 01425))","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.01","Opera/9.00 (Windows NT 5.1; U; ru)","Opera/9.0 (Windows NT 5.1; U; en)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; MRA 4.6 (build 01425); .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.01","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MRA 4.6 (build 01425); MRSPUTNIK 1, 5, 0, 19 SW)","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1)");srand((float)microtime()*1000000);shuffle($uas);$currua=trim($uas[0]);$result=array();$needadd="";$keyword=urlencode($keyword);if($count>0){if($size=="S"){$size="small";}elseif($size=="M"){$size="medium";}elseif($size=="L"){$size="large";}elseif($size=="VL"){$size="wallpaper";}$site="http://www.bing.com/images/search?ADLT=OFF&q=".$keyword."&qft=+filterui:imagesize-".$size."&FORM=R5IR1&setmkt=".$whatlang."&setlang=".$whatlang."&setplang=".$whatlang;$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$site);curl_setopt($ch,CURLOPT_HEADER,true);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);curl_setopt($ch,CURLOPT_USERAGENT,$currua);$content=curl_exec($ch);$content=str_ireplace("\n"," ",$content);curl_close($ch);$regular="|0){srand((float)microtime()*1000000);shuffle($matches[1]);if(count($matches[1])<$count){$needadd=$count-count($matches[1]);$count=count($matches[1]);}for($i=0;$i<=$count-1;$i++){$result[]=$matches[1][$i];}if(!empty($needadd)){for($i=0;$i<=$needadd-1;$i++){srand((float)microtime()*1000000);shuffle($matches[1]);$result[]=$matches[1][0];}}}}return$result;}function strip_tags_smart($s,array $allowable_tags=null,$is_format_spaces=true,array $pair_tags=array('script','style','map','iframe','frameset','object','applet','comment','button','textarea','select'),array $para_tags=array('p','td','th','li','h1','h2','h3','h4','h5','h6','div','form','title','pre')){static$_callback_type=false;static$_allowable_tags=array();static$_para_tags=array();static$re_attrs_fast_safe='(?![a-zA-Z\d]) #statement, which follows after a tag #correct attributes (?> [^>"\']+ | (?<=[\=\x20\r\n\t]|\xc2\xa0) "[^"]*" | (?<=[\=\x20\r\n\t]|\xc2\xa0) \'[^\']*\' )* #incorrect attributes [^>]*+';if(is_array($s)){if($_callback_type==='strip_tags'){$tag=strtolower($s[1]);if($_allowable_tags){if(array_key_exists($tag,$_allowable_tags))return$s[0];if(array_key_exists('<'.$tag.'>',$_allowable_tags)){if(substr($s[0],0,2)==='';if(substr($s[0],-2)==='/>')return'<'.$tag.' />';return'<'.$tag.'>';}}if($tag==='br')return"\r\n";if($_para_tags&&array_key_exists($tag,$_para_tags))return"\r\n\r\n";return'';}trigger_error('Unknown callback type "'.$_callback_type.'"!',E_USER_ERROR);}if(($pos=strpos($s,'<'))===false||strpos($s,'>',$pos)===false){return$s;}$length=strlen($s);$re_tags='~ <[/!]?+ ( [a-zA-Z][a-zA-Z\d]*+ (?>:[a-zA-Z][a-zA-Z\d]*+)? ) #1 '.$re_attrs_fast_safe.' > ~sxSX';$patterns=array('/<([\?\%]) .*? \\1>/sxSX','/<\!\[CDATA\[ .*? \]\]>/sxSX','/<\!--.*?-->/sSX','/ <\! (?:--)?+ \[ (?> [^\]"\']+ | "[^"]*" | \'[^\']*\' )* \] (?:--)?+ > /sxSX',);if($pair_tags){foreach($pair_tags as$k=>$v)$pair_tags[$k]=preg_quote($v,'/');$patterns[]='/ <((?i:'.implode('|',$pair_tags).'))'.$re_attrs_fast_safe.'(? .*? <\/(?i:\\1)'.$re_attrs_fast_safe.'> /sxSX';}$i=0;$max=99;while($i<$max){$s2=preg_replace($patterns,'',$s);if(preg_last_error()!==PREG_NO_ERROR){$i=999;break;}if($i==0){$is_html=($s2!=$s||preg_match($re_tags,$s2));if(preg_last_error()!==PREG_NO_ERROR){$i=999;break;}if($is_html){if($is_format_spaces){$s2=preg_replace('/ [\x09\x0a\x0c\x0d]++ | <((?i:pre|textarea))'.$re_attrs_fast_safe.'(? .+? <\/(?i:\\1)'.$re_attrs_fast_safe.'> \K /sxSX',' ',$s2);if(preg_last_error()!==PREG_NO_ERROR){$i=999;break;}}if($allowable_tags)$_allowable_tags=array_flip($allowable_tags);if($para_tags)$_para_tags=array_flip($para_tags);}}if(!empty($is_html)){$_callback_type='strip_tags';$s2=preg_replace_callback($re_tags,__FUNCTION__,$s2);$_callback_type=false;if(preg_last_error()!==PREG_NO_ERROR){$i=999;break;}}if($s===$s2)break;$s=$s2;$i++;}if($i>=$max)$s=strip_tags($s);if($is_format_spaces&&strlen($s)!==$length){$s=preg_replace('/\x20\x20++/sSX',' ',trim($s));$s=str_replace(array("\r\n\x20","\x20\r\n"),"\r\n",$s);$s=preg_replace('/[\r\n]{3,}+/sSX',"\r\n\r\n",$s);}return$s;}function contentrubook(){$site="http://rubook.org/new.php?f=1";$referer="http://www.yandex.ru";$useragent="Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.864.0 Safari/535.2";$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$site);curl_setopt($ch,CURLOPT_HEADER,true);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);curl_setopt($ch,CURLOPT_USERAGENT,$useragent);curl_setopt($ch,CURLOPT_REFERER,$referer);$content=curl_exec($ch);curl_close($ch);$regular="|href=\"http:\/\/rubook\.org\/book\.php\?book=([0-9]*)\">|iU";preg_match_all($regular,$content,$matches);srand((float)microtime()*1000000);shuffle($matches[1]);$bookurl="http://rubook.org/book.php?book=".$matches[1][0];$goodcontent=array();for($i=2;$i<=6;$i++){$n=$i-1;$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$bookurl."&page=".$i);curl_setopt($ch,CURLOPT_HEADER,true);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);curl_setopt($ch,CURLOPT_USERAGENT,$useragent);curl_setopt($ch,CURLOPT_REFERER,$referer);$content=curl_exec($ch);curl_close($ch);$content=str_ireplace("\n"," ",$content);$regular="|

(.*)<\/p><\/div>|iU";preg_match_all($regular,$content,$matches);$goodcontent[$n]=$matches[1][0];}$goodcontent=implode(" ",$goodcontent);$goodcontent=strip_tags($goodcontent);$goodcontent=explode(".",$goodcontent);srand((float)microtime()*1000000);shuffle($goodcontent);$goodcontent=implode(".",$goodcontent);$goodcontent=trim($goodcontent);return$goodcontent;}function tematickey_new($allkeys,$themes,$currkey,$count){$currkey=strtolower($currkey);if(!empty($themes)){$themes=strtolower($themes);$goodthemekeys=array();srand((float)microtime()*1000000);shuffle($allkeys);$themes=explode("\n",$themes);$dopthemekeysfmfiles=array();foreach($themes as$currthemeandtext){$currthemeandtext=explode("::",$currthemeandtext);$currtheme=trim($currthemeandtext[0]);if(count(array_intersect_key(array_flip(explode(",",trim($currtheme))),array_flip(explode(" ",trim($currkey)))))>=1){if(isset($currthemeandtext[2])){$dopthemekeysfmfiles=array_merge($dopthemekeysfmfiles,randomthemekeys($currthemeandtext[2]));}break;}else{$currtheme="";}}$i=0;if(!empty($currtheme)){foreach($allkeys as$k=>$testkey){$testkey=strtolower($testkey);if(count(array_intersect_key(array_flip(explode(",",trim($currtheme))),array_flip(explode(" ",trim($testkey)))))>=1){$goodthemekeys[]=trim($testkey);unset($allkeys[$k]);$i++;}if($i>=$count){break;}}if(!empty($goodthemekeys)){$goodthemekeys=array_merge($goodthemekeys,$dopthemekeysfmfiles);return$goodthemekeys;}else{return false;}}else{return false;}}else{return false;}}function tematickey_frurls($allkeys,$themes,$currkey,$count){$currkey=strtolower($currkey);if(!empty($themes)){$themes=strtolower($themes);$goodthemekeys=array();srand((float)microtime()*1000000);shuffle($allkeys);$themes=explode("\n",$themes);foreach($themes as$currthemeandtext){$currthemeandtext=explode("::",$currthemeandtext);$currtheme=trim($currthemeandtext[0]);if(count(array_intersect_key(array_flip(explode(",",trim($currtheme))),array_flip(explode(" ",trim($currkey)))))>=1){break;}else{$currtheme="";}}$i=0;if(!empty($currtheme)){foreach($allkeys as$k=>$testkey){$testkey=strtolower($testkey);if(count(array_intersect_key(array_flip(explode(",",trim($currtheme))),array_flip(explode(" ",trim($testkey)))))>=1){$goodthemekeys[]=trim($testkey);unset($allkeys[$k]);$i++;}if($i>=$count){break;}}if(!empty($goodthemekeys)){return$goodthemekeys;}else{return false;}}else{return false;}}else{return false;}}function codedata($data){$data=gzcompress(base64_encode(urlencode($data)),4);return urlencode($data);}function decodedata($data){return urldecode(base64_decode(gzuncompress(urldecode($data))));}function getsettings($settfile,$needsetting,$fileorcontent){if(empty($fileorcontent)){if(file_exists($settfile)){$settings=file_get_contents($settfile);}else{return"";}}else{$settings=$settfile;}$settings=urlencode($settings);$settings=trim($settings,"%0A");$settings.="%0A";if($needsetting=="clienturl"){preg_match("/clienturl%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$clienturl=$matches[1];$clienturl=trim($clienturl);return$clienturl;}else{return"";}}if($needsetting=="clearcache"){preg_match("/clearcache%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$clearcache=$matches[1];$clearcache=trim($clearcache);return$clearcache;}else{return"";}}if($needsetting=="newkeys"){preg_match("/newkeys%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$newkeys=$matches[1];$newkeys=trim($newkeys);return$newkeys;}else{return"";}}if($needsetting=="dotemplate"){preg_match("/dotemplate%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$dotemplate=$matches[1];$dotemplate=trim($dotemplate);return$dotemplate;}else{return"";}}if($needsetting=="newuseragents"){preg_match("/newuseragents%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$newuseragents=$matches[1];$newuseragents=trim($newuseragents);return$newuseragents;}else{return"";}}if($needsetting=="newbotips"){preg_match("/newbotips%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$newbotips=$matches[1];$newbotips=trim($newbotips);return$newbotips;}else{return"";}}if($needsetting=="newreffs"){preg_match("/newreffs%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$newreffs=$matches[1];$newreffs=trim($newreffs);return$newreffs;}else{return"";}}if($needsetting=="usecloack"){preg_match("/usecloack%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$usecloack=$matches[1];$usecloack=trim($usecloack);return$usecloack;}else{return"";}}if($needsetting=="itsinclude"){preg_match("/itsinclude%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$itsinclude=$matches[1];$itsinclude=trim($itsinclude);return$itsinclude;}else{return"";}}if($needsetting=="clienttype"){preg_match("/clienttype%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$clienttype=$matches[1];$clienttype=trim($clienttype);return$clienttype;}else{return"";}}if($needsetting=="lang"){preg_match("/lang%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$lang=$matches[1];$lang=trim($lang);return$lang;}else{return"";}}if($needsetting=="wherecontent"){preg_match("/wherecontent%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$wherecontent=$matches[1];$wherecontent=trim($wherecontent);return$wherecontent;}else{return"";}}if($needsetting=="textfilename"){preg_match("/textfilename%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$textfilename=$matches[1];$textfilename=trim($textfilename);return$textfilename;}else{return"";}}if($needsetting=="keyfilename"){preg_match("/keyfilename%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$keyfilename=$matches[1];$keyfilename=trim($keyfilename);return$keyfilename;}else{return"";}}if($needsetting=="themesfilename"){preg_match("/themesfilename%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$themesfilename=$matches[1];$themesfilename=trim($themesfilename);return$themesfilename;}else{return"";}}if($needsetting=="templatename"){preg_match("/templatename%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$templatename=$matches[1];$templatename=trim($templatename);return$templatename;}else{return"";}}if($needsetting=="extlinksfilename"){preg_match("/extlinksfilename%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$extlinksfilename=$matches[1];$extlinksfilename=trim($extlinksfilename);return$extlinksfilename;}else{return"";}}if($needsetting=="keyperem"){preg_match("/keyperem%3D(.*)%0A/miU",$settings,$matches);if(!empty($matches[1])){$keyperem=$matches[1];$keyperem=trim($keyperem);return$keyperem;}else{return"";}}if($needsetting=="redirect"){preg_match("/redirect%3D(.*)ENDOFREDIRECT%0A/miU",$settings,$matches);if(!empty($matches[1])){$redirect=$matches[1];$redirect=trim($redirect);return$redirect;}else{return"";}}return"";}function licensefrpdf($servurl){if(mb_detect_encoding($servurl)=="UTF-8"){$servurl=trim($servurl);}else{$servurl=iconv(mb_detect_encoding($servurl),"UTF-8",$servurl);$servurl=trim($servurl);}$goodservurl=array();foreach(str_split(base64_encode(urlencode($servurl))) as$onechar){if(is_numeric($onechar)){$onechar=$onechar+7;if($onechar>9){$onechar=$onechar-10;}}$goodservurl[]=$onechar;}return implode($goodservurl);}function randomthemekeys($themekeyfilenames){$themekeyfilenames=trim($themekeyfilenames);$themekeyfilenames=explode(",",$themekeyfilenames);$resultkeys=array();foreach($themekeyfilenames as$themekeyfilename){$themekeyfilename=trim($themekeyfilename);$themekeyfilename=explode("|",$themekeyfilename);$currfilename=trim($themekeyfilename[0]);$keyscount=rand(trim($themekeyfilename[1]),trim($themekeyfilename[2]));if(file_exists("workdir/keys/".$currfilename)){$hendel=fopen("workdir/keys/".$currfilename,'r+');$cLineCount=0;while(!feof($hendel)){$cLineCount++;fgets($hendel);}fclose($hendel);$randlinenums=array();for($i=0;$i<=$keyscount-1;$i++){$randlinenums[]=rand(1,$cLineCount);}$hendel=fopen("workdir/keys/".$currfilename,'r+');if(!$hendel)return"";$currlinenum=0;while(!feof($hendel)){$currlinenum++;$templine=fgets($hendel);foreach($randlinenums as$randlinenum){if($randlinenum==$currlinenum){$templine=trim($templine);$resultkeys[]=trim($templine);}}}fclose($hendel);}}return$resultkeys;}function tematickey_text($themes,$currkey){$themetext="";$currkey=strtolower($currkey);if(!empty($themes)){$themes=strtolower($themes);$themes=explode("\n",$themes);foreach($themes as$currthemeandtext){$currthemeandtext=explode("::",$currthemeandtext);$currtheme=trim($currthemeandtext[0]);if(count(array_intersect_key(array_flip(explode(",",trim($currtheme))),array_flip(explode(" ",trim($currkey)))))>=1){if(isset($currthemeandtext[1])&&!empty($currthemeandtext[1])){$themetext=trim($currthemeandtext[1]);}else{$themetext="";}break;}else{$themetext="";}}return$themetext;}else{return false;}}function getextlinkarray($extlinkspath,$needcount){$ofile=$extlinkspath;$neednums=array();$goodresult=array();if(!empty($ofile)){$handle=fopen($ofile,"r");$n=0;while(!feof($handle)){fgets($handle);$n++;}fclose($handle);for($i=1;$i<=$needcount;$i++){$neednums[]=rand(1,$n);}$handle=fopen($ofile,"r");$i=1;while(!feof($handle)){$goodline=fgets($handle);if(in_array($i,$neednums)){$goodresult[]=$goodline;if(count($goodresult)==$needcount){break;}}$i++;}fclose($handle);return$goodresult;}else{return false;}}function getgentext($keyword,$sentcount){$keyword=trim($keyword);$tempsentences=array();$sentences=file("workdir/workfiles/1.txt");$adj=file("workdir/workfiles/2.txt");$nouns_hum=file("workdir/workfiles/5.txt");$adv=file("workdir/workfiles/3.txt");$noun_body=file("workdir/workfiles/4.txt");$verb=file("workdir/workfiles/6.txt");$noun_hum=file("workdir/workfiles/7.txt");for($i=0;$i<=$sentcount-1;$i++){srand((float)microtime()*1000000);shuffle($sentences);$cursent=trim(decodedata($sentences[0]));$tempsentences[]=$cursent;}$tempsentences=implode(" ",$tempsentences);if(substr_count($tempsentences,"")>=1){srand((float)microtime()*1000000);shuffle($adj);$howmany=substr_count($tempsentences,"");for($i=0;$i<=$howmany;$i++){if($i==50){srand((float)microtime()*1000000);shuffle($adj);}$tempsentences=preg_replace("//",trim(decodedata($adj[$i])),$tempsentences,1);}unset($adj);}if(substr_count($tempsentences,"")>=1){srand((float)microtime()*1000000);shuffle($nouns_hum);$howmany=substr_count($tempsentences,"");for($i=0;$i<=$howmany;$i++){if($i==50){srand((float)microtime()*1000000);shuffle($nouns_hum);}$tempsentences=preg_replace("//",trim(decodedata($nouns_hum[$i])),$tempsentences,1);}unset($nouns_hum);}if(substr_count($tempsentences,"")>=1){srand((float)microtime()*1000000);shuffle($adv);$howmany=substr_count($tempsentences,"");for($i=0;$i<=$howmany;$i++){if($i==50){srand((float)microtime()*1000000);shuffle($adv);}$tempsentences=preg_replace("//",trim(decodedata($adv[$i])),$tempsentences,1);}unset($adv);}if(substr_count($tempsentences,"")>=1){srand((float)microtime()*1000000);shuffle($noun_body);$howmany=substr_count($tempsentences,"");for($i=0;$i<=$howmany;$i++){if($i==50){srand((float)microtime()*1000000);shuffle($noun_body);}$tempsentences=preg_replace("//",trim(decodedata($noun_body[$i])),$tempsentences,1);}unset($noun_body);}if(substr_count($tempsentences,"")>=1){srand((float)microtime()*1000000);shuffle($verb);$howmany=substr_count($tempsentences,"");for($i=0;$i<=$howmany;$i++){if($i==50){srand((float)microtime()*1000000);shuffle($verb);}$tempsentences=preg_replace("//",trim(decodedata($verb[$i])),$tempsentences,1);}unset($verb);}if(substr_count($tempsentences,"")>=1){srand((float)microtime()*1000000);shuffle($noun_hum);$howmany=substr_count($tempsentences,"");for($i=0;$i<=$howmany;$i++){if($i==50){srand((float)microtime()*1000000);shuffle($noun_hum);}$tempsentences=preg_replace("//",trim(decodedata($noun_hum[$i])),$tempsentences,1);}unset($noun_hum);}$tempsentences=str_ireplace("","",$tempsentences);$tempsentences=str_ireplace("","",$tempsentences);$tempsentences=str_ireplace(" "," ",$tempsentences);$goodsentences=@iconv('utf-8','utf-8//IGNORE',$tempsentences);unset($tempsentences);$goodsentencestemp=$goodsentences;$goodsentences=gtranslate($goodsentences,'auto','es');$needlang=$goodsentences[1];$goodsentences=$goodsentences[0];$goodsentences=gtranslate($goodsentences,'auto',$needlang);$goodsentences=$goodsentences[0];if(empty($goodsentences)){$goodsentences=$goodsentencestemp;}return$goodsentences;}function gtranslate($str,$lang_from,$lang_to){$query_data=array('client'=>'x','q'=>$str,'sl'=>$lang_from,'tl'=>$lang_to);$filename='http://translate.google.ru/translate_a/t';$options=array('http'=>array('user_agent'=>'Mozilla/5.0 (Windows NT 6.0; rv:26.0) Gecko/20100101 Firefox/26.0','method'=>'POST','header'=>'Content-type: application/x-www-form-urlencoded','content'=>http_build_query($query_data)));$context=stream_context_create($options);$response=file_get_contents($filename,false,$context);return json_decode($response);};?>