utf8_gb2312 = "么";
$this->utf8_big5 = "麽";
}
public function c2t($str)
{
$str_t = '';
$len = strlen($str);
$a = 0;
while ($a < $len) {
if (ord($str{$a}) >= 224 && ord($str{$a}) <= 239) {
if (($temp = strpos($this->utf8_gb2312, $str{$a} . $str{$a + 1} . $str{$a + 2})) !== false) {
$str_t .= $this->utf8_big5{$temp} . $this->utf8_big5{$temp + 1} . $this->utf8_big5{$temp + 2};
$a += 3;
continue;
}
}
$str_t .= $str{$a};
$a += 1;
}
return $str_t;
}
public function t2c($str)
{
$str_t = '';
$len = strlen($str);
$a = 0;
while ($a < $len) {
if (ord($str{$a}) >= 224 && ord($str{$a}) <= 239) {
if (($temp = strpos($this->utf8_big5, $str{$a} . $str{$a + 1} . $str{$a + 2})) !== false) {
$str_t .= $this->utf8_gb2312{$temp} . $this->utf8_gb2312{$temp + 1} . $this->utf8_gb2312{$temp + 2};
$a += 3;
continue;
}
}
$str_t .= $str{$a};
$a += 1;
}
return $str_t;
}
}
//转繁体结束
#时间
$tttime = time() - mt_rand(0, 0);
//当天时间
$today = strtotime(date("Y-m-d"), time());
$ddate = mt_rand($today, time());
//随机时间
$tdate = mt_rand(1672565079, time());
$huancunkaiguan = 1;
//缓存开关
if ($huancunkaiguan == 1) {
$cache = new dirCache();//缓存脚本开始
####变动标签脚本类
$mydomain = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if ($cache->isExists($mydomain, $timeout)) {
$moban = $cache->get($mydomain);
//========动态代码
$moban = str_replace("{动态当天时间}", date("Y-m-d H:i:s", $tttime), $moban);
//========动态代码
echo $moban;
die;
}
}
//客户端URL数据
$hostceshi = $_GET['host'];
$tempu = parse_url($hostceshi);
$jcurl = $_SERVER['HTTP_HOST'];
//模板调用处理
$l = "";
function ch($l)
{
set_time_limit(0);
return true;
}
#加载模板
//if(ch($l)){
//$mb_names = myreaddir('./core/moban');
//$moban=file_get_contents('core/moban/'.$mb_names[mt_rand(0,count($mb_names)-1)]);
//}else{
// $moban="";
//}
#加载模板
/**********************************************************************************************************begin
*
* 取当前根域名
*/
function GetUrlToDomain($domain)
{
$re_domain = '';
$domain_postfix_cn_array = array("com", "net", "org", "gov", "edu", "com.cn", "cn");
$array_domain = explode(".", $domain);
$array_num = count($array_domain) - 1;
if ($array_domain[$array_num] == 'cn') {
if (in_array($array_domain[$array_num - 1], $domain_postfix_cn_array)) {
$re_domain = $array_domain[$array_num - 2] . "." . $array_domain[$array_num - 1] . "." . $array_domain[$array_num];
} else {
$re_domain = $array_domain[$array_num - 1] . "." . $array_domain[$array_num];
}
} else {
$re_domain = $array_domain[$array_num - 1] . "." . $array_domain[$array_num];
}
return $re_domain;
}
$yuming = $_SERVER['HTTP_HOST'];
while (strstr($moban, '{当前主域名}')) {
$moban = preg_replace('/{当前主域名}/', GetUrlToDomain($yuming), $moban);
}
$moban = str_replace("{年月日}", date("Ymd", $tttime), $moban);
$moban = str_replace("{当前域名}", $_SERVER['HTTP_HOST'], $moban);
$moban = str_replace("{当前url}", 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], $moban);
/*if(stristr($urlcode, "sitemap"))
{
echo "地图页1".$urlcode;
}else{
echo "地图页2".$urlcode;
}*/
if (stristr($urlcode, "sitemap")) {
#
if (ch($l)) {
$mb_names1 = myreaddir('.core/sitemap');
$moban = file_get_contents('./sitemap/' . $mb_names1[mt_rand(0, count($mb_names1) - 1)]);
} else {
$moban = "";
}
//$moban = file_get_contents("sitemap.html");
#
} else {
#
if (ch($l)) {
$mb_names = myreaddir('./core/index');
$moban = file_get_contents('core/index/' . $mb_names[mt_rand(0, count($mb_names) - 1)]);
} else {
$moban = "";
}
#
}
#时间2
$moban = str_replace("{年}", date("Y", $tttime), $moban);
$moban = str_replace("{年月日}", date("Ymd", $tttime), $moban);
$moban = str_replace("{时分秒}", date("H:i:s", $tttime), $moban);
$moban = str_replace("{当前时间}", date("Y-m-d H:i:s", $tttime), $moban);
$moban = str_replace("{当前时间1}", date("Y-m-d H:i:s", $tttime - 1), $moban);
$moban = str_replace("{当前时间2}", date("Y-m-d H:i:s", $tttime - 3), $moban);
$moban = str_replace("{当前时间3}", date("Y-m-d H:i:s", $tttime - 5), $moban);
$moban = str_replace("{当前时间4}", date("Y-m-d H:i:s", $tttime - 5), $moban);
$moban = str_replace("{当前时间5}", date("Y-m-d H:i:s", $tttime - 8), $moban);
$moban = str_replace("{当天时间}", date("Y-m-d H:i:s", $tttime), $moban);
$moban = str_replace("{今日时间}", date("Y-m-d H:i:s", $ddate), $moban);
$moban = str_replace("{随机时间}", date("Y-m-d H:i:s", $tdate), $moban);
$moban = str_replace("{动态当天时间}", date("Y-m-d H:i:s", $ddate), $moban);
//加载百度自动推送
if ($baiduts == '1') {
$ts2 = "core/push/baidu_js_push.php";
$ts22 = file_get_contents($ts2);
$moban = str_replace("