<?	

// 各模板都需要替换的的东西
// <link rel="alternate" href="https://es.growinbiotech.com" hreflang="es" /> 语种指示

	$ls_author=date("Y", strtotime("-60 days"))."蓝信科技" ."lanscend.net.txt";
	$ls_weburl=$ls_canonical;
	$ls_year=date("Y");
	$ls_startyear=(trim($row['MSN2'])==""?"":$row['MSN2']." - "); // startyear

	$alltrans=explode(",",$transFlags);
	$langbutton="";
	$hreflangstr = "";
	$thisurl=$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],"/ls_admin"));
	$ls_weburl=str_replace($_SERVER['SERVER_NAME'],$thisurl ,$ls_weburl);
	//echo $thisurl;
	foreach($alltrans as $eachtrans )
	{
		$ls_weburl1=$ls_weburl;
		$eachtrans=trim($eachtrans);
		$thisurl1=$_SESSION['landir']==""?$thisurl:substr($thisurl,0,(strlen($thisurl)-3));
		$ls_weburl1=str_replace($thisurl,$thisurl1."/". $eachtrans ,$ls_weburl1);
		
		$hreflangstr = $hreflangstr==""?"":$hreflangstr."\r\n";  // 英文页面中的其他语种 hreflang 指示
		if($eachtrans!="")	 $hreflangstr.='<link rel="alternate" href="http://'. $ls_weburl1.'/" hreflang="'. $eachtrans .'" />';
		else  $hreflangstr=""; 
		 
		$langbutton.=' <a hreflang="'. $eachtrans .'" href="http://'. $ls_weburl1 .'/"><img src="http://'.$thisurl.'/ls_admin/img/gq/'. $eachtrans .'.jpg" height="22" /></a>';  // 多语种按钮
		
	}
	
	 
	if(!strpos($filename,"index.html")===false) $ls_canonical=$ls_canonical."/index.html";
 	if(!(strpos($ls_canonical,":") ===false))  //增加多语种指示标签
		{ $ls_canonical=$hreflangstr."\r\n"; 		}
		else
		{ 	
			//$ls_canonical=str_replace($ls_weburl,$ls_weburl.'/'.$eachtrans , $ls_canonical);
			$ls_canonical= $_SESSION['landir']!=""?str_replace($thisurl,$thisurl."/". $_SESSION['landir'] ,$ls_canonical):$ls_canonical;
			$ls_canonical= $hreflangstr."\r\n"."<link rel=\"canonical\" href=\"http://".$ls_canonical."\" />"."\r\n";}
		
		if((strpos($ls_canonical,"192.168.2") ===false))
		{ 	$ls_canonical.='<Meta http-equiv="Cache-Control" Content="max-age=2592000">';  // 1个月
	}
		else
		{ $ls_canonical.='<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">';}
		//echo $ls_canonical;
	$content = str_replace("{langbutton}",$langbutton,$content);  //语言按钮
	$content = str_replace("{ls_canonical}",$ls_canonical,$content);

	if($ls_sitebrand==""){
		$tem_sql="select * from ls_config order by ID";	
		$tem_query=$opendb->query($tem_sql);
		$config_row=mysql_fetch_array($tem_query);
		$ls_sitebrand= $config_row['MSN4']; // 品牌
	}
	//{ls_searchkwds} search keywords标签，可提供优化外链
	$keywords_sql = "select * from ls_config";
	$keywords_query = $opendb->query($keywords_sql);
	$keywords_value = mysql_fetch_assoc($keywords_query);
	$keywords = explode(",",$keywords_value['bottomMenu']);
	
	$ls_searchkwds = "";
	for($index = 0; $index < count($keywords); $index++){
		$ls_searchkwds .= "<a href=\"_".trim($keywords[$index]).".html\">".trim($keywords[$index])."</a> &nbsp; ";
	}

	
	
	// 2 $ls_schema
	if(strpos($filename,"index.html")===false) $ls_schema=$ls_schema_article; else $ls_schema=$ls_schema_index;
	$ls_schema=str_replace("{ls_title}",$ls_title==""?$ls_protitle:$ls_title,$ls_schema);	
 	$ls_schema=str_replace("{ls_description}",$ls_description,$ls_schema);	
	$ls_schema=str_replace("{ls_website}","https://".$ls_weburl,$ls_schema);	
	$ls_schema=str_replace("{ls_sitebrand}",$ls_sitebrand,$ls_schema);	
	$ls_schema=str_replace("{ls_currURL}","https://".$ls_weburl,$ls_schema);	
	$ls_schema=str_replace("{ls_proname_nonintegrate}",$ls_proname_nonintegrate,$ls_schema);	
	$ls_schema=str_replace("{ls_currTime}",date('Y-m-d H:i:s'),$ls_schema);	
	$ls_schema=str_replace("{ls_proshow}",$ls_proshow,$ls_schema);	
	$ls_schema=str_replace("{ls_proshow_width}",$showBigPicW,$ls_schema);	
	$ls_schema=str_replace("{ls_proshow_height}",$showBigPicH,$ls_schema);	

	//  constant.php
	$content = str_replace("{ls_schema}",$ls_schema,$content);	
	$content = str_replace("{ls_author}",$ls_author,$content);	
	$content = str_replace("{ls_year}",$ls_year,$content);	
	
	$content = str_replace("{ls_addprolink}",$ls_addprolink,$content);
	$content = str_replace("{ls_startyear}",$ls_startyear,$content);	
	$content = str_replace("{ls_searchkwds}",$ls_searchkwds,$content);	
	$content=strippattern($content); //删除注释

?>