<?php
// $ls="all" 生成全部，不包含产品页； $ls!="all_products" 生成全部，包含产品页；
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

header("Pragma: no-cache");
$_SESSION['transTotal']=0;  //翻译字符计数
$_SESSION['transfast']=0;  //快表条数
$_SESSION['transfastTotal']=0;  //快表字数
$_SESSION['transslow']=0;  //慢表条数
$_SESSION['transslowTotal']=0;  //慢表字数 

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/admin.css" rel="stylesheet" type="text/css">
<title>无标题文档</title>
</head>
<body>
<table width="96%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6396d6">
  <tr>
    <td height="18" background="images/admin_bg.gif"><div align="center"><font color="#ffffff"><strong><a href="" onclick="history.go(0);">模板管理</a></strong></font></div></td>
  </tr>
  <tr>
    <td height="213" valign="top" bgcolor="#dee7ff"><br />
      <table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
        <tr bgcolor="#B9DAFF">
          <td style="padding-left:10px;" >
<?php
	require_once('inc/conn.php');
	require_once('inc/constant.php');
	require_once('inc/public.php'); //main menu & left menu
	require_once('inc/ls_syscode.php');
	require_once('inc/ls_m_syscode.php');
	
	$ls=$_GET['ls'];
	$translates=$_GET['translate'];   //翻译参数
	$cateid=$_GET['cateid'];
	$cateFolders=$_GET['cateFolders'];
	$midcateid=$_GET['midcateid'];
	$midcateFolders=$_GET['midcateFolders'];
	$subcateid=$_GET['subcateid'];
	$subcateFolders=$_GET['subcateFolders'];
	$menuListscateid=$_GET['menuListscateid'];	//global ver in ls_syscode
	//主菜单 start
	// public.php
	//主菜单 end
	
	//左侧产品类别 Start
	// public.php	
	//左侧产品类别 End
	
	//产品页面左侧产品类别 Start
	// public.php
	//左侧产品页面产品类别 End
	
	$tem_sql="select * from ls_config order by ID";	
	$tem_query=$opendb->query($tem_sql);
	$config_row=mysql_fetch_array($tem_query);
	//print_r($row);exit;
	$templates_var = $config_row['templates'];
	
	$mobi_tem_sql="select * from ls_mobiconfig order by ID";	
	$mobi_tem_query=$opendb->query($mobi_tem_sql);
	$mobi_row=mysql_fetch_array($mobi_tem_query);
	$mobi_templates_var = $mobi_templates;
	
	if($lang != "en"){
		$lan = $lang_cn;
	}else{
		$lan = $lang_en;
	}
	
//类产品展示 Start, selectPic 或者默认 后台每类选择图片 文字水命并排序
if($ls_classproType=="selectPic" || $ls_classproType=="")
{

	$products_sql="select * from ls_products where branchID=0 and  midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and AdditionalAttributesClassPro&1 and enable=1";
	$products_sql.=" order by NoClassPro asc";
	$products_query=$opendb->query($products_sql);
	$classpro="";
	while($products_rows=mysql_fetch_assoc($products_query)){
					
		if(hassameclass($products_rows['productID'])){
			continue;
		}
		
		$p_id = $products_rows['productID'];
		$sql2 = "select * from ls_products where ID = ".$p_id." ";
		$products_query2=$opendb->query($sql2);
		
		$catename_query = mysql_fetch_assoc($products_query2);
		if(!$catename_query['subcateName']){
			if(!$catename_query['midcateName']){
				//只有大类
				$class_name = $catename_query['cateName'];
			}else{
				//有大类、有中类
				//获得关于中类的记录
				$search_catename2 = "SELECT * FROM ls_products WHERE ID={$catename_query[midcateID]}";
				$catename_query2 = mysql_fetch_assoc($opendb->query($search_catename2));
				
				$class_name = $catename_query['midcateName'];
			}
		}else{
			//有大类、有中类、有小类
			//获得关于中类的记录
			$search_catename2 = "SELECT * FROM ls_products WHERE ID={$catename_query[subcateID]}";
			$catename_query2 = mysql_fetch_assoc($opendb->query($search_catename2));
			
			//获得关于大类的记录
			$search_catename3 = "SELECT * FROM ls_products WHERE ID={$catename_query2[midcateID]}";
			$catename_query3 = mysql_fetch_assoc($opendb->query($search_catename3));
			
			$class_name = $catename_query['subcateName'];
		}
		
		
		$profile=getproductfolder($products_rows['productID']);
		$prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
	//$prolink=$profile."/".$showproductsFolders."/".trim(str_replace(substr($products_rows['productPic'],-4),"",$products_rows['productPic'])).".html"; 原来类产品链接
		$prolink=$profile."/index.html";//类分类的链接
		$classpro.="<li><a href=\"".$prolink."\" ><img src=\"".$prosrc."\" width=\"188\" height=\"188\" border=\"0\" alt=\"".$class_name."\" title=\"".$class_name."\"></a><span>".$class_name."</span></li>";
	}		
}	
	
	//类产品展示 End
	
	//类产品展示 Start
	//默认 $ls_classproType="picIntro" 或空 是图片列表
	if($ls_classproType=="pic" )
	{
		$products_sql="select * from ls_products where branchID=0 and midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and AdditionalAttributesClassPro&1 and enable=1";
		$products_sql.=" order by NoClassPro asc";
		$products_query=$opendb->query($products_sql);
		$classpro="";
		while($products_rows=mysql_fetch_assoc($products_query)){
					
			if(hassameclass($products_rows['productID'])){
			continue;
			}
		
			$p_id = $products_rows['productID'];
			$sql2 = "select * from ls_products where ID = ".$p_id." ";
			$products_query2=$opendb->query($sql2);
			$products_rows2=mysql_fetch_assoc($products_query2);
			
			$class_name = "";
			if($products_rows2['cateBrief'] != null){
				$class_name = $products_rows2['cateName'];
			}elseif($products_rows2['midcateBrief'] != null){
				$class_name = $products_rows2['midcateName'];
			}elseif($products_rows2['subcateBrief'] != null){
				$class_name = $products_rows2['subcateName'];
			}
			
			$pro_i++;
			$profile=getproductfolder($products_rows['productID']);
			$prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
					//$prolink=$profile."/".$showproductsFolders."/".trim(str_replace(substr($products_rows['productPic'],-4),"",$products_rows['productPic'])).".html"; 原来类产品链接
			$prolink=$profile."/index.html";//类分类的链接
			$classpro.="<li><a href=\"".$prolink."\" ><img src=\"".$prosrc."\" width=\"188\" height=\"188\" border=\"0\" alt=\"".$class_name."\" title=\"".$class_name."\"></a><span>".$class_name."</span></li>";
		}		
	}
	
// $ls_classproType="picIntro" 是图片文字列表
if($ls_classproType=="picIntro")
	{
		$s_classpro="";
		$classpro_sql="select * from ls_products where branchID=0 and  midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
		$classpro_query=$opendb->query($classpro_sql);
		//$s_classpro="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
		$s_classpro.="<ul class=\"classpro_list\">";
		while($classpro_rows=mysql_fetch_assoc($classpro_query))
		{
		  $pro_midcate_sql="select * from ls_products where branchID=0 and cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$classpro_rows['ID']." order by Num asc";
		  $pro_midcate_query=$opendb->query($pro_midcate_sql);
		  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
		  if($pro_midcate_num==0)//大类
		  {
		//$s_classpro.="&nbsp;<img src='../Templates/images/cate.gif' border='0'> \n";
		//$s_classpro.="\n<dt>".$classpro_rows['cateName']."</dt>";
			////
			if($classpro_rows['ID']=="")continue; //没有跳过循环
			$product_class_rows=get_product_class_rows($classpro_rows['ID']);
			$product_class_piclink=getpiclink($product_class_rows['ID'],$product_class_rows['productPic']); //
			//echo $classpro_rows['ID']."--".$product_class_piclink['picsrc']; // /thumbnails/1361107436.jpg  带/
			
			if($product_class_piclink['picsrc'] == null){
				$s_classpro.="<li class=\"class_dt\"><a href=\"../".$classpro_rows['cateFolders']."/index.html\"><img src='ls_admin/images/NoPictures_en.jpg' width='".$ls_classproPicW."' alt='".$classpro_rows['cateName']."' title='".$classpro_rows['cateName']."'  border='0'></a> <a id='classpro_list_a2' href=\"../".$classpro_rows['cateFolders']."/index.html\"><strong>".$classpro_rows['cateName']."</strong></a></li> \r\n";	
			}else{
				$s_classpro.="<li class=\"class_dt\"><a href=\"../".$classpro_rows['cateFolders']."/index.html\"><img src='../".$classpro_rows['cateFolders'].$product_class_piclink['picsrc']."' width='".$ls_classproPicW."' alt='".$classpro_rows['cateName']."' title='".$classpro_rows['cateName']."'  border='0'></a> <a id='classpro_list_a2' href=\"../".$classpro_rows['cateFolders']."/index.html\"><strong>".$classpro_rows['cateName']."</strong></a></li> \r\n";	
			}

			// $s_classpro.="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
		  } 
		  else//大类中类
		  {
			//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";  //大类引导图
			$detailsfile="../".$classpro_rows['cateFolders']."/indexdetails.html";
			if(file_exists($detailsfile))
			{$s_classpro.=" <dt><a href='".$detailsfile."'>".$classpro_rows['cateName']."</a></dt>\r\n";}
			else
			{
				if($classpro_rows['ID']=="")continue; //没有跳过循环

				$product_class_rows=get_product_class_rows($classpro_rows['ID']);
				$product_class_piclink=getpiclink($product_class_rows['ID'],$product_class_rows['productPic']);
				//echo $product_class_piclink['picsrc'];
			
				//$s_classpro.="<li id=\"classpro_list_li_title\"> <strong>".$classpro_rows['cateName']."</strong></li> \r\n";	
				//有图：
				//$s_classpro.="<li class=\"class_dt\"><img src='../".$classpro_rows['cateFolders'].$product_class_piclink['picsrc']."' width='".$ls_classproPicW."' border='0'> <strong>".$classpro_rows['cateName']."</strong></li> \r\n";	
			}

				//$s_classpro.=" <li class=\"class_dt\"><img src='../".$templates_var."/images/006.gif' width='12' border='0'> <strong>".$classpro_rows['cateName']."</strong><ul>\r\n";}
		
				//？ 不应该有$s_classpro.="\n <div class=\"cate_list\">\n";
				while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))
				{
					$pro_subcate_sql="select * from ls_products where branchID=0 and midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and subcateID=".$pro_midcate_rows['ID']." order by Num asc";
					$pro_subcate_query=$opendb->query($pro_subcate_sql);
					$pro_subcate_num=mysql_num_rows($pro_subcate_query); 

				//$s_classpro.="<div class=\"midcate_list\">"; //中类菜单样式
	
					if($pro_subcate_num==0)//没小类
					{
						if($pro_midcate_rows['ID']=="")continue; //没有跳过循环

						$product_class_rows=get_product_class_rows($pro_midcate_rows['ID']);
						$product_class_piclink=getpiclink($product_class_rows['ID'],$product_class_rows['productPic']);
						
						if($product_class_piclink['picsrc'] == null){
							$s_classpro.="<li class=\"class_dt\"> <a href='../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders']."/index.html'><img src='ls_admin/images/NoPictures_en.jpg' width='".$ls_classproPicW."' alt='".$pro_midcate_rows['midcateName']."' title='".$pro_midcate_rows['midcateName']."' border='0'></a>  <a id='classpro_list_a2' href='../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders']."/index.html'><strong>".$pro_midcate_rows['midcateName']."</strong></a></li> \r\n";
						}else{
							$s_classpro.="<li class=\"class_dt\"> <a href='../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders']."/index.html'><img src='../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders'].$product_class_piclink['picsrc']."' width='".$ls_classproPicW."'  alt='".$pro_midcate_rows['midcateName']."' title='".$pro_midcate_rows['midcateName']."' border='0'></a>  <a id='classpro_list_a2' href='../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders']."/index.html'><strong>".$pro_midcate_rows['midcateName']."</strong></a></li> \r\n";
						}

					//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";  //中类引导图
				//	$s_classpro.="<li><img src='Templates1/images/name_prefix.gif' border='0'> <a href='../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/index.html'>".$pro_midcate_rows['midcateName']."</a></li>\r\n";
					}
					else//有小类
					{
					//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n"; //中类引导图
						$detailsfile="../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateName']."/indexdetails.html";
						if(file_exists($detailsfile))
						{$s_classpro.="<a href='".$detailsfile."'>".$pro_midcate_rows['midcateName']."</a>\r\n";}
						else
						{
							if($pro_midcate_rows['ID']=="")continue; //没有跳过循环
							$product_class_rows=get_product_class_rows($pro_midcate_rows['ID']);
							$product_class_piclink=getpiclink($product_class_rows['ID'],$product_class_rows['productPic']);
				
							//$s_classpro.="<li id=\"classpro_list_li_title\">  <strong>".$pro_midcate_rows['midcateName']."</strong></li> \r\n";			
							//有图：
							//$s_classpro.="<li class=\"class_dt\"><img src='../".$classpro_rows['cateFolders'] .$pro_midcate_rows['midcateFolders'].$product_class_piclink['picsrc']."' width='".$ls_classproPicW."' border='0'>  <strong>".$pro_midcate_rows['midcateName']."</strong></li> \r\n";			

					//$s_classpro.="\n<dd><a href='javascript:void(0)'>".$pro_midcate_rows['midcateName']."</a>\n<ul>\r\n";
					
						}
				//$s_classpro.="<div class=\"subcate_list\">";//小类菜单样式
						while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))		//小类生成
						 {
					
							if($pro_subcate_rows['ID']=="")continue; //没有跳过循环
							$product_class_rows=get_product_class_rows($pro_subcate_rows['ID']);
							$product_class_piclink=getpiclink($product_class_rows['ID'],$product_class_rows['productPic']);
							
							if($product_class_piclink['picsrc'] == null){
								$s_classpro.="<li class=\"class_dt\"><a href=\"../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders'] ."/".$pro_subcate_rows['subcateFolders']."/index.html\" ><img src='ls_admin/images/NoPictures_en.jpg' width='".$ls_classproPicW."' border='0'></a>  <strong><a id='classpro_list_a2' href=\"../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders'] ."/".$pro_subcate_rows['subcateFolders']."/index.html\" >".$pro_subcate_rows['subcateName']."</a></strong></li>  \r\n";
							}else{
								$s_classpro.="<li class=\"class_dt\"><a href=\"../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders'] ."/".$pro_subcate_rows['subcateFolders']."/index.html\" ><img src='../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders'].$product_class_piclink['picsrc']."' width='".$ls_classproPicW."' border='0'></a>  <strong><a id='classpro_list_a2' href=\"../".$classpro_rows['cateFolders'] ."/".$pro_midcate_rows['midcateFolders'] ."/".$pro_subcate_rows['subcateFolders']."/index.html\" >".$pro_subcate_rows['subcateName']."</a></strong></li>  \r\n";
							}

					//$s_classpro.="<li><a href=\"../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders']."/index.html\" >".$pro_subcate_rows['subcateName']."</a></li>\r\n";
						 }
						$s_classpro.=" \n\r\n"; 
					} 
			}
			$s_classpro.="  \r\n";
		  }//if($pro_midcate_num==0)//dalei
	
		}
		$s_classpro.="</ul>\r\n ";
		$classpro=str_replace("../","",$s_classpro);//cate

	}

	// $ls_classproType="cateList" 产品分类展开列表
	if($ls_classproType=="cateList"  )
	{	
		$s_classpro="";
		$classpro_sql="select * from ls_products where branchID=0 and midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
		$classpro_query=$opendb->query($classpro_sql);
		//$s_classpro="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
		$s_classpro.="<ul class=\"ls_classpro\">";
		while($classpro_rows=mysql_fetch_assoc($classpro_query))
		{
		  $pro_midcate_sql="select * from ls_products where branchID=0 and cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$classpro_rows['ID']." order by Num asc";
		  $pro_midcate_query=$opendb->query($pro_midcate_sql);
		  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
		  if($pro_midcate_num==0)//大类
		  {
		//$s_classpro.="&nbsp;<img src='../Templates/images/cate.gif' border='0'> \n";
		//$s_classpro.="\n<dt>".$classpro_rows['cateName']."</dt>";
		
			$s_classpro.="<li><img src='../".$templates_var."/images/name_prefix.gif' border='0'> <a href='../".$classpro_rows['cateFolders']."/index.html'>".$classpro_rows['cateName']."</a></li><ul> \r\n";
			// $s_classpro.="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
		  } 
		  else//大类中类
		  {
			//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";  //大类引导图
			$detailsfile="../".$classpro_rows['cateFolders']."/indexdetails.html";
			if(file_exists($detailsfile))
			{ 	$s_classpro.=" <dt><a href='".$detailsfile."'>".$classpro_rows['cateName']."</a></dt>\r\n";}
			else
			{	$s_classpro.=" <li><img src='../".$templates_var."/images/name_prefix.gif' border='0'> <a href='javascript:void(0)'>".$classpro_rows['cateName']."</a><ul>\r\n";}
		
			//？ 不应该有$s_classpro.="\n <div class=\"cate_list\">\n";
				while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))
				{
					$pro_subcate_sql="select * from ls_products where branchID=0 and midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and subcateID=".$pro_midcate_rows['ID']." order by Num asc";
					$pro_subcate_query=$opendb->query($pro_subcate_sql);
					$pro_subcate_num=mysql_num_rows($pro_subcate_query); 

				//$s_classpro.="<div class=\"midcate_list\">"; //中类菜单样式
	
					if($pro_subcate_num==0)//没小类
					{
					//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";  //中类引导图
						$s_classpro.="<li><a href='../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/index.html'>".$pro_midcate_rows['midcateName']."</a></li>\r\n";
					}
					else//有小类
					{
					//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n"; //中类引导图
						$detailsfile="../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateName']."/indexdetails.html";
						if(file_exists($detailsfile))
						{$s_classpro.="<a href='".$detailsfile."'>".$pro_midcate_rows['midcateName']."</a>\r\n";}
						else
						{$s_classpro.="\n<dd><a href='javascript:void(0)'>".$pro_midcate_rows['midcateName']."</a>\n<ul>\r\n";}
					//$s_classpro.="<div class=\"subcate_list\">";//小类菜单样式
						while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))		//小类生成
						{
							$s_classpro.="<li><a href=\"../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders']."/index.html\" >".$pro_subcate_rows['subcateName']."</a></li>\r\n";
						 }
					$s_classpro.="</ul>\n</dd>\r\n"; 
					}
				}
				$s_classpro.="</ul></li>\r\n";
			  }//if($pro_midcate_num==0)//dalei
	
		}
		$s_classpro.="</ul>\r\n ";
		//echo $s_classpro;
		$classpro=str_replace("../","",$s_classpro);//cate
	}
	//类产品展示 End
	
	
	//首页产品展示 Start
	$products_sql="select * from ls_products where branchID=0 and  midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and AdditionalAttributes&1 and enable=1";
	$products_sql.=" order by No asc ";
	$products_query=$opendb->query($products_sql);
	$homepro="";
	$count=0;
	while($products_rows=mysql_fetch_assoc($products_query)){
		if(hassameclass($products_rows['productID'])){
			continue;
		}
		$pro_i++;
		$count++;
		$profile=getproductfolder($products_rows['productID']);
		
		$hotprofilenamearray = explode("/", strrev($profile));
		$hotprofilename = strrev($hotprofilenamearray[0]);
		$prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
		$prolink=$profile."/".$showproductsFolders."/".trim(str_replace(substr($products_rows['productPic'],-4),"",$products_rows['productPic'])).".html";
		
		switch($homehrefStytle){
			case "prohref":
				$homehref = $profile."/".clearFolder(strtolower(pathProName($products_rows['productName'])))."-".$products_rows['ID'].".html";
			break;
			
			case "classhref":
				$homehref = $profile."/".getproductpath($products_rows['productID']).".html";
			break;
		}

		$homepro.="<div class=\"col-xs-12 col-sm-6 col-md-3 col-lg-3\">
			<div class=\"thumbnail pro\"> <a href=\"".$homehref."\"><img src=\"".$prosrc."\" /></a>
				<div class=\"caption pro-name\"> <a href=\"".$homehref."\"><translate>".$products_rows['productItemNo']."</translate></a></div>
			</div>
		</div>";
		
	}
	//首页产品展示 End

	//热点产品展示 Start
	$products_sql="select * from ls_products where branchID=0 and  midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and AdditionalAttributes&2 and enable=1";
	$products_sql.=" order by Num asc";
	$products_query=$opendb->query($products_sql);
	$hotpro="";
	$i_num = 0;
	while($products_rows=mysql_fetch_assoc($products_query)){
		if(hassameclass($products_rows['productID'])){
			continue;
		}
		$pro_i++;
		$i_num++;
		$profile=getproductfolder($products_rows['productID']);
		$prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
		$prolink=$profile."/".trim(str_replace(substr($products_rows['productPic'],-4),"",$products_rows['productPic'])).".html";
	  
		$hotpro.="<div class=\"proall\">";
		$hotpro.="<div class=\"proPic\" >";
		$hotpro.="<a href=\"".$prolink."\" target=\"_blank\"><img src=\"".$prosrc."\" border=\"0\" alt=\"".$products_rows['productItemNo']."\" /></a>";
		$hotpro.="</div>";
		$hotpro.="<div class=\"proItem\" ><a href=\"".$prolink."\" target=\"_blank\">".$products_rows['productItemNo']."</a></div>";
		$hotpro.="<div class=\"proItem\" ><a href=\"".$prolink."\" target=\"_blank\">".$products_rows['productItemNo']."</a></div>";
		$hotpro.="</div>";
		
	}
	//热点产品展示 End

	//主题图
	$motif_sql="select * from ls_motif where enable=1 order by Num desc ";
	$motif_query=$opendb->query($motif_sql);
	
	$s_motif_cate.="";
	while($motif_rows=mysql_fetch_assoc($motif_query)){
		if($motif_rows['motif_href'] !=''){
			$s_motif_cate.="<li data-transition=\"boxslide\" ><img src=\"../".$MotifFolders."/".$BigFoldersProducts."/".$motif_rows['motifPic']."\"  alt=\"".$motif_rows['motifText']."\">
			<div class=\"tp-caption slider-text-description sft str\"  data-x=\"20\" data-y=\"280\" data-start=\"1500\" data-easing=\"easeOutBack\" data-end=\"5000\" data-endspeed=\"500\"><a href=\"".$motif_rows['motif_href']."\" class=\"button btn-flat\">More Info</a></div>   
			</li>";
		}else{
			$s_motif_cate.="<li data-transition=\"boxslide\" ><a href=\"javascript:void(0)\" ><img src=\"../".$MotifFolders."/".$BigFoldersProducts."/".$motif_rows['motifPic']."\"  alt=\"".$motif_rows['motifText']."\"></a></li>";
		}
	}
	$s_motif_cate.=" ";
	
	$s_m_cate=str_replace("../","",$s_motif_cate);//cate
	$s_m2_cate=str_replace("../","../",$s_motif_cate);//pro2_cate
	$s_m3_cate=str_replace("../","../../",$s_motif_cate);//pro3_cate
	$s_m4_cate=str_replace("../","../../../",$s_motif_cate);//pro4_cate
	
	//主题图 End


	//新产品展示 Start 2011-2-22 修正 img标签 结束错误
	$products_sql="select * from ls_products where branchID=0 and  midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and AdditionalAttributes&4 and enable=1";
	$products_sql.=" order by Num asc ";
	$products_query=$opendb->query($products_sql);
	$newpro="";
	while($products_rows=mysql_fetch_assoc($products_query)){
		if(hassameclass($products_rows['productID'])){
			continue;
		}
		$pro_i++;
		$profile=getproductfolder($products_rows['productID']);
		$prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
		$prolink=$profile."/".trim(str_replace(substr($products_rows['productPic'],-4),"",$products_rows['productPic'])).".html";


		$newpro.="<div class=\"proall\">";
		$newpro.="<div class=\"proPic\" >";
		$newpro.="<a href=\"".$prolink."\" target=\"_blank\"><img src=\"".$prosrc."\" border=\"0\" alt=\"".$products_rows['productItemNo']."\" /></a>";
		$newpro.="</div>";
		$newpro.="<div class=\"proItem\" ><a href=\"".$prolink."\" target=\"_blank\">".$products_rows['productItemNo']."</a></div>";
		$newpro.="<div class=\"proItem\" ><a href=\"".$prolink."\" target=\"_blank\">".$products_rows['productItemNo']."</a></div>";
		$newpro.="</div>";
		
	}																		
	//新产品展示 End
	
	//首页关于我们 start {ls_about}
	$inf_sql="select * from ls_information where inMenu = 'aboutus' order by ID";	
	$inf_query=$opendb->query($inf_sql);
	$inf_row=mysql_fetch_array($inf_query);
	
	$lenght_sql="select * from ls_functioncode where codeID = 'aboutLenght' order by ID";	
	$lenght_query=$opendb->query($lenght_sql);
	$lenght_row=mysql_fetch_array($lenght_query);
	
	//欢迎页，网站地图 welcome
	$about="<translate>".cut_html_str(str_replace("../", "", $inf_row['homeAbout']),$lenght_row['code']).((strlen($inf_row['content'])>$lenght_row['code'])?"</translate> <a href=\"aboutus.html\" style=\"float: right;
color: white;\">(More...)</a>":"</translate>");
	
	
	$allabout=str_replace("../", "", $inf_row['content']);

	$file_welcome="../".$templates_var."/welcome.html";	//模板地址
	$ls_title=$config_rows['companyName'];					//title
	$ls_keywords=$config_rows['siteKeywords'];				//Keywords
	$ls_description=$config_rows['siteDescription'];		//Description
	
	//  sitemap 站点地图 $s_site_cate P -> {ls_site_cate} T
	if(file_exists($file_welcome)){
		$fp = fopen($file_welcome,"r");
		$procontent  = fread($fp,filesize($file_welcome));
		$procontent  = str_replace("../","/",$procontent);
		$procontent  = str_replace("{ls_title}",$ls_title,$procontent);
		$procontent  = str_replace("{ls_keywords}",$ls_keywords,$procontent);
		$procontent  = str_replace("{ls_description}",$ls_description,$procontent);
		$procontent  = str_replace("{ls_s_cate}",$s_cate,$procontent);
		$ls_lineno=__LINE__.(__FUNCTION__==""?"":"， 函数：".__FUNCTION__).(__CLASS__==""?"":"， 类：".__CLASS__);

		$procontent  = str_replace("{ls_site_cate}",$site_cate1,$procontent);

		$profilename="../welcome.html";
		if (is_file ($profilename)){ 
			@unlink ($profilename); //若文件已存在，则删除
		}
		$handle   = fopen($profilename,"w"); //打开文件指针，
		/*
		　检查文件是否被创建且可写
		*/
		if (!is_writable ($profilename)){ 
			if($ls_debug) echo "文件：".$profilename."不可写，请检查其属性后重试！";
		}
		if (!fwrite ($handle,$procontent)){  //将信息写入文件
			if($ls_debug) echo "".$profilename."失败！";
		}else{
			echo "生成 <a href='".$profilename."'>".$profilename."</a>";
			if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
			echo "<br>";

		}
		fclose ($handle); //关闭指针
		//die ("创建<a href='".$filename."'>".$filename."</a>成功！<a href=\"temp.php?ls=normal\"><u>返回</u></a>");
		fclose ($fp);
	}
	
	//修改最大执行时间
	ini_set('max_execution_time', '0');
	//修改此次最大运行内存
	ini_set('memory_limit','512M');
 	set_time_limit(0);   //控制运行时间，默认是30s，所以需要你将执行时间加长点，如 set_time_limit(300)  ,其中将秒数设为0 ，表示持续运行！
	
	//echo $translates;  //统计需要翻译的语言串
	global $count_num;
	$count_num = 0;

	foreach (str_split($translates, 2) as $trans_val) {
		$translate = $trans_val; //传递很重要的翻译参数
		// 记录开始时间
		$time_start = getmicrotime();
		//sleep(10); //耗时的处理过程
		$lanname = deep_in_array($trans_val, $translate_name);
		echo "<h3><font color='#F00'>".$lanname['name']."</font></h3>";
		
		if($lanname['name']!=""){
			if($simuTransCons==1) echo " 模拟翻译,";
			if($simuTransLow) echo " 底层模拟,";
			if($_SESSION['transAll']==1) echo " 覆盖,"; else echo " 不覆盖";
			echo ", 引用路径： ".$mutiLangDomianFlag;
			echo "<br/><br/>";
		
		}

	
	switch($ls){
		case "all_products": //生成全部页面，包括产品页，否则break	
		case "products":  //生成产品页 products
			
			$pro_pic_sql="SELECT * FROM `ls_products` WHERE `cateName` IS NOT NULL and catePic !='' order by Num";
			$pro_pic_query=$opendb->query($pro_pic_sql);
			$ls_pro = "<div class=\"row pro_list\">";
			// 产品信息 {ls_pro}
			$ls_lineno=__LINE__.(__FUNCTION__==""?"":"， 函数：".__FUNCTION__).(__CLASS__==""?"":"， 类：".__CLASS__);

			while($pro_pic_rows=mysql_fetch_assoc($pro_pic_query)){
				$ls_pro .= "<div class=\"col-lg-4 col-md-4 col-sm-6 col-xs-12\"><div class=\"thumbnail\"><div class=\"img-pic\"><a href=\"".$pro_pic_rows['cateFolders']."/".$pro_pic_rows['cateFolders'].".html\"><img src=\"".$pro_pic_rows['cateFolders']."/".$pro_pic_rows['catePic']."\" name=\"imgs\" alt=\"<translate>".$pro_pic_rows['midcateName']."</translate>\" /></a></div><div class=\"caption pro-name\"><a href=\"".$pro_pic_rows['cateFolders']."/".$pro_pic_rows['cateFolders'].".html\"><translate>".$pro_pic_rows['cateName']."</translate></a></div></div></div>";
			}
			$ls_pro .= "</div>";

			$index_newspath="../".$templates_var."/prolist.html";		//模板地址
			if(file_exists($index_newspath)){
				$ls_title = $config_row['companyName'];				//title
				$ls_keywords=$config_row['siteKeywords'];			//Keywords
				$ls_description=$config_row['siteDescription'];	//Description
				$ls_cate=$pro_cate;
				$ls_cate=$cate;
				$ls_s_cate=$s_pro_cate;								//左侧产品类别;
				$ls_s_news = $ls_h1_news;
				$ls_p_cate=$s_p_cate;								//左侧产品类别;
				$ls_languages = $languages;                         //语言国旗
				$ls_f_cate=get_pro_cate(1);
				$ls_motif=$s_m2_cate;
				$ls_menu=$menu_pro;									//主菜单
				$ls_newstitle=$newstitle ;							//新闻标题
				$ls_newstext=$newstext;
				$ls_url="../";										//链接		
				$ls_foot=$foot;										//底部信息
				
				$fp	   = fopen ($index_newspath,"r");
				$newscontent = fread ($fp,filesize ($index_newspath));
				$newscontent = str_replace("{ls_title}",$ls_title,$newscontent);
				$newscontent = str_replace("{ls_keywords}",$ls_keywords,$newscontent);
				$newscontent = str_replace("{ls_description}",$ls_description,$newscontent);
				//$ menu_pro P -> $ ls_menu T -> { ls_menu} T
				$newscontent = str_replace("{ls_menu}",$ls_menu,$newscontent);
				$newscontent = str_replace("{ls_cate}",$ls_cate,$newscontent);
				$newscontent = str_replace("{ls_s_cate}",$ls_s_cate,$newscontent);
				$newscontent = str_replace("{ls_pro}",$ls_pro,$newscontent);
				$newscontent = str_replace("{ls_p_cate}",$ls_p_cate,$newscontent);
				//   $ languages  P -> $ ls_languages T 等 -> { ls_languages}
				$newscontent = str_replace("{ls_languages}",$ls_languages,$newscontent);
				$newscontent = str_replace("{ls_f_cate}",$ls_f_cate,$newscontent);
				$newscontent = str_replace("{ls_motif}",$ls_motif,$newscontent);
				$newscontent = str_replace("{ls_propage}",$ls_propage,$newscontent);
				$tem_sql="select * from ls_config order by ID";	
				$tem_query=$opendb->query($tem_sql);
				$row=mysql_fetch_array($tem_query);
				$copyright = $row['copyright'];
				$newscontent = str_replace("{ls_copyright}",$copyright,$newscontent);
				$ls_facebook_twitter = $facebook_twitter;
				$newscontent = str_replace("{ls_weibo}",$ls_facebook_twitter,$newscontent);
				$ls_facebook_twitter_share = $facebook_twitter_share;
				$newscontent = str_replace("{ls_weiboshare}",$ls_facebook_twitter_share,$newscontent);
				
				$ls_indicatebar = "<li><a href=\"../index.html\">".$lan['home']."</a></li>
								   <li style='text-transform : capitalize;'>".$lan['products']."</li>";
				$newscontent = str_replace("{ls_indicatebar}",$ls_indicatebar,$newscontent);
				$newscontent = str_replace("{ls_news}",$ls_s_news,$newscontent);
				$newscontent = str_replace("{ls_newstime}",$ls_newstime,$newscontent);
				$newscontent = str_replace("{ls_newid}",$ls_newid,$newscontent);
				$newscontent = str_replace("{ls_click_n}",$ls_click_n,$newscontent);
				$newscontent = str_replace("{ls_newstitle}",$ls_newstitle,$newscontent);
				$newscontent = str_replace("{ls_newstext}",$ls_newstext,$newscontent);
				$newscontent = str_replace("{ls_newsdongtai}",$ls_newsdongtai2,$newscontent);		//子目录下新闻
	//new
				$newscontent = str_replace("{ls_newsgonggao}",$ls_newsgonggao2,$newscontent);
				$newscontent = str_replace("{ls_newsall}",$ls_newsall2,$newscontent);
				$newscontent = str_replace("{ls_newstieshi}",$ls_newstieshi2,$newscontent);
				$newscontent = str_replace("{ls_site_cate}",$s_site_cate,$newscontent);
	
				$newscontent = str_replace("{ls_url}",$ls_url,$newscontent);
				$newscontent = str_replace("{ls_foot}",$ls_foot,$newscontent);
				$newscontent = str_replace("{ls_addprolink}",$ls_addprolink,$newscontent);	//指向主菜单中的Products链接
				$newscontent = str_replace("{ls_addnewprolink}",$ls_addnewprolink,$newscontent);	//指向主菜单中的NewProducts链接
				$newscontent = str_replace("../","",$newscontent);
				$filename="../prolist.html";

			if($translate != ''){

				//翻译代码
				$folder_name = $translate;
				$r_name = deep_in_array($folder_name, $translate_name);
		
				$translateFile = "../".$r_name['folder_name'];
				createFolder($translateFile);
				$transFile = str_replace("../", "", $filename);
				
				if (is_file ($translateFile."/".$transFile)){ 
					 @unlink ($translateFile."/".$transFile); //若文件已存在，则删除
				}
				
				if (copy("../.htaccess", "../".$r_name['folder_name']."/.htaccess")){
					if($ls_debug) echo "复制"."../".$r_name['folder_name']."/.htaccess文件成功！<br />";
				}else{
					if($ls_debug) echo "复制"."../".$r_name['folder_name']."/.htaccess文件失败！<br />";
				}
				
				if(translateApp($newscontent, $translateFile."/".$transFile, $r_name['translate_name'])){
					echo "创建 <a href='".$translateFile."/".$transFile."'>".$translateFile."/".$transFile."</a>成功！<a href=\"temp.php?ls=normal\"><u>返回</u></a>";
					if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
					echo "<br/><br/>";

				}else{
					if($ls_debug) echo "生成文件".$translateFile."/".$transFile."失败！<br>";
				}
			}else{
				if (is_file ($filename)){ 
					 @unlink ($filename); //若文件已存在，则删除
				}
				//英文网站去除<translate>标签
				$translate_str = $newscontent;
				$p = "%<translate>(.*?)</translate>%si";    //正则表达式
				preg_match_all($p, $newscontent, $arr);
				$temarr = $arr[1];
				
				$source="en";
				$targets = $target;
			
				foreach($temarr as $val){
					$newscontent = str_replace("<translate>".$val."</translate>", $val, $newscontent);
				}
				
			   $handle   = fopen ($filename,"w"); //打开文件指针，
						 
				if (!is_writable ($filename)){ 
					if($ls_debug)  echo "<script>alert('文件：".$filename."不可写，请检查其属性后重试！');history.go(-1);</script>";
				}
				if (!fwrite ($handle,$newscontent)){  //将信息写入文件
					if($ls_debug) echo "'生成文件".$filename."失败！";
				 } 
					fclose ($handle); //关闭指针
					echo "创建<a href='".$filename."'>".$filename."</a>成功！<a href=\"temp.php?ls=normal\"><u>返回</u></a>";
					if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
					echo "<br/><br/>";
			}
				fclose ($fp);
			}else{
				if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
			}
			
			//echo "<h1>".$ls."</h1>";
			$menuListscateidall=0;
			/*$cate_sql="select * from ls_products where midcateID is null and midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";*/
			//查找大类的SQL语句
			$cate_sql = 'SELECT * FROM `ls_products` WHERE cateName IS NOT NULL';
			$cate_query=$opendb->query($cate_sql);
			while($cate_rows=mysql_fetch_assoc($cate_query)){
				if($_GET['productsall']=="ok"){
					$cateid=$cate_rows['ID'];
					$menuListscateid=0;
				}
				$products_sql_p="select * from ls_products where branchID=0 and midcateID is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null ";
				//大类
				if( $cateid!="" && $midcateid=="" && $subcateid=="" ){
					//大类下有中类
					//echo "<h1>".$cateid."</h1>";
					$sqlstr1="SELECT `ID` FROM `ls_products` WHERE midcateID=".$cateid;
					$query1=$opendb->query($sqlstr1);
					$mynum1=mysql_num_rows($query1);
					if($mynum1!=0){
						//有中类
						$DetailPage=1;
						writeProPageIndex($products_sql,$cateid,$midcateid,$subcateid,$translate);// write 所有大枝类的details
						$DetailPage=0; //reset flag
			
						$menuListscateidall++;
						if($_GET['productsall']=="ok"){$menuListscateid=$menuListscateidall;}		// if it is all products set $menuListscateid
						while($myrows1=mysql_fetch_assoc($query1)){
							$sqlstr2="select ID from ls_products where subcateID =".$myrows1['ID']." ";
							$query2=$opendb->query($sqlstr2);
							$mynum2=mysql_num_rows($query2);
							if($mynum2!=0){
								//有小类
								$midcateid=$myrows1['ID'];
								$mid_id = $midcateid;
								$DetailPage=1;
								writeProPageIndex($products_sql,$cateid,$midcateid,$subcateid,$translate);// write 所有中枝类的details
								$DetailPage=0; //reset flag
			
								while($myrows2=mysql_fetch_assoc($query2)){
									$productID=" productID=".$myrows2['ID'];
									$products_sql=$products_sql_p." and ".$productID;
									$subcateid=$myrows2['ID'];
									$midcateid = $mid_id;
									writeProPageIndex($products_sql,$cateid,$midcateid,$subcateid,$translate);
									$midcateid="";
									$subcateid="";
								}
							}
							else{
								//没有小类
								$productID=" productID=".$myrows1['ID'];
								$products_sql=$products_sql_p." and ".$productID;
								$midcateid=$myrows1['ID'];
								writeProPageIndex($products_sql,$cateid,$midcateid,$subcateid,$translate);
								$midcateid="";
							}
						}
					}
					else{
						$products_sql=$products_sql_p." and productID=".$cateid;
						writeProPageIndex($products_sql,$cateid,$midcateid,$subcateid,$translate);
					}
				}

				//中类
				if($cateid!="" && $midcateid!="" && $subcateid==""){
					//中类下有小类
					$sqlstr="select ID from ls_products where subcateID =".$midcateid." ";
					$query1=$opendb->query($sqlstr);
					$mynum=mysql_num_rows($query1);
					if($mynum!=0){
						while($myrows=mysql_fetch_assoc($query1)){
								$productID=" productID=".$myrows['ID'];
								$products_sql=$products_sql_p." and ".$productID;
								$subcateid=$myrows['ID'];
								writeProPageIndex($products_sql,$cateid,$midcateid,$subcateid,$translate);
								$subcateid="";
						}
					}
					else{
						//中类下没有小类
						$products_sql=$products_sql_p." and productID=".$midcateid;
						writeProPageIndex($products_sql,$cateid,$midcateid,$subcateid,$translate);
			
					}
				}
				//小类
				if($cateid!="" && $midcateid!=""&& $subcateid!=""){
					$products_sql=$products_sql_p." and productID=".$subcateid;
					writeProPageIndex($products_sql,$cateid,$midcateid,$subcateid,$translate);
				}
				//echo 	$products_sql;
				echo "生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=products\"><u>返回</u></a>";
				if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

				echo "<br/>
				---------------------------------------------------------------------------------------------------<br/><br/><br/>";																				
				if($_GET['productsall']=="ok")//不生成全部产品就执行一次循环退出
				{}
				else{
					break;
				}
			}// end of cate while
			if($ls!="all_products"){
				// 记录结束时间
				$time_end = getmicrotime();
				$time = $time_end - $time_start;
				// 输出运行总时间 
				echo "执行时间： $time 秒";
				//生成全部页面，不包括产品页，否则break 
				break;
			}

		case "all":						//生成全部页面，不包括产品页
		case "nomenufiles":				//生成首页
			$ls_cate=$cate;				//左侧产品类别
			$ls_menu=$menu;				//主菜单
			$ls_classpro=$classpro;			//类别产品
			$ls_motif=$s_m_cate;
			$ls_hotpro=$hotpro;			//功能页面热点产品
			$ls_newpro=$newpro;			//功能页面新产品
			// $ls_title, $ls_keywords, $ls_description from public
			$ls_foot=$foot;				//底部信息
			$ls_site_cate = $site_cate;
			foreach($generalCreateFiles as $createdfile){
				$index_path="../".$templates_var."/";//模板目录
				$mainpartsubject="nomenufiles";
				$filename="../".$createdfile;
				$index_path=$index_path.$createdfile;
				$mainpart="";
				$ls_introduction="";
				$ls_feedbackemail="";
				$ls_propage="";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
	$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
	
			echo "生成member 目录下文件--------------------<br />";
			foreach($generalCreateFilesMembers as $createdfile){			//生成member 下文件
				$subFolder=true;		//设置子目录 替换../../ 为 ../
				$index_path="../".$templates_var."/";//模板目录
				$mainpartsubject="createdfile";
				$filename="../member/".$createdfile;
				$index_path=$index_path.$createdfile;
				$mainpart="";
				$ls_introduction="";
				$ls_feedbackemail="";
				$ls_propage="";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
	$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
			$subFolder=false;
				
			echo "生成agent 目录下文件--------------------<br />";
			foreach($generalCreateFilesAgents as $createdfile ) {			//生成agent 下文件
				$subFolder=true;
				$index_path="../".$templates_var."/";//模板目录
				$mainpartsubject="createdfile";
				$filename="../agent/".$createdfile;
				$index_path=$index_path.$createdfile;
				$mainpart="";
				$ls_introduction="";
				$ls_feedbackemail="";
				$ls_propage="";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
	$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
			$subFolder=false;
			if($ls!="all" && $ls!="all_products"){
				//生成全部页面，不包括产品页，否则break 
				break;
			}

     //生成单页
    case "singlepage":
		$sql = "select * from ls_singlepages where enable=1";
		$list = $opendb->allRows($sql);
		
		foreach($list as $v){
			$tpl = '../'.$templates_var."/".$v['static_tpl'];
			if(file_exists($tpl)){
				$arr = explode('.',$v['singlepage_name']);
				if($arr[1]=='html'){
					$ls_s_cate = $s_cate0;				//左侧产品类别
					$ls_menu=$menu;				//主菜单
					$ls_classpro=$classpro;			//类别产品
					$ls_motif=$s_m_cate;
					$ls_hotpro=$hotpro;			//功能页面热点产品
					$ls_newpro=$newpro;			//功能页面新产品
					$ls_p_cate=$s_p0_cate;								//左侧产品类别;
					$ls_f_cate=get_pro_cate(0);//左侧产品类别; 8-25zhao
					// $ls_title, $ls_keywords, $ls_description from public
					$ls_foot=$foot;				//底部信息
					$ls_site_cate = $site_cate;
					global $ls_about,$ls_news,$ls_homepro,$ls_newpro,$ls_classpro,$ls_hotpro,$ls_designby,$ls_news,$ls_link,$ls_s_cate,$ls_newsdongtai,$ls_newsgonggao,$ls_newstieshi,$ls_revo,$ls_allcatepics,$ls_site_cate,$facebook_twitter,$facebook_twitter_share;
					
					$tem_sql="select * from ls_config order by ID";	
					$tem_query=$opendb->query($tem_sql);
					$row=mysql_fetch_array($tem_query);
				
					$facebook_twitter = str_replace("YOUR-FACEBOOK",$row['facebook'],$facebook_twitter);
					$facebook_twitter = str_replace("YOUR-TWITTER",$row['twitter'],$facebook_twitter);
					$facebook_twitter = str_replace("YOUR-LINKEDIN",$row['linkedin'],$facebook_twitter);
					$facebook_twitter = str_replace("YOUR-GOOGLE",$row['google'],$facebook_twitter);
					$facebook_twitter = str_replace("YOUR-PINTEREST",$row['pinterest'],$facebook_twitter);
					$facebook_twitter = str_replace("YOUR-YOUTUBE",$row['youtube'],$facebook_twitter);
					$facebook_twitter = str_replace("../","",$facebook_twitter);
					
					$code_sql="select * from ls_functioncode where enable=1 order by ID";	
					$code_query=$opendb->query($code_sql);
					while ($code_row=mysql_fetch_array($code_query)){
						switch($code_row['codeID']){
							case "statistics":
								if($code_row['enable']){
									$statistics = $code_row['code'];
								}
							break;
							case "onlines":
								if($code_row['enable']){
									$onlines = $code_row['code'];
								}
							break;
							case "maps":
								if($code_row['enable']){
									$maps = $code_row['code'];
								}
							break;
							case "share":
								if($code_row['enable']){
									$share = $code_row['code'];
								}
							break;
							case "indexKeywords":
								if($code_row['enable']){
									$indexKeywords = $code_row['code'];
								}
							break;
							case "onlinechart":
								if($code_row['enable']){
									$onlinechart = $code_row['code'];
								}
							break;
							case "shield":
								if($code_row['enable']){
									$shield = $code_row['code'];
								}
							break;
						}
					}
					
					$handle = fopen($tpl,'r');
					$content = fread($handle,filesize ($tpl));
					
					$content = str_replace("{ls_statistics}",$statistics,$content); //统计代码
					$content = str_replace("{ls_onlines}",$onlines,$content);  //在线联系(QQ)
					$content = str_replace("{ls_maps}",$maps,$content);  //地图代码
					$content = str_replace("{ls_share}",$share,$content);  //分享代码
					$content = str_replace("{ls_onlinechart}",$onlinechart,$content);  //在线联系
					$content = str_replace("{ls_shield}",$shield,$content);  //首页屏蔽
					
					$content = str_replace("{ls_title}",$ls_title,$content);
					$content = str_replace("../","",$content);
					$content = str_replace("{ls_keywords}",$ls_keywords,$content);
					$ls_lineno=__LINE__.(__FUNCTION__==""?"":"， 函数：".__FUNCTION__).(__CLASS__==""?"":"， 类：".__CLASS__);

					$content = str_replace("{ls_description}",$ls_description,$content);
					//$ menu_pro P -> $ ls_menu T -> { ls_menu} T
					$content = str_replace("{ls_menu}",$ls_menu,$content);
					$content = str_replace("{ls_s_cate}",$ls_s_cate,$content);
					$content = str_replace("{ls_motif}",$ls_motif,$content);
					$content = str_replace("{ls_m_news}",$ls_m_news,$content);
					$content = str_replace("{ls_link}",$ls_link,$content);
					$content = str_replace("{ls_about}",$ls_about,$content);
					
					$content = str_replace("{ls_site_cate}",$ls_site_cate,$content);
					$ls_facebook_twitter = $facebook_twitter;
					$content = str_replace("{ls_weibo}",$ls_facebook_twitter,$content);
					$content = str_replace("{ls_weiboshare}",$facebook_twitter_share,$content);
					
					$content = str_replace("{ls_p_cate}",$ls_p_cate,$content);
					
					$content = str_replace("{ls_news}",$ls_news,$content);
					$content = str_replace("{ls_newsdongtai}",$ls_newsdongtai,$content);
					$content = str_replace("{ls_newsgonggao}",$ls_newsgonggao,$content);
					$content = str_replace("{ls_newstieshi}",$ls_newstieshi,$content);
					$content = str_replace("{ls_homepro}",$ls_homepro,$content);
					$content = str_replace("{ls_designby}",$ls_designby,$content);
					$content = str_replace("{ls_cate}",$ls_cate,$content);
					$content = str_replace("{ls_foot}",$ls_foot,$content);
					$content = str_replace("{ls_addprolink}",$ls_addprolink,$content);	//指向主菜单中的Products链接
					$content = str_replace("{ls_addnewprolink}",$ls_addnewprolink,$content);	//指向主菜单中的NewProducts链接
					$content = str_replace("{ls_classpro}",$ls_classpro,$content); //类别产品链接
					$content = str_replace("{ls_hotpro}",$ls_hotpro,$content); //热点产品链接
					$content = str_replace("{ls_revo}",$ls_revo,$content); //主题流动图片
					$content = str_replace("{ls_search}",ls_search(),$content); //搜索框
					$content = str_replace("{ls_allcatepics}",$ls_allcatepics,$content); //搜索框
					
					$content = str_replace("{singlepage_title}",$v['pageTitle'],$content);
					$content = str_replace("{singlepage_content}",str_replace("../", "",$v['pageText']),$content);
					fclose($handle);
					
					if($translate != ''){
						//翻译代码
						$folder_name = $translate;
						$r_name = deep_in_array($folder_name, $translate_name);
				
						$translateFile = "../".$r_name['folder_name'];
						createFolder($translateFile);
						createFolder("../".$r_name['folder_name']."/".$showFolders);
						$transFile = $v['singlepage_name'];
						if(translateApp($content, $translateFile."/".$transFile, $r_name['translate_name'])){
							echo "创建<a href='".$translateFile."/".$transFile."'>".$translateFile."/".$transFile."</a>成功！<a href=\"temp.php?ls=normal\"><u>返回</u></a>";
							if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

							echo "<br/><br/>";
						}else{
							if($ls_debug) echo "生成文件".$translateFile."/".$transFile."失败！<br>";
						}
						
					}else{
						
						//英文网站去除<translate>标签
						$translate_str = $content;
						$p = "%<translate>(.*?)</translate>%si";    //正则表达式
						preg_match_all($p, $content, $arr);
						$temarr = $arr[1];
						
						$source="en";
						$targets = $target;
					
						foreach($temarr as $val){
							$content = str_replace("<translate>".$val."</translate>", $val, $content);
						}
						
						$handle = fopen('../'.$v['singlepage_name'],'w+');
						if (!is_writable ('../'.$v['singlepage_name']))
						{ 
							if($ls_debug) echo "文件："."../".$v['singlepage_name']."不可写，请检查其属性后重试！";
						}else{
							if(fwrite($handle,$content)){
								echo "<p>生成 <a href='../".$v['singlepage_name']."'>../".$v['singlepage_name']."</a>成功</p>";
								if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

								fclose ($handle);
							}	
						}
					}
				}else{
					if($ls_debug) echo "生成的".$v['singlepage_name']."文件格式错误<br>";	
				}
			}else{
				if($ls_debug) echo "<p>模版文件".$tpl."不存在，生成".$v['singlepage_name']."失败</p><br>";	
			}
		}
		if($ls!="all" && $ls!="all_products"){
				//生成全部页面，不包括产品页，否则break 
				break;
			}
	case "index":  //生成首页
		$index_path="../".$templates_var."/index.html";//首页模板地址
		$ls_cate=$cate;				//左侧产品类别
		$ls_motif=$s_m_cate;
		$ls_menu=$menu;				//主菜单
		$ls_about=$about ;			//globle 首页About us 
		$ls_news=$news;				//globle 首页News
		$ls_faq=$faq;				//globle 首页faq
		$ls_revo=$revo;
		$ls_homepro=$homepro;			//globle 首页Hot products
		// $ls_title, $ls_keywords, $ls_description from public
		$ls_allcatepics=get_allcatepics();
		$ls_foot=$foot;				//底部信息
		$mainpartsubject="index";
		$filename="../index.html";
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
		
 if($ls!="all" && $ls!="all_products")//生成全部页面，不包括产品页，否则break 
 {break;}
 	
   case "aboutus":  //生成 About us
  
		$index_path="../".$templates_var."/aboutus.html";	//模板地址
		
		$information_sql="select * from ls_information where inMenu='aboutus' ";
		$information_query=$opendb->query($information_sql);
		$information_rows=mysql_fetch_assoc($information_query);
		
		$ls_title=$information_rows['inTitle'];//title
		$ls_keywords=$information_rows['inKeywords'];	//Keywords
		$ls_description=$information_rows['inDescription'];//Description
		$ls_cate=$cate;			//左侧产品类别
		$ls_p_cate=$s_p1_cate;			//左侧产品类别
		$ls_motif=$s_m_cate;
		$ls_menu=$menu;		//主菜单
		$ls_allabout=$information_rows['content'];
		
		
		$ls_foot=$foot;		//底部信息
		
		$ls_propage="";
		$mainpart=$allabout;
		$mainpartsubject="aboutus";
		$filename="../aboutus.html";
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$ls_cate,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
	 	 if($ls!="all" && $ls!="all_products")
 {break;}	
 
	case "feedback":  //生成 feedback
		
		$index_path="../".$templates_var."/feedback.html";	//模板地址
		$ls_title=$config_rows['companyName'];//title
		$ls_keywords=$config_rows['siteKeywords'];	//Keywords
		$ls_description=$config_rows['siteDescription'];//Description
			//$ls_cate=$pro_cate;																						//左侧产品类别
			//$ls_menu=$menu_pro;																						//主菜单
		$ls_cate=$cate;				//左侧产品类别
		$ls_p_cate=$s_p1_cate;
		$ls_motif=$s_m_cate;
		$ls_menu=$menu;	//主菜单
		$ls_feedback=$config_rows['feedback'] ;//feedback
		$ls_feedbackemail=$config_rows['email'] ;//E-Mail
		$ls_foot=$foot;	//底部信息
		
		$ls_propage="";
		$mainpart=$ls_feedback ;
		$mainpartsubject="feedback";
		$filename = "../feedback.html"; 
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$ls_cate,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);

	 	 if($ls!="all" && $ls!="all_products")
 {break;}	
			

	 
	 case "contactus":  //生成 contact us
			
		$contactus.="Address:".$config_rows['address']."<br>\n";
		$contactus.="Tel:".$config_rows['tel']."<br>\n";
		$contactus.="Fax:".$config_rows['fax']."<br>\n";
		$contactus.="E-Mail:<a href=\"mailto:".$config_rows['email']."\">".$config_rows['email']."</a><br>\n";
		$contactus.="MSN:<a href=\"mailto:".$config_rows['MSN']."\">".$config_rows['MSN']."</a><br>\n";
		$contactus.="URL:<a href=\"http://".$config_rows['website']."\">".$config_rows['website']."</a><br>\n";
		$contactus.=$ContactAttach; //联系我们的附件文字： google地图， 地区环境
		
		$contactus = $config_rows['contact'];
		
		$index_path="../".$templates_var."/contact.html";//模板地址
		
		$information_sql="select * from ls_information where inMenu='contact' ";
		$information_query=$opendb->query($information_sql);
		$information_rows=mysql_fetch_assoc($information_query);
		
		$ls_title=$information_rows['inTitle'];//title
		$ls_keywords=$information_rows['inKeywords'];	//Keywords
		$ls_description=$information_rows['inDescription'];//Description
		
		//$ls_cate=$pro_cate;																						//左侧产品类别
		//$ls_menu=$menu_pro;																						//主菜单
		$ls_cate=$cate;	//左侧产品类别
		$ls_p_cate=$s_p1_cate;
		$ls_motif=$s_m_cate;
		$ls_menu=$menu;	//主菜单
		$ls_contactus= str_replace("../", "", $information_rows['content']);//contact us
		$ls_foot=$foot;//底部信息
		
		$ls_propage="";
		$ls_feedbackemail="";
		$mainpart=$ls_contactus;
		$mainpartsubject="contactus";
		$filename = "../contact.html"; 
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$ls_cate,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
	 	 if($ls!="all" && $ls!="all_products")
 {break;}	

	// 新闻详细页，及新闻列表页：遍历所有分类 cate, 按分类生成 相关分类的news index.php，如 index_all.html, index_tieshi.html
	// 新闻详细页 newsshow.html
	
	case "news": //生成新闻 News
	$news_cate_sql2="select * from `ls_functioncates` where functionName='新闻分类' and enable=1 order by Num asc ";
	$result_cate=$opendb->query($news_cate_sql2);
	$num_cate=mysql_num_rows($result_cate);
	$i_news=1;
	$sort='';	
	while($catenews = mysql_fetch_assoc($result_cate))
	{
		 //$mido = "<h3>".$catenews['cateName']."</h3>";
		 $news_sql2="select * from ls_news where enable=1 and cate='".$catenews['cateName']."' order by Num desc ";
 		 $suffix_str2=$catenews['suffStr'];
		 
		 $result=$opendb->query($news_sql2);
		$mynum = mysql_num_rows($result);//总产品数
			// 每页数量
		$onepage = $PageNumNews;
			//共有页数
		$allpages = ceil($mynum/$onepage);
			
		//echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
		//页码计算  在ls_syscode里面
		
		for ($i=0; $i<= $allpages; $i++){
			$newslist="";
			$suffix_str=$suffix_str2;
			if($i == 0)
			{
				$suffix_str = $suffix_str;
			} 
			else 
			{
				$suffix_str = $suffix_str."-".$i;
			}
			$start = $i * $onepage;
			$propage=getPagess("news".$catenews['suffStr'].".html",$allpages,$i+1);	
			
			// 
			$news_sql=$news_sql2." limit ".$start.",".$onepage." ";
			
		$mido = "";
		$news_query=$opendb->query($news_sql);
		while($news_rows=mysql_fetch_assoc($news_query))
		{
			// 新闻列表页，包括   $mido -> $ ls_newslist -> $ mainpart  -> ls_syscode (writeMainMenuItemFile) $ ls_newslist -> {ls_newslist}
			$mido.="<li><span>(".$news_rows['newsDate'].")</span><a href=\"".$newsshowFolders."/news".$suffix_str2.$news_rows['ID'].".html\"><translate>".$news_rows['newsTitle']."</translate></a></li>";
			
			$index_newspath="../".$templates_var."/newsshow".$suffix_str2.".html";		//模板地址
			if(file_exists($index_newspath)){
			// 新闻详细页	，包括 分类新闻，tieshi,dongtai,gonggao  newsshow
				writeShowPages($news_rows, $suffix_str2, "news", "news", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['news'], $translate);

			}else{
				if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";	
			}
		}
		
	//end for , all pages
	
	// 新闻列表页  包括 分类新闻，tieshi,dongtai,gonggao  newsshow
		$index_path="../".$templates_var."/news".$suffix_str2.".html";						  //模板地址
		$ls_title=$config_rows['companyName'];												//title
		$ls_keywords=$config_rows['siteKeywords'];										//Keywords
		$ls_description=$config_rows['siteDescription'];							//Description
		$ls_cate=$cate;																								//左侧产品类别
		$ls_motif=$s_m_cate;
		$ls_menu=$menu;																								//主菜单
		$ls_newslist=$mido ;																			//新闻news 列表
		$ls_propage=$propage;																					//新闻分页页码
		$ls_foot=$foot;																								//底部信息

		$ls_feedbackemail="";
		$mainpart=$ls_newslist ;
		$mainpartsubject="news";
		$filename = "../news".$suffix_str.".html";
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
	}//end of while all news cats
}
		echo "共有".$mynum."条新闻。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
		if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
		echo "<br/><br/>";
	 if($ls!="all" && $ls!="all_products")
 {break;}
 
 
case "faq": //生成常见问题 faq

	$news_cate_sql2="select * from `ls_functioncates` where functionName='常见问题' and enable=1 order by Num asc ";

	$result_cate=$opendb->query($news_cate_sql2);
	$num_cate=mysql_num_rows($result_cate);
	$i_news=1;
	
	
	$sort='';	
	while($catenews = mysql_fetch_assoc($result_cate))
	{
		 //$mido = "<h3>".$catenews['cateName']."</h3>";
		 $news_sql2="select * from ls_news where enable=1 and cate='".$catenews['cateName']."' order by Num desc ";
 		 $suffix_str2=$catenews['suffStr'];
		 
		 $result=$opendb->query($news_sql2);
		$mynum = mysql_num_rows($result);//总产品数
			// 每页数量
		$onepage = $PageNumFaq;
			//共有页数
		$allpages = ceil($mynum/$onepage);
			
		//echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
		//页码计算  在ls_syscode里面
		
		for ($i=0; $i<= $allpages; $i++){
			$newslist="";
			$suffix_str=$suffix_str2;
			if($i == 0)
			{
				$suffix_str = $suffix_str;
			} 
			else 
			{
				$suffix_str = $suffix_str."-".$i;
			}
			$start = $i * $onepage;
			$propage=getPagess("faq".$catenews['suffStr'].".html",$allpages,$i+1);
			
			// 
			$news_sql=$news_sql2." limit ".$start.",".$onepage." ";
			
		$mido = "";
		$news_query=$opendb->query($news_sql);
		while($news_rows=mysql_fetch_assoc($news_query))
		{
			/*$mido.="<li><div class='art_title')'><span>(".$news_rows['newsDate'].")</span><a href=\"".$faqshowFolders."/faq".$suffix_str2.$news_rows['ID'].".html\" onclick='loadfaq(".$news_rows['ID'].">".$news_rows['newsTitle']."</a></div>
			<div class='art_content' id='applyfaq".$news_rows['ID']."'>".$news_rows['newsText']."</div>
			</li>";*/
			
			$mido.="<li><div class='art_title2' id=\"faq".$news_rows['ID']."\"><a href=\"javascript:void(0)\" onclick='loadfaq(".$news_rows['ID'].")'><translate>".$news_rows['newsTitle']."</translate></a></div>
			<div class='art_content' id='applyfaq".$news_rows['ID']."'><translate>".$news_rows['newsText']."</translate></div>
			</li>";
			
			$index_newspath="../".$templates_var."/faqshow".$suffix_str2.".html";		//模板地址
			if(file_exists($index_newspath)){
				
				writeShowPages($news_rows, $suffix_str2, "faq", "news", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['faq'], $translate);

			}else{
				if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
			}
		}
		
	//end for , all pages
	
		$index_path="../".$templates_var."/faq".$suffix_str2.".html";						//模板地址
		$ls_title=$config_rows['companyName'];												//title
		$ls_keywords=$config_rows['siteKeywords'];										//Keywords
		$ls_description=$config_rows['siteDescription'];							//Description
		$ls_cate=$cate;																								//左侧产品类别
		$ls_motif=$s_m_cate;
		$ls_menu=$menu;																								//主菜单
		$ls_newslist=$mido ;																			//新闻news 列表
		$ls_propage=$propage;																					//新闻分页页码
		$ls_foot=$foot;																								//底部信息
		
		$ls_feedbackemail="";
		$mainpart=$ls_newslist ;
		$mainpartsubject="faq";
		$filename = "../faq".$suffix_str.".html";
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
	}//end of while all news cats
}
  		echo "共有".$mynum."条常见问题。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
		if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

		echo "<br/><br/>";
	
	//end of while all news cats

	 if($ls!="all" && $ls!="all_products")
 {break;}
 
 case "feedback":  //生成 feedback
		
		$index_path="../".$templates_var."/feedback.html";	//模板地址
		$ls_title=$config_rows['companyName'];//title
		$ls_keywords=$config_rows['siteKeywords'];	//Keywords
		$ls_description=$config_rows['siteDescription'];//Description
		//$ls_cate=$pro_cate;																						//左侧产品类别
		//$ls_menu=$menu_pro;																						//主菜单
		$ls_cate=$cate;				//左侧产品类别
		$ls_p_cate=$s_p1_cate;
		$ls_motif=$s_m_cate;
		$ls_menu=$menu;	//主菜单
		$ls_feedback=$config_rows['feedback'] ;//feedback
		$ls_feedbackemail=$config_rows['email'] ;//E-Mail
		$ls_foot=$foot;	//底部信息
		
		$ls_propage="";
		$mainpart=$ls_feedback ;
		$mainpartsubject="feedback";
		$filename = "../feedback.html"; 
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);

	 	 if($ls!="all" && $ls!="all_products")
 {break;}	
 
 case "blog": //生成博客 Blog

	$news_cate_sql2="select * from `ls_functioncates` where functionName='博客分类' and enable=1 order by Num asc ";

	$result_cate=$opendb->query($news_cate_sql2);
	$num_cate=mysql_num_rows($result_cate);
	$catenews = mysql_fetch_assoc($result_cate);
	$i_news=1;
	 
	
	//博客友情链接
	$links_sql = "select * from ls_links where enable = 1 and cateName = 'Blog'";
	$links_query = $opendb->query($links_sql);
	while($links_rows=mysql_fetch_assoc($links_query)){
		$links_str .= "<li><a href ='".$links_rows['linkURL']."' target='_blank'>".$links_rows['linkTitle']."</a></li>";
	}
	$ls_links = $links_str;
	$ls_s_news = $ls_h1_news;
	$blog_path="../".$templates_var."/blogindex.html";
	if(file_exists($blog_path)){
		if($translate != ''){
			$folder_name = $translate;
			$r_name = deep_in_array($folder_name, $translate_name);
			$translateFile = "../".$r_name['folder_name'];
			createFolder($translateFile."/".$blogFolders);
		}else{
			createFolder("../".$blogFolders);
		}
		
		$fp	   = fopen ($blog_path,"r");
		$blogcontent = fread ($fp,filesize ($blog_path));
		//$blogcontent = str_replace("../","",$blogcontent);
		$blogcontent = str_replace("{ls_title}",$ls_title,$blogcontent);
		$blogcontent = str_replace("{ls_keywords}",$ls_keywords,$blogcontent);
		$blogcontent = str_replace("{ls_description}",$ls_description,$blogcontent);
		//$ menu_pro P -> $ ls_menu T -> { ls_menu} T
		$blogcontent = str_replace("{ls_menu}",$ls_menu,$blogcontent);
		$blogcontent = str_replace("{ls_cate}",$ls_cate,$blogcontent);
		$blogcontent = str_replace("{ls_s_cate}",$s_pro_cate,$blogcontent);
		$blogcontent = str_replace("{ls_p_cate}",$s_p_cate,$blogcontent);
		//   $ languages  P -> $ ls_languages T 等 -> { ls_languages}
		$blogcontent = str_replace("{ls_languages}",$languages,$blogcontent);
		$blogcontent = str_replace("{ls_f_cate}",$ls_f_cate,$blogcontent);
		$blogcontent = str_replace("{ls_motif}",$ls_motif,$blogcontent);
		$blogcontent = str_replace("{ls_news}",$ls_s_news,$blogcontent);
		$blogcontent = str_replace("{ls_propage}",$ls_propage,$blogcontent);
		$ls_facebook_twitter = $facebook_twitter;
		$blogcontent = str_replace("{ls_weibo}",$ls_facebook_twitter,$blogcontent);
		$ls_facebook_twitter_share = $facebook_twitter_share;
		$blogcontent = str_replace("{ls_weiboshare}",$ls_facebook_twitter_share,$blogcontent);
		$blogcontent = str_replace("{ls_links}",$ls_links,$blogcontent);
		$blogcontent = str_replace("{ls_addprolink}",$ls_addprolink,$blogcontent);	//指向主菜单中的Products链接
		$blogcontent = str_replace("{ls_addnewprolink}",$ls_addnewprolink,$blogcontent);	//指向主菜单中的NewProducts链接
		$tem_sql="select * from ls_config order by ID";	
		$tem_query=$opendb->query($tem_sql);
		$row=mysql_fetch_array($tem_query);
		$blogcontent = str_replace("{ls_copyright}",$row['copyright'],$blogcontent);
		$blogcontent = str_replace("{ls_linkblog}",$ls_links,$blogcontent);
		$bcate = $blogcontent;
		$sort='';
		
		//博客首页不分类别输出前N条最新博客 start
		$p22 = "%<ls_foreach>(.*?)</ls_foreach>%si";    //正则表达式
		preg_match_all($p22, $bcate, $arr);
		$bloginarr = $arr[1][0];
		
		$news_sql3="select * from ls_functioncates, ls_news where ls_news.enable=1 and ls_functioncates.cateName = ls_news.cate and ls_functioncates.functionName = '博客分类' order by ls_news.Num desc ";
		$news_query3=$opendb->query($news_sql3);
		$mido = "";
		$blog_i = 0;
		while($news_rows3=mysql_fetch_assoc($news_query3)){
			$suffix_str2 = $news_rows3['suffStr'];
			$blog_i++;
			if(strpos($news_rows3['newsText'],'<img') !== false){
				
				$newsImgStr=getStrbyTag("<img ","/>",$news_rows3['newsText']);
				$imgHeight=getStrbyTag('height="','" ',$newsImgStr,false);
				$imgWidth=getStrbyTag('width="','" ',$newsImgStr,false);
				$newsImg=getStrbyTag('src="','" ',$newsImgStr);
				$srcImg = getSubstr($newsImg,"src=\"",'"');
				$srcImg = strtolower(getSubstr($newsImg,'src="','"'));  //变小写，清除 src= " 等
				$imgurl = $srcImg;
				$srcImg = str_replace('src=','',$srcImg);
				$srcImg = str_replace('"','',$srcImg);

				$proportion = " width='220' height='180' ";
				$blogimg = $newsImg.$proportion;
			}else{
				$blogimg="src=\"../ls_admin/images/blog.jpg\" width='220'";
			}
	
			$blogimg = "<a href=\"blog".$suffix_str2.$news_rows3['ID'].".html\"><img ".$blogimg." /></a>";
			$blogtime = $news_rows3['newsDate'];
			$blogtitle = "<a href=\"blog".$suffix_str2.$news_rows3['ID'].".html\">".$news_rows3['newsTitle']."</a>";
			$blogtext = mb_substr(strip_tags($news_rows3['newsText']),0,$blog_descrption_num,'utf-8').((strlen(strip_tags($news_rows3['newsText']))>$blog_descrption_num)?" <a href=\"blog".$suffix_str2.$news_rows3['ID'].".html\">(More...)</a>":"");
			
			$blogindexstr = "";
			
			if($blog_i <= $blog_index_num){
				$blogindexstr = str_replace("{ls_blogimg}",$blogimg,$bloginarr);
				$blogindexstr = str_replace("{ls_blogtime}",$blogtime,$blogindexstr);
				$blogindexstr = str_replace("{ls_blogtitle}",$blogtitle,$blogindexstr);
				$blogindexstr = str_replace("{ls_blogtext}",$blogtext,$blogindexstr);
				
				$blogindex2 .= $blogindexstr;
			}
			
		}
		//博客首页不分类别输出前N条最新博客 end
		
		$p = "%<ls_blogcate>(.*?)</ls_blogcate>%si";    //正则表达式
		preg_match_all($p, $bcate, $arr);
		$blogcatearr = $arr[1];
		foreach($blogcatearr as $val){
			//echo $val."&&&&&&&&&&&&&&";
			$blog22 = "";
			$result_cate2=$opendb->query($news_cate_sql2);
			while($catenews = mysql_fetch_assoc($result_cate2))
			{
				$mido = "<h3>".$catenews['cateName']."</h3>";
				$news_sql2="select * from ls_news where enable=1 and cate='".$catenews['cateName']."' order by Num desc ";
				$suffix_str2=$catenews['suffStr'];
				
				$cate_val = str_replace("{ls_blogtag}",$catenews['cateName'],$val);
				$cate_val = str_replace("{ls_blogmore}","blog".$catenews['suffStr'].".html",$cate_val);
				
				//echo $cate_val."****************";
				$p2 = "%<ls_foreach>(.*?)</ls_foreach>%si";    //正则表达式
				preg_match_all($p2, $cate_val, $arr);
				$blogarr = $arr[1][0];
				//echo $blogarr."%%%%%%%%%%%%%%%%%%";
				
				$result=$opendb->query($news_sql2);
				$mynum = mysql_num_rows($result);//总产品数
					// 每页数量
				$onepage = $PageNumBlog;
					//共有页数
				$allpages = ceil($mynum/$onepage);
					
				//echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
				//页码计算  在ls_syscode里面
				$blogindex = "";
				for ($i=0; $i<= $allpages; $i++){
					$newslist="";
					$suffix_str=$suffix_str2;
					if($i == 0)
					{
						$suffix_str = $suffix_str;
					} 
					else 
					{
						$suffix_str = $suffix_str."-".$i;
					}
					$start = $i * $onepage;
					$propage=getPagess("blog".$catenews['suffStr'].".html",$allpages,$i+1);	
					
					//查询产品
					$news_sql=$news_sql2." limit ".$start.",".$onepage." ";
					
				$index_path="../".$templates_var."/bloglist.html";
				if(file_exists($index_path)){
					$fp	   = fopen ($index_path,"r");
					$content = fread($fp,filesize ($index_path));
					$ls_newstag = $catenews['suffStr'];
					
					$p3 = "%<ls_foreach>(.*?)</ls_foreach>%si";    //正则表达式
					preg_match_all($p3, $content, $arr);
					$temarr = $arr[1][0];
					
					$news_query=$opendb->query($news_sql);
					$mido = "";
					$blog_i = 0;
					while($news_rows=mysql_fetch_assoc($news_query))
					{
						$blog_i++;
						if(strpos($news_rows['newsText'],'<img') !== false){
							
							$newsImgStr=getStrbyTag("<img ","/>",$news_rows['newsText']);
							$imgHeight=getStrbyTag('height="','" ',$newsImgStr,false);
							$imgWidth=getStrbyTag('width="','" ',$newsImgStr,false);
							$newsImg=getStrbyTag('src="','" ',$newsImgStr);
							$srcImg = getSubstr($newsImg,"src=\"",'"');
							$srcImg = strtolower(getSubstr($newsImg,'src="','"'));  //变小写，清除 src= " 等
							$imgurl = $srcImg;
							$srcImg = str_replace('src=','',$srcImg);
							$srcImg = str_replace('"','',$srcImg);
							
							$proportion = " width='220' height='180' ";
							$blogimg = $newsImg.$proportion;
						}else{
							$blogimg="src=\"../ls_admin/images/blog.jpg\" width='220'";
						}
			
						$ls_lineno=__LINE__.(__FUNCTION__==""?"":"， 函数：".__FUNCTION__).(__CLASS__==""?"":"， 类：".__CLASS__);

						$blogimg = "<a href=\"blog".$suffix_str2.$news_rows['ID'].".html\"><img ".$blogimg." /></a>";
						$blogtime = $news_rows['newsDate'];
						$blogtitle = "<a href=\"blog".$suffix_str2.$news_rows['ID'].".html\">".$news_rows['newsTitle']."</a>";
						$blogtext = mb_substr(strip_tags($news_rows['newsText']),0,$blog_descrption_num,'utf-8').((strlen(strip_tags($news_rows['newsText']))>$blog_descrption_num)?" <a href=\"blog".$suffix_str2.$news_rows['ID'].".html\">(More...)</a>":"");
						
						$blogstr = str_replace("{ls_blogimg}",$blogimg,$temarr);
						$blogstr = str_replace("{ls_blogtime}",$blogtime,$blogstr);
						$blogstr = str_replace("{ls_blogtitle}",$blogtitle,$blogstr);
						$blogstr = str_replace("{ls_blogtext}",$blogtext,$blogstr);
						
						$mido .= $blogstr;
						$blogindexstr = "";
						
						if($blog_i <= $blog_index_num){
							$blogindexstr = str_replace("{ls_blogimg}",$blogimg,$blogarr);
							$blogindexstr = str_replace("{ls_blogtime}",$blogtime,$blogindexstr);
							$blogindexstr = str_replace("{ls_blogtitle}",$blogtitle,$blogindexstr);
							$blogindexstr = str_replace("{ls_blogtext}",$blogtext,$blogindexstr);
							
							$blogindex .= $blogindexstr;
						}
						$index_newspath="../".$templates_var."/blogshow.html";		//模板地址
						if(file_exists($index_newspath)){
							$newstag=$news_rows['cate'];
							$newstitle=$news_rows['newsTitle'];
							$newstext=$news_rows['newsText'];
							$ls_newstime = $news_rows['newsDate'];
							$ls_newid = $news_rows['ID'];
							$ls_click_n = $news_rows['clickNum'];
							createFolder("../".$newsshowFolders);
							
							
							$ls_title = $news_rows['title'];				//title
							$ls_keywords=$news_rows['keywords'];			//Keywords
							$ls_description=$news_rows['description'];	//Description
							$ls_cate=$pro_cate;
							
							$ls_s_cate=$s_pro_cate;								//左侧产品类别;
							$ls_p_cate=$s_p_cate;								//左侧产品类别;
							$ls_languages=$languages;                           //语言国旗
							$ls_f_cate=get_pro_cate(1);
							$ls_motif=$s_m2_cate;
							$ls_menu=$menu_pro;									//主菜单
							$ls_newstitle=$newstitle ;							//新闻标题
							$ls_newstext=$newstext;
							$ls_url="../";										//链接		
							$ls_foot=$foot;										//底部信息
							
							$fp	   = fopen ($index_newspath,"r");
							$newscontent = fread ($fp,filesize ($index_newspath));
							$newscontent = str_replace("{ls_title}",$ls_title,$newscontent);
							$newscontent = str_replace("{ls_keywords}",$ls_keywords,$newscontent);
							$newscontent = str_replace("{ls_description}",$ls_description,$newscontent);
							//$ menu_pro P -> $ ls_menu T -> { ls_menu} T
							$newscontent = str_replace("{ls_menu}",$ls_menu,$newscontent);
							$newscontent = str_replace("{ls_cate}",$ls_cate,$newscontent);
							$newscontent = str_replace("{ls_s_cate}",$ls_s_cate,$newscontent);
							$newscontent = str_replace("{ls_p_cate}",$ls_p_cate,$newscontent);
							
							//   $ languages  P -> $ ls_languages T 等 -> { ls_languages}
							$newscontent = str_replace("{ls_languages}",$ls_languages,$newscontent);
							$newscontent = str_replace("{ls_f_cate}",$ls_f_cate,$newscontent);
							$newscontent = str_replace("{ls_motif}",$ls_motif,$newscontent);
							$newscontent = str_replace("{ls_propage}",$ls_propage,$newscontent);
							$newscontent = str_replace("{ls_weibo}",$ls_facebook_twitter,$newscontent);
							$ls_facebook_twitter_share = $facebook_twitter_share;
							$newscontent = str_replace("{ls_weiboshare}",$ls_facebook_twitter_share,$newscontent);
							
							$ls_indicatebar = "<li><a href=\"../index.html\">".$lan['home']."</a></li>
											   <li style='text-transform : capitalize;'><a href=\"../news".$suffix_str2.".html\">".$suffix_str2."</a></li>";
							$newscontent = str_replace("{ls_indicatebar}",$ls_indicatebar,$newscontent);
							
							$newscontent = preg_replace("%<ls_blogcate>(.*?)</ls_blogcate>%si", get_blog_cate($index_newspath), $newscontent);
							
							$newscontent = str_replace("{ls_blogtag}",$catenews['cateName'],$newscontent);
							$newscontent = str_replace("{ls_blogmore}","blog".$catenews['suffStr'].".html",$newscontent);
							
							$newscontent = str_replace("{ls_news}",$ls_s_news,$newscontent);
							
							$newscontent = str_replace("{ls_newstime}",$ls_newstime,$newscontent);
							$newscontent = str_replace("{ls_newid}",$ls_newid,$newscontent);
							$newscontent = str_replace("{ls_click_n}",$ls_click_n,$newscontent);
							
							$newscontent = str_replace("{ls_newstitle}",$ls_newstitle,$newscontent);
							$newscontent = str_replace("{ls_newstext}",$ls_newstext,$newscontent);
							$newscontent = str_replace("{ls_newsdongtai}",$ls_newsdongtai2,$newscontent);		//子目录下新闻
				//new
							$newscontent = str_replace("{ls_newsgonggao}",$ls_newsgonggao2,$newscontent);
							$newscontent = str_replace("{ls_links}",$ls_links,$newscontent);
							$newscontent = str_replace("{ls_newsall}",$ls_newsall2,$newscontent);
							$newscontent = str_replace("{ls_newstieshi}",$ls_newstieshi2,$newscontent);
							$newscontent = str_replace("{ls_site_cate}",$s_site_cate,$newscontent);
				
							$newscontent = str_replace("{ls_url}",$ls_url,$newscontent);
							$newscontent = str_replace("{ls_foot}",$ls_foot,$newscontent);
							$newscontent = str_replace("{ls_addprolink}",$ls_addprolink,$newscontent);	//指向主菜单中的Products链接
							$newscontent = str_replace("{ls_addnewprolink}",$ls_addnewprolink,$newscontent);	//指向主菜单中的NewProducts链接
							$newscontent = str_replace("{ls_copyright}",$row['copyright'],$newscontent);
							$newscontent = circleNavigationLinkNews($news_rows['ID'],'B','{ls_nextlink}',$newscontent,"ls_news",$catenews['cateName'],"blog",$suffix_str2,true);
							$newscontent = circleNavigationLinkNews($news_rows['ID'],'F','{ls_previouslink}',$newscontent,"ls_news",$catenews['cateName'],"blog",$suffix_str2,true);
							
							$newscontent = str_replace("{newstag}",$newstag,$newscontent);
							$linksblog_sql = "select * from ls_links where enable = 1 and cateName = 'Blog'";
							$linksblog_query = $opendb->query($linksblog_sql);
							while($linksblog_rows=mysql_fetch_assoc($linksblog_query)){
							$linksblog_str .= "<li><a href ='".$linkblogs_rows['linkURL']."' target='_blank'>".$linksblog_rows['linkTitle']."</a></li>";
		}
							$ls_linkblog = $linksblog_str;							
							$newscontent = str_replace("{ls_linkblog}",$ls_linkblog,$newscontent);
							
							if($suffix_str == "_dongtai"){
								$newscontent = str_replace("<li id=\"current\"><a href=\"../news.html\">","<li><a href=\"../news.html\">",$newscontent);
								$newscontent = str_replace("<li><a href=\"../technology.html\">","<li id=\"current\"><a href=\"../technology.html\">",$newscontent);
							}
									
							$filename="../".$blogFolders."/blog".$suffix_str2.$news_rows['ID'].".html";
							if($translate != ''){
								//翻译代码
								$folder_name = $translate;
								$r_name = deep_in_array($folder_name, $translate_name);
						
								$translateFile = "../".$r_name['folder_name'];
								createFolder($translateFile);
								$transFile = str_replace("../", "", $filename);
								if(translateApp($newscontent, $translateFile."/".$transFile, $r_name['translate_name'])){
									echo "创建 <a href='".$translateFile."/".$transFile."'>".$translateFile."/".$transFile."</a>成功！<a href=\"temp.php?ls=normal\"><u>返回</u></a>";
									if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
									echo "<br/><br/>";

									
								}else{
									if($ls_debug) echo "生成文件".$translateFile."/".$transFile."失败！<br>";
								}
							}else{
								if (is_file ($filename)){ 
									 @unlink ($filename); //若文件已存在，则删除
								}
								//英文网站去除<translate>标签
								$translate_str = $newscontent;
								$p = "%<translate>(.*?)</translate>%si";    //正则表达式
								preg_match_all($p, $newscontent, $arr2);
								$temarr2 = $arr2[1];
								
								$source="en";
								$targets = $target;
							
								foreach($temarr2 as $val2){
									$newscontent = str_replace("<translate>".$val2."</translate>", $val2, $newscontent);
								}
							   $handle   = fopen ($filename,"w"); //打开文件指针，
									/*
									检查文件是否被创建且可写
									 */
										 
								if (!is_writable ($filename)){ 
									 if($ls_debug) echo "<script>alert('文件：".$filename."不可写，请检查其属性后重试！');history.go(-1);</script>";
								}
								if (!fwrite ($handle,$newscontent)){  //将信息写入文件
									if($ls_debug) echo "'生成文件".$filename."失败！";
								 } 
								fclose ($handle); //关闭指针
								 //echo "创建<a href='".$filename."'>".$filename."</a>成功！<a href=\"temp.php?ls=normal\"><u>返回</u></a><br/><br/>";
							}
							fclose ($fp);
						}else{
							if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
						}
					}
					echo "共有".$mynum."条博客。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
					if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
					echo "<br/><br/>";
				}else{
					if($ls_debug) echo "<p>模版文件".$index_path."不存在，请设计好模板后重新生成。</p>";
				}
				
				$blog123 = str_replace("<ls_foreach>".$blogarr."</ls_foreach>", $blogindex, $cate_val);
				
				$ls_title=$config_rows['companyName'];												//title
				$ls_keywords=$config_rows['siteKeywords'];										//Keywords
				$ls_description=$config_rows['siteDescription'];							//Description	
				$ls_cate=$cate;		
				//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;																								//主菜单
				$ls_newslist=$mido;																			//新闻news 列表
				$ls_propage=$propage;																					//新闻分页页码
				$ls_foot=$ls_links;																								//底部信息
				
				$ls_feedbackemail="";
				$mainpart=$ls_newslist ;
				$mainpartsubject="blog";
				$filename = "../".$blogFolders."/blog".$suffix_str.".html";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
		$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_pro_cate,$s_p_cate,$languages,$ls_addprolink,$ls_addnewprolink,$ls_newstag,$translate);
			}//end of while all news cats
			$blog22 .= $blog123;
		  }
		  $blogcontent = str_replace("<ls_foreach>".$bloginarr."</ls_foreach>", $blogindex2, $blogcontent);
		  $blogcontent = str_replace("<ls_blogcate>".$val."</ls_blogcate>", $blog22, $blogcontent);
		}
		$filename="../".$blogFolders."/index.html";
				
		if (is_file ($filename))
		{ 
			 @unlink ($filename); //若文件已存在，则删除
		}
		
		if($translate != ''){
			//翻译代码
			$folder_name = $translate;
			$r_name = deep_in_array($folder_name, $translate_name);
	
			$translateFile = "../".$r_name['folder_name'];
			createFolder($translateFile);
			$transFile = str_replace("../", "", $filename);
			if(translateApp($blogcontent, $translateFile."/".$transFile, $r_name['translate_name'])){
				echo "创建 <a href='".$translateFile."/".$transFile."'>".$translateFile."/".$transFile."</a>成功！<a href=\"temp.php?ls=normal\"><u>返回</u></a>";
				if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
				echo "<br/><br/>";

			}else{
				if($ls_debug) echo "生成文件".$translateFile."/".$transFile."失败！<br>";
			}
		}else{
			//英文网站去除<translate>标签
			$translate_str = $blogcontent;
			$p = "%<translate>(.*?)</translate>%si";    //正则表达式
			preg_match_all($p, $blogcontent, $arr);
			$temarr = $arr[1];
			
			$source="en";
			$targets = $target;
		
			foreach($temarr as $val){
				$blogcontent = str_replace("<translate>".$val."</translate>", $val, $blogcontent);
			}
		   $handle   = fopen ($filename,"w"); //打开文件指针，
				/*
				检查文件是否被创建且可写
				 */
			if (!is_writable ($filename)){ 
				 if($ls_debug) echo "<script>alert('文件：".$filename."不可写，请检查其属性后重试！');history.go(-1);</script>";
				 if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

			}
			if (!fwrite ($handle,$blogcontent)){  //将信息写入文件
				if($ls_debug) echo "'生成文件".$filename."失败！";
				if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

			 } 
			fclose ($handle); //关闭指针
			 //echo "创建<a href='".$filename."'>".$filename."</a>成功！<a href=\"temp.php?ls=normal\"><u>返回</u></a><br/><br/>";
		}
		fclose ($fp);
	}else{
		if($ls_debug) echo "<p>模版文件".$blog_path."不存在，请设计好模板后重新生成。</p>";
		if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

	}
	
	 if($ls!="all" && $ls!="all_products")
 {break;}
	 
	case "download": //生成下载
		
		$news_sql2="select * from ls_download where enable=1 order by ID desc ";
	  	$result=$opendb->query($news_sql2);
		$mynum = mysql_num_rows($result);//总产品数
		// 每页数量
		$onepage = $PageNumDowbloads; 
		//共有页数
		$allpages = ceil($mynum/$onepage);
		
		//echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
			
			//页码计算
			$propage=getPages("download.html",$allpages);
			//页码计算
			
		for ($i=0; $i<= $allpages; $i++)
		{ 
			if ($i == 0)
			{ 
			$indexpath = "download.html";
		  	} 
		  	else 
		  	{ 
				$indexpath = "download-".$i.".html";
		  	}
			 $start = $i * $onepage;
			 $downlist="";
		 //查询产品
		 
		 $news_sql=$news_sql2. " limit ".$start.",".$onepage." ";
		// echo $news_sql;
			 $news_query=$opendb->query($news_sql);
	
			 while($news_rows=mysql_fetch_assoc($news_query))
			{
					$down_size = round($news_rows['downloadSize']/1000);
					if($down_size > 1048576){
						$size = sprintf("%.2f", $value1['downloadSize']/1048576)."MB";
					}else{
						$size = $down_size."KB";
					}
					$downlist.="<li><span style=\"float:right;\">".$size."</span><a href=\"".$downloadFolders."/".$news_rows['downloadName']."\" onclick='$.download_times(".$news_rows['ID'].")' title=\"Size:".$size."\">".$news_rows['downloadTitle']."</a></li>";
				}
				$index_path="../".$templates_var."/download.html";		  //模板地址
				$ls_title=$config_rows['companyName'];				//title
				$ls_keywords=$config_rows['siteKeywords'];			//Keywords
				$ls_description=$config_rows['siteDescription'];	//Description
				$ls_cate=$cate;																								//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;																								//主菜单
				$ls_downlist=$downlist ;																			//新闻news 列表
				$ls_propage=$propage;																					//新闻分页页码
				$ls_foot=$foot;																								//底部信息
				
		$ls_feedbackemail="";
		$mainpart=$ls_downlist;
		$mainpartsubject="download";
		$filename = "../".$indexpath;
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);

		}
	
	  		
	  	echo "共有".$mynum."条下载。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
		if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
		echo "<br/><br/>";
		 if($ls!="all" && $ls!="all_products")
 {break;}
		
	case "management": //生成管理团队(Management)
	
		$news_sql3="select * from ls_menu where menuName='Management'";
		$news_query3=$opendb->query($news_sql3);
		$news_rows3=mysql_fetch_assoc($news_query3);
		$introduction = $news_rows3['description'];
		$introduction =  str_replace("../", "", $introduction);
		
		$news_sql2="select * from ls_management where enable=1 order by Num desc ";
		$result=$opendb->query($news_sql2);
		$mynum = mysql_num_rows($result);//总产品数
		// 每页数量
		$onepage = $PageNum; 
		//共有页数
		$allpages = ceil($mynum/$onepage);

		echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
		
		//页码计算
		$propage=getPages("quality.html",$allpages);

		//根据页码生成文件名
		for ($i=0; $i<= $allpages; $i++){ 
			$news_sql2="select * from ls_management where enable=1 order by Num desc ";
			if ($i == 0){ 
				$indexpath = "management.html";
			}else{ 
				$indexpath = "management-".$i.".html";
			}
			$start = $i * $onepage;
			
			if($allpages!=1){
				$ls_current_page=$i+1;		//当前页码
			}
			
			//查询产品
			$news_sql2.=" limit ".$start.",".$onepage." ";
			$news_query=$opendb->query($news_sql2);
			$list="<div class=\"p_list\">";
			while($news_rows=mysql_fetch_assoc($news_query)){
				$list.="<div class=\"col-lg-4 col-md-4 col-sm-6 col-xs-12\">
						<div class=\"thumbnail\">
							<div class=\"img-pic\">
						  <a href=\"".$managementFolders."/management-page".$news_rows['ID'].".html\" title=\"<translate>".$news_rows['Title']."</translate>\" class=\"c-img-height\"><img src=\"".$managementFolders."/".$SmallFoldersProducts."/".$news_rows['Pic']."\" border=\"0\" class='img-responsive' alt=\"<translate>".$news_rows['Title']."</translate>\" /></a>
						  </div>
						  <div class=\"caption pro-name\">
							<h5><a href=\"".$managementFolders."/management-page".$news_rows['ID'].".html\"  title=\"<translate>".$news_rows['Title']."</translate>\" ><translate>".$news_rows['Title']."</translate></a></h5>
						  </div>
						</div>
					  </div>";
				
				$index_newspath="../".$templates_var."/managementshow.html";		//模板地址
				if(file_exists($index_newspath)){
					
					writeShowPages($news_rows, $suffix_str2, "management", "management", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['management'], $translate);
					
				}else{
					if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
					if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

				}
			}
			$list.="</div>";
			
			//页码计算
			$propage=getPagess("management.html",$allpages,$ls_current_page);
			
			$index_path="../".$templates_var."/management.html";				//车间模板地址
			$ls_title=$news_rows3['inTitle'];												//title
			$ls_keywords=$news_rows3['inKeywords'];										//Keywords
			$ls_description=$news_rows3['inDescription'];							//Description
			$ls_cate=$cate;											//左侧产品类别
			$ls_motif=$s_m_cate;
			$ls_menu=$menu;											//主菜单
			$ls_list=$list ;										//车间图片列表
			$ls_introduction=$introduction;                           //车间简介
			$ls_propage=$propage;									//车间分页页码
			$ls_foot=$foot;											//底部信息
			
			$ls_feedbackemail="";
			$mainpart=$ls_list;
			$mainpartsubject="management";
			$filename = "../{$indexpath}";
			writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
		}
		
	  	echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
		if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
		echo "<br/><br/>";
		
		 if($ls!="all" && $ls!="all_products")
 {break;}
		
		case "workshop": //生成车间图片(Workshop)
		
			$news_sql3="select * from ls_menu where menuName='workshop'";
			$news_query3=$opendb->query($news_sql3);
			$news_rows3=mysql_fetch_assoc($news_query3);
			$introduction = $news_rows3['description'];
			$introduction =  str_replace("../", "", $introduction);
		
			$news_sql2="select * from ls_workshop where enable=1 order by Num desc";
	 		$result=$opendb->query($news_sql2);
			$mynum = mysql_num_rows($result);//总产品数
			// 每页数量
			$onepage = $WorkshopPageNum; 
			//共有页数
			$allpages = ceil($mynum/$onepage);

			echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
			
			//页码计算
			$propage=getPages("workshop.html",$allpages);

			//根据页码生成文件名
			for ($i=0; $i<= $allpages; $i++){
				$news_sql2="select * from ls_workshop where enable=1 order by Num ";
				if ($i == 0){ 
					$indexpath = "workshop.html";
		 		}else{ 
					$indexpath = "workshop-".$i.".html";
		 		}
				$start = $i * $onepage;
				
				if($allpages!=1){
					$ls_current_page=$i+1;		//当前页码
				}

		 		//查询产品
				$news_sql2.=" limit ".$start.",".$onepage." ";
				$news_query=$opendb->query($news_sql2);
				$list="<div class=\"row pro_list\">";
				while($news_rows=mysql_fetch_assoc($news_query)){
					$list.="<div class=\"col-lg-3 col-md-4 col-sm-6 col-xs-12\">
							<div class=\"thumbnail\">
								<div class=\"img-pic\">
							  <a href=\"".$WorkShopFolders."/workshop-page".$news_rows['ID'].".html\"  title=\"<translate>".$news_rows['workshopTitle']."</translate>\" class=\"c-img-height\"><img src=\"".$WorkShopFolders."/".$SmallFoldersProducts."/".$news_rows['workshopPic']."\" border=\"0\" class='img-responsive' alt=\"<translate>".$news_rows['Title']."</translate>\" /></a>
							  </div>
							  <div class=\"caption pro-name\">
								<h5><a href=\"".$WorkShopFolders."/workshop-page".$news_rows['ID'].".html\"  title=\"<translate>".$news_rows['workshopTitle']."</translate>\" ><translate>".$news_rows['workshopTitle']."</translate></a></h5>
							  </div>
							</div>
						  </div>";
					
					$index_newspath="../".$templates_var."/workshopshow.html";		//模板地址
					if(file_exists($index_newspath)){
						
						writeShowPages($news_rows, $suffix_str2, "workshop", "workshop", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['workshop'],  $translate);
						
						
					}else{
						if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
						if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
						echo  "<br/>";

					}
				}
				$list.="</div>";
				
				//页码计算
				$propage=getPagess("workshop.html",$allpages,$ls_current_page);
				
				$index_path="../".$templates_var."/workshop.html";				//车间模板地址
				$ls_title=$news_rows3['inTitle'];												//title
				$ls_keywords=$news_rows3['inKeywords'];										//Keywords
				$ls_description=$news_rows3['inDescription'];							//Description
				$ls_cate=$cate;											//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;											//主菜单
				$ls_list=$list ;										//车间图片列表
				$ls_introduction=$introduction;                           //车间简介
				$ls_propage=$propage;									//车间分页页码
				$ls_foot=$foot;											//底部信息
				
				$ls_feedbackemail="";
				$mainpart=$ls_list;
				$mainpartsubject="workshop";
				$filename = "../{$indexpath}";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
	  		
	  		echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
			if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
			echo "<br/><br/>";
		
		 if($ls!="all" && $ls!="all_products")
 {break;}
		
		case "video": //生成视频(Video)
		
			$news_sql3="select * from ls_menu where menuName='video'";
			$news_query3=$opendb->query($news_sql3);
			$news_rows3=mysql_fetch_assoc($news_query3);
			$introduction = $news_rows3['description'];
		
			$news_sql2="select * from ls_video where enable=1 order by Num desc ";
	 		$result=$opendb->query($news_sql2);
			$mynum = mysql_num_rows($result);//总产品数
			// 每页数量
			$onepage = $PageNum; 
			//共有页数
			$allpages = ceil($mynum/$onepage);

			echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
			
			//页码计算
			$propage=getPages("workshop.html",$allpages);

			//根据页码生成文件名
			for ($i=0; $i<= $allpages; $i++){
				$news_sql2="select * from ls_video where enable=1 order by Num desc ";
				if ($i == 0){ 
					$indexpath = "video.html";
		 		}else{ 
					$indexpath = "video".$i.".html";
		 		}
				$start = $i * $onepage;
				
				if($allpages!=1){
					$ls_current_page=$i+1;		//当前页码
				}

		 		//查询产品
				$news_sql2.=" limit ".$start.",".$onepage." ";
				$news_query=$opendb->query($news_sql2);
				$list="<ul class=\"p_list\">";
				
				if("192.168.2.20"==$_SERVER["SERVER_ADDR"] || "pmf.lanscend.cn"==$_SERVER['HTTP_HOST']){
					$url=explode("/", $_SERVER["REQUEST_URI"]);
					$path = "/".$url[1];
				}else{
					$url="";
				}
				while($news_rows=mysql_fetch_assoc($news_query)){
					if($news_rows['code']==NULL){
						$list.="<li><embed src='".$path."/video/".$news_rows['videoFile']."' type='application/x-shockwave-flash' width='".$news_rows['videoW']."' height='".$news_rows['videoH']."' quality='high' /><translate>".$news_rows['videoName']."</translate></li>";
					}else{
						$list .= "<li>".$news_rows['code']."<br /><translate>".$news_rows['videoName']."</translate></li>";
					}
				}
				$list.="</ul>";
				
				//页码计算
				$propage=getPagess("video.html",$allpages,$ls_current_page);
				
				$index_path="../".$templates_var."/video.html";				//车间模板地址
				$ls_title=$config_rows['companyName'];					//title
				$ls_keywords=$config_rows['siteKeywords'];				//Keywords
				$ls_description=$config_rows['siteDescription'];		//Description
				$ls_cate=$cate;											//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;											//主菜单
				$ls_list=$list ;										//车间图片列表
				$ls_introduction=$introduction;                           //车间简介
				$ls_propage=$propage;									//车间分页页码
				$ls_foot=$foot;											//底部信息
				
				$ls_feedbackemail="";
				$mainpart=$ls_list;
				$mainpartsubject="video";
				$filename = "../{$indexpath}";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
	  		
	  		echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
			if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
			echo "<br/><br/>";
		
		 if($ls!="all" && $ls!="all_products")
 {break;}
		
			case "qualitycontrol": //生成管理团队(Management)
			
			$news_sql3="select * from ls_menu where menuName='Quality'";
			$news_query3=$opendb->query($news_sql3);
			$news_rows3=mysql_fetch_assoc($news_query3);
			$introduction = $news_rows3['description'];
			$introduction =  str_replace("../", "", $introduction);
			
			$news_sql2="select * from ls_qualitycontrol where enable=1 order by Num desc ";
	 		$result=$opendb->query($news_sql2);
			$mynum = mysql_num_rows($result);//总产品数
			// 每页数量
			$onepage = $PageNum; 
			//共有页数
			$allpages = ceil($mynum/$onepage);

			echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
			
			//页码计算
			$propage=getPages("quality.html",$allpages);

			//根据页码生成文件名
			for ($i=0; $i<= $allpages; $i++){ 
				$news_sql2="select * from ls_qualitycontrol where enable=1 order by Num desc ";
				if ($i == 0){ 
					$indexpath = "quality.html";
		 		}else{ 
					$indexpath = "quality-".$i.".html";
		 		}
				$start = $i * $onepage;
				
				if($allpages!=1){
					$ls_current_page=$i+1;		//当前页码
				}
				
		 		//查询产品
				$news_sql2.=" limit ".$start.",".$onepage." ";
				$news_query=$opendb->query($news_sql2);
				$list="<div class=\"p_list\">";
				while($news_rows=mysql_fetch_assoc($news_query)){
					$list.="<div class=\"col-lg-4 col-md-4 col-sm-6 col-xs-12\">
							<div class=\"thumbnail\">
								<div class=\"img-pic\">
							  <a href=\"".$QualitycateFolders."/quality-page".$news_rows['ID'].".html\" title=\"<translate>{$news_rows['Title']}</translate>\"><img src=\"".$QualitycateFolders."/".$SmallFoldersProducts."/".$news_rows['Pic']."\" alt=\"<translate>{$news_rows['Title']}</translate>\" border=\"0\"></a>
							  </div>
							  <div class=\"caption pro-name\">
								<h5><a href=\"".$QualitycateFolders."/quality-page".$news_rows['ID'].".html\" title=\"<translate>{$news_rows['Title']}</translate>\"><translate>".$news_rows['Title']."</translate></a></h5>
							  </div>
							</div>
						  </div>";
					
					$index_newspath="../".$templates_var."/qualityshow.html";		//模板地址
					if(file_exists($index_newspath)){
						
						writeShowPages($news_rows, $suffix_str2, "quality", "qualitycontrol", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['quality'], $translate);
						
					}else{
						if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
					}
				}
				$list.="</div>";
				
				//页码计算
				$propage=getPagess("quality.html",$allpages,$ls_current_page);
				
				$index_path="../".$templates_var."/quality.html";				//车间模板地址
				$ls_title=$news_rows3['inTitle'];												//title
				$ls_keywords=$news_rows3['inKeywords'];										//Keywords
				$ls_description=$news_rows3['inDescription'];							//Description
				$ls_cate=$cate;											//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;											//主菜单
				$ls_list=$list ;										//车间图片列表
				$ls_introduction=$introduction;                           //车间简介
				$ls_propage=$propage;									//车间分页页码
				$ls_foot=$foot;											//底部信息
				
				$ls_feedbackemail="";
				$mainpart=$ls_list;
				$mainpartsubject="qualitycontrol";
				$filename = "../{$indexpath}";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
	  		
	  		echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
			if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;
			echo "<br/><br/>";
		
		 if($ls!="all" && $ls!="all_products")
 {break;}
		
		
	case "rd": //生成研发(R&D)
		
		$news_sql3="select * from ls_menu where menuName='Research&Development'";
		$news_query3=$opendb->query($news_sql3);
		$news_rows3=mysql_fetch_assoc($news_query3);
		$introduction = $news_rows3['description'];
		$introduction =  str_replace("../", "", $introduction);
			
		$news_sql2="select * from ls_rd where enable=1 order by Num desc ";
	  $result=$opendb->query($news_sql2);
		$mynum = mysql_num_rows($result);//总产品数
		// 每页数量
		$onepage = $PageNum; 
		//共有页数
		$allpages = ceil($mynum/$onepage);
		
		//echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
			
			//页码计算
			$propage=getPages("rd.html",$allpages);
			//页码计算
			
			for ($i=0; $i< $allpages; $i++)
			{ 
			if ($i == 0)
			{ 
			$indexpath = "rd.html";
		  } 
		  else 
		  { 
			$indexpath = "rd".$i.".html";
		  }

		 $start = $i * $onepage;
		 //查询产品
		     $news_sql=$news_sql2." limit ".$start.",".$onepage." ";
			 $news_query=$opendb->query($news_sql);
	         $list="<ul class=\"list\">";
				while($news_rows=mysql_fetch_assoc($news_query)){
					$list.="
					<li><a href=\"".$rdFolders."/rd-page".$news_rows['ID'].".html\" title=\"<translate>{$news_rows['Title']}</translate>\">
							<img src=\"".$rdFolders."/".$SmallFoldersProducts."/".$news_rows['Pic']."\" border=\"0\">
							</a><br /><span><translate>".$news_rows['Title']."</translate></span></li>";

					$index_newspath="../".$templates_var."/rdshow.html";		//模板地址
					if(file_exists($index_newspath)){
						
						writeShowPages($news_rows, $suffix_str2, "rd", "rd", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['rd'], $translate);
						
					}else{
						if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
					}
				}
				$list.="</ul>";
				
				$index_path="../".$templates_var."/rd.html";										//模板地址
				$ls_title=$news_rows3['inTitle'];												//title
				$ls_keywords=$news_rows3['inKeywords'];										//Keywords
				$ls_description=$news_rows3['inDescription'];							//Description
				$ls_cate=$cate;																								//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;																								//主菜单
				$ls_list=$list ;																			//新闻news 列表
				$ls_introduction=$introduction;                           //简介
				$ls_propage=$propage;																					//新闻分页页码
				$ls_foot=$foot;																								//底部信息
				
		$ls_feedbackemail="";
		$mainpart=$ls_list;
		$mainpartsubject="rd";
		$filename = "../rd.html"; 
		writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);

				}
	  		
	  		echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
			if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

			echo "<br/><br/>";
		
		 if($ls!="all" && $ls!="all_products")
 {break;}
		
	case "certificate": //生成证书(Certificate)
		$news_sql3="select * from ls_menu where menuName='Certificate'";
		$news_query3=$opendb->query($news_sql3);
		$news_rows3=mysql_fetch_assoc($news_query3);
		$introduction = $news_rows3['description'];
		$introduction =  str_replace("../", "", $introduction);
		
		$news_sql2="select * from ls_certificate where enable=1 order by Num desc ";
		$result=$opendb->query($news_sql2);
		$mynum = mysql_num_rows($result);//总产品数
		// 每页数量
		$onepage = $CertificatePageNum; 
		//共有页数
		$allpages = ceil($mynum/$onepage);
		//echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
		//页码计算
		$propage=getPages("certificate.html",$allpages);
		//页码计算
		for ($i=0; $i<= $allpages; $i++){
			$news_sql2="select * from ls_certificate where enable=1 order by Num desc ";
			if ($i == 0){ 
				$indexpath = "certificate.html";
			}else{ 
				$indexpath = "certificate-".$i.".html";
			}
			$start = $i * $onepage;
			
			if($allpages!=1){
					$ls_current_page=$i+1;		//当前页码
			}
			
			//查询产品
			
			$ls_p_cate=$s_p_cate;								//左侧产品类别;
			$ls_languages = $languages;
			$ls_f_cate=get_pro_cate(1);	
		 
			$news_sql=$news_sql2." limit ".$start.",".$onepage." ";
			$news_query=$opendb->query($news_sql);
			$list = "<div class=\"row\">";
			while($news_rows=mysql_fetch_assoc($news_query)){
				$list.="<div class=\"col-lg-4 col-md-4 col-sm-6 col-xs-12\">
							<div class=\"thumbnail\">
								<div class=\"img-pic\">
							  <a href=\"".$CertificateFolders."/certificate".$news_rows['ID'].".html\"  title=\"<translate>".$news_rows['Title']."</translate>\" class=\"c-img-height\"><img src=\"".$CertificateFolders."/".$SmallFoldersProducts."/".$news_rows['Pic']."\" alt=\"<translate>".$news_rows['Title']."</translate>\" /></a>
							  </div>
							  <div class=\"caption pro-name\">
								<h5><a href=\"".$CertificateFolders."/certificate".$news_rows['ID'].".html\"  title=\"<translate>".$news_rows['Title']."</translate>\">".$news_rows['Title']."</a></h5>
							  </div>
							</div>
						  </div>";

					$index_newspath="../".$templates_var."/certificateshow.html";		//模板地址
					if(file_exists($index_newspath)){
						writeShowPages($news_rows, $suffix_str2, "certificate", "certificate", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['certificate'], $translate);
					}else{
						if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
					}
			}
			$list.="</div>";
			
			//页码计算
			$propage=getPagess("certificate.html",$allpages,$ls_current_page);
			
			$index_path="../".$templates_var."/certificate.html";//模板地址
			$ls_title=$news_rows3['inTitle'];												//title
			$ls_keywords=$news_rows3['inKeywords'];										//Keywords
			$ls_description=$news_rows3['inDescription'];							//Description
			$ls_cate=$cate;									//左侧产品类别
			$ls_motif=$s_m_cate;
			$ls_menu=$menu;									//主菜单
			$ls_list=$list ;								//新闻news 列表
			$ls_introduction=$introduction;                           //简介
			$ls_propage=$propage;							//新闻分页页码
			$ls_foot=$foot;									//底部信息
			$ls_feedbackemail="";
			$mainpart=$ls_list;
			$mainpartsubject="certificate";
			$filename = "../{$indexpath}";		
			writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
		}
	  	echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
		if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

		echo "<br/><br/>";
		if($ls!="all" && $ls!="all_products"){break;}
	
	
		case "packing": //生成包装(Packing)
			$news_sql3="select * from ls_menu where menuName='Packing'";
			$news_query3=$opendb->query($news_sql3);
			$news_rows3=mysql_fetch_assoc($news_query3);
			$introduction = $news_rows3['description'];
			$introduction =  str_replace("../", "", $introduction);
		
			$news_sql2="select * from ls_packing where enable=1 order by Num desc ";
	 		$result=$opendb->query($news_sql2);
			$mynum = mysql_num_rows($result);//总产品数
			// 每页数量
			$onepage = $PageNum; 
			//共有页数
			$allpages = ceil($mynum/$onepage);

			echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
			
			//页码计算
			$propage=getPages("packing.html",$allpages);

			//根据页码生成文件名
			for ($i=0; $i<= $allpages; $i++){ 
				$news_sql2="select * from ls_packing where enable=1 order by Num desc ";
				if ($i == 0){ 
					$indexpath = "packing.html";
		 		}else{ 
					$indexpath = "packing-".$i.".html";
		 		}
				$start = $i * $onepage;
				
				if($allpages!=1){
					$ls_current_page=$i+1;		//当前页码
				}
				
				$ls_p_cate=$s_p_cate;								//左侧产品类别;
				$ls_languages = $languages;
		 		//查询产品
				$news_sql2.=" limit ".$start.",".$onepage." ";
				$news_query=$opendb->query($news_sql2);
				$list="<div class=\"row pro_list\">";
				while($news_rows=mysql_fetch_assoc($news_query)){
					$list.="<div class=\"col-xs-4\">
							<div class=\"thumbnail\">
								<div class=\"img-pic2\">
							  <a href=\"".$packingFolders."/packing-page".$news_rows['ID'].".html\"  title=\"<translate>".$news_rows['Title']."</translate>\" class=\"c-img-height\"><img src=\"".$packingFolders."/".$SmallFoldersProducts."/".$news_rows['Pic']."\" alt=\"<translate>".$news_rows['Title']."</translate>\" /></a>
							  </div>
							  <div class=\"caption pro-name\">
								<a href=\"".$packingFolders."/packing-page".$news_rows['ID'].".html\"  title=\"<translate>".$news_rows['Title']."</translate>\"><translate>".$news_rows['Title']."</translate></a>
							  </div>
							</div>
						  </div>";

					$index_newspath="../".$templates_var."/packingshow.html";		//模板地址
					if(file_exists($index_newspath)){
						writeShowPages($news_rows, $suffix_str2, "packing", "packing", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['packing'], $translate);
					}else{
						if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
					}
				}
				$list.="</div>";
				
				//页码计算
				$propage=getPagess("packing.html",$allpages,$ls_current_page);
				
				$index_path="../".$templates_var."/packing.html";				//车间模板地址
				$ls_title=$news_rows3['inTitle'];												//title
				$ls_keywords=$news_rows3['inKeywords'];										//Keywords
				$ls_description=$news_rows3['inDescription'];							//Description
				$ls_cate=$cate;											//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;											//主菜单
				$ls_list=$list ;										//车间图片列表
				$ls_introduction=$introduction;                           //简介
				$ls_propage=$propage;									//车间分页页码
				$ls_foot=$foot;											//底部信息
				
				$ls_feedbackemail="";
				$mainpart=$ls_list;
				$mainpartsubject="packing";
				$filename = "../{$indexpath}";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
	  		
	  		echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
			
			if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

			echo "<br/><br/>";
		
		 if($ls!="all" && $ls!="all_products")
 {break;}
		
		
		case "brand": //生成品牌(Brand)
		$news_sql3="select * from ls_menu where menuName='brand'";
			$news_query3=$opendb->query($news_sql3);
			mysql_query("set names utf8");
			$news_rows3=mysql_fetch_assoc($news_query3);
			$introduction = $news_rows3['description'];
			$introduction =  str_replace("../", "", $introduction);
		
			$news_sql2="select * from ls_brand where enable=1 order by Num desc ";
	 		$result=$opendb->query($news_sql2);
			mysql_query("set names utf8");
			$mynum = mysql_num_rows($result);//总产品数
			// 每页数量
			$onepage = $brandPageNum; 
			//共有页数
			$allpages = ceil($mynum/$onepage);

			echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
			
			//页码计算
			$propage=getPages("quality.html",$allpages);

			//根据页码生成文件名
			for ($i=0; $i<= $allpages; $i++){
				$news_sql2="select * from ls_brand where enable=1 order by Num desc ";
				if ($i == 0){ 
					$indexpath = "brand.html";
		 		}else{ 
					$indexpath = "brand-".$i.".html";
		 		}
				$start = $i * $onepage;
				
				if($allpages!=1){
					$ls_current_page=$i+1;		//当前页码
				}

		 		//查询产品
				$news_sql2.=" limit ".$start.",".$onepage." ";
				$news_query=$opendb->query($news_sql2);
				mysql_query("set names utf8");
				$list="<div class=\"row pro_list\">";
				while($news_rows=mysql_fetch_assoc($news_query)){
					$list.="<div class=\"col-lg-4 col-md-4 col-sm-6 col-xs-12\">
							<div class=\"thumbnail\">
								<div class=\"img-pic\">
							  <a href=\"".$brandFolders."/brand-page".$news_rows['ID'].".html\" title=\"<translate>{$news_rows['Title']}</translate>\"><img src=\"".$brandFolders."/".$SmallFoldersProducts."/".$news_rows['Pic']."\" alt=\"<translate>{$news_rows['Title']}</translate>\" border=\"0\"></a>
							  </div>
							  <div class=\"caption pro-name\">
								<h5><a href=\"".$brandFolders."/brand-page".$news_rows['ID'].".html\" title=\"<translate>{$news_rows['Title']}</translate>\"><translate>".$news_rows['Title']."</translate></a></h5>
							  </div>
							</div>
						  </div>";
							
					$newstitle=$news_rows['Title'];
					$newimg = "<center><img src=\"../".$brandFolders."/".$BigFoldersProducts."/".$news_rows['Pic']."\" ondragstart=\"return false;\"/></center>";
					$newstext = $news_rows['Text'];
					$ls_newid = $news_rows['ID'];
					createFolder("../m/".$brandFolders);
					
					$index_newspath="../".$templates_var."/brandshow.html";		//模板地址
					if(file_exists($index_newspath)){
						writeShowPages($news_rows, $suffix_str2, "brand", "brand", $menu_pro, $pro_cate, $s_pro_cate, $s_m2_cate, $ls_propage, $facebook_twitter, $s_site_cate, $foot, $ls_addprolink, $ls_addnewprolink, $ls_h1_news, $s_p_cate, $languages, get_pro_cate(1), $lan['brand'], $translate);
					}else{
						if($ls_debug) echo "<p>模版文件".$index_newspath."不存在，请设计好模板后重新生成。</p>";
					}
				}
				$list.="</div>";
				
				//页码计算
				$propage=getPagess("brand.html",$allpages,$ls_current_page);
				
				$index_path="../".$templates_var."/brand.html";				//车间模板地址
				$ls_title=$news_rows3['inTitle'];												//title
				$ls_keywords=$news_rows3['inKeywords'];										//Keywords
				$ls_description=$news_rows3['inDescription'];							//Description
				$ls_cate=$ls_m_cate;			//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;											//主菜单
				$ls_list=$list ;										//车间图片列表
				$ls_introduction=$introduction;                           //车间简介
				$ls_propage=$propage;									//车间分页页码
				$ls_foot=$foot;											//底部信息
				
				$ls_feedbackemail="";
				$mainpart=$ls_list;
				$mainpartsubject="brand";
				$filename = "../{$indexpath}";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
	  		
	  		echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
			if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

			
			echo "<br/><br/>";
		
		 if($ls!="all" && $ls!="all_products")
 		{break;}
 		
 		case "history": //生成公司历史(history)
		  $news_sql3="select * from ls_menu where menuName='history'";
			$news_query3=$opendb->query($news_sql3);
			mysql_query("set names utf8");
			$news_rows3=mysql_fetch_assoc($news_query3);
			$introduction = $news_rows3['description'];
			$introduction =  str_replace("../", "", $introduction);
		
			$news_sql2="select * from ls_history where enable=1 order by Num desc ";
	 		$result=$opendb->query($news_sql2);
			mysql_query("set names utf8");
			
			
			$index_path="../".$templates_var."/history.html";				//车间模板地址
			if(file_exists($index_path)){
				$fp	   = fopen ($index_path,"r");
				$historycontent = fread ($fp,filesize ($index_path));
				
			$p2 = "%<ls_foreach>(.*?)</ls_foreach>%si";    //正则表达式
			preg_match_all($p2, $historycontent, $arr);
			$historyarr = $arr[1][0];
			
			$mynum = mysql_num_rows($result);//总产品数
			// 每页数量
			$onepage = $brandPageNum; 
			//共有页数
			$allpages = ceil($mynum/$onepage);

			echo "共有".$mynum."个产品。可以生成".$allpages."页.每页".$onepage."个<br>";
			
			//页码计算
			$propage=getPages("quality.html",$allpages);
			
			//根据页码生成文件名
			for ($i=0; $i<= $allpages; $i++){
				$news_sql2="select * from ls_history where enable=1 order by Num desc ";
				if ($i == 0){ 
					$indexpath = "history.html";
		 		}else{ 
					$indexpath = "history-".$i.".html";
		 		}
				$start = $i * $onepage;
				
				if($allpages!=1){
					$ls_current_page=$i+1;		//当前页码
				}

		 		//查询产品
				$news_sql2.=" limit ".$start.",".$onepage." ";
				$news_query=$opendb->query($news_sql2);
				mysql_query("set names utf8");
				$list = "";
				$historymido = "";
				while($news_rows=mysql_fetch_assoc($news_query)){
					  
					  $historyyr = $news_rows['hsyear'];
					  $historytitle = "<translate>".$news_rows['Title']."</translate>";
					  $historybiref = "<translate>".$news_rows['Text']."</translate>";
						$historyimg = "<img src=\"".$historyFolders."/".$BigFoldersProducts."/".$news_rows['Pic']."\" class=\"img-responsive\" alt=\"<translate>{$news_rows['Title']}</translate>\" title=\"<translate>{$news_rows['Title']}</translate>\" border=\"0\" style=\"padding: 5px;\">";
					  
					  
						$historystr = str_replace("{lsf_yr}",$historyyr,$historyarr);
						$historystr = str_replace("{lsf_title}",$historytitle,$historystr);
						$historystr = str_replace("{lsf_biref}",$historybiref,$historystr);
						$historystr = str_replace("{lsf_img}",$historyimg,$historystr);
					  $historymido .= $historystr;

				}
				$list = str_replace("../", "", $historymido);
				//页码计算
				$propage=getPagess("history.html",$allpages,$ls_current_page);
				
				
				$ls_title=$news_rows3['inTitle'];												//title
				$ls_keywords=$news_rows3['inKeywords'];										//Keywords
				$ls_description=$news_rows3['inDescription'];							//Description
				$ls_cate=$ls_m_cate;			//左侧产品类别
				$ls_motif=$s_m_cate;
				$ls_menu=$menu;											//主菜单
				$ls_list=$list ;										//车间图片列表
				$ls_introduction=$introduction;                           //车间简介
				$ls_propage=$propage;									//车间分页页码
				$ls_foot=$foot;											//底部信息
				
				$ls_feedbackemail="";
				$mainpart=$ls_list;
				$mainpartsubject="history";
				$filename = "../{$indexpath}";
				writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			}
			
			}else{
				if($ls_debug) echo "<p>模版文件".$index_path."不存在，请设计好模板后重新生成。</p>";
			}
	  		
	  		echo "共有".$mynum."条。总共生成".$allpages."页。<br>生成分页文件完成，如生成不完全，请检查文件权限系统后重新生成！<a href=\"temp.php?ls=other\"><u>返回</u></a>";
			
			if($ls_debug) echo " - - -  - - - ".basename($_SERVER['PHP_SELF'])." ， 行号： ".($ls_lineno==""?__LINE__:$ls_lineno) ;

			echo "<br/><br/>";
		
		 if($ls!="all" && $ls!="all_products")
 		{break;}
	
	case "test": //生成测试(Test)
			$index_path="../".$templates_var."/test.html";//首页模板地址
			$ls_cate=$cate;				//左侧产品类别
			$ls_motif=$s_m_cate;
			$ls_menu=$menu;				//主菜单
			$ls_about=$about ;			//globle 首页About us 
			$ls_news=$news;				//globle 首页News
			$ls_faq=$faq;				//globle 首页faq
			$ls_revo=$revo;
			$ls_homepro=$homepro;			//globle 首页Hot products
			// $ls_title, $ls_keywords, $ls_description from public
			$ls_allcatepics=get_allcatepics();
			$ls_foot=$foot;				//底部信息
			$mainpartsubject="index";
			$filename="../test.html";
			writeMainMenuItemFile($index_path,$ls_title,$ls_keywords,$ls_description,$ls_cate,$ls_motif,$ls_menu,$ls_foot,
	$filename,$mainpart,$ls_introduction,$mainpartsubject,$ls_feedbackemail,$ls_propage,$s_cate0,$s_p1_cate,$languages0,$ls_addprolink,$ls_addnewprolink,$newstag,$translate);
			
		if($ls=="all" && $ls!="all_products")
		{break;}
	 
		if($ls=="all_products"){
			break;
		}
	}
}

				$time_end = getmicrotime();
				$time = $time_end - $time_start;

				echo "执行时间： $time 秒<br/>";
				echo "查询快表：".$_SESSION['transfast']." 次，";  //快表
				echo " ".$_SESSION['transfastTotal']." 字节<br/>";   //快表字数
				echo "查询慢表：".$_SESSION['transslow']." 次，";  //慢表 
				echo " ".$_SESSION['transslowTotal']." 字节<br/>";  //慢表字数 

?></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
