window.location.href='".$link."';"); exit(); } if(!is_file($template)){ echo "系统维护中,请稍侯..."; exit(); } //获取模板内容 $html = file_get_contents($template); //替换并得到模板内容 $temp_content = preg_replace_callback('/\{\{\$([a-z0-9_]+)\}\}/', replace_template, $html); if( $lang == "big5" ){ $chs = new Chinese("GB2312", "BIG5", $temp_content); $temp_content = $chs->ConvertIT(); } echo $temp_content; /** * 获取二级域名目录 */ function getServerName($serverName) { $pos = strpos($serverName, "/news/"); $pos1 = strpos($serverName, "/", $pos + 1 + strlen("/news/")); return substr($serverName, $pos + strlen("/news/") - 1, $pos1 - $pos - strlen("/news/") + 1); } /** * 显示频道首页 * */ function get_channel_page($webpage_path, $webpage_big5_path) { $server_name = $_SERVER['SERVER_NAME']; $scrip_name = $_SERVER['SCRIPT_FILENAME']; if(strpos($scrip_name,"/news/") > 0){ $server_name .= getServerName($scrip_name); } global $lang ; global $type; if(strpos($server_name, "digest")> 0) $type = "article_"; if(strpos($server_name, "blog") > 0) $type = "blog_"; return ($lang == "big5" ) ? $webpage_big5_path[$server_name] : $webpage_path[$server_name]; } function get_link($r) { $pos = strpos($r,"&nlink="); if($pos > 0) { $link = substr($r, $pos + 7); $link = urldecode($link); str_replace("&", "&", $link); str_replace("&", "&", $link); } return $link; } ?>