<?
include(dirname(__FILE__)."/global.php");



$z_ym = '9djxbj';
$z_ym_hz = 'com';


/*二级域名栏目列表*/
function list_allsub( $table ,  $parentId = 0 ){ //$modify 修改时显示所属分类 $showPId 当前的分类 id
    global $subdb,$webdb;
	$sql="select * from `$table`  where `s_bz_1` = 'sub' AND `parentId` = {$parentId} ORDER BY `list` DESC";
	//echo $sql."<br>";
    $result=mysql_query($sql);
    while($rs=mysql_fetch_array($result)){
	
		  $sub_a=explode('/',$rs["list_html"]);
		  $rs["sub_key"] = $sub_a["1"];

		  $rs["list_html"] = $webdb['www_url'].'/'.str_replace('{$page}.html','',$rs["list_html"]);

		  if( $parentId != 0 )$subdb[]=$rs;
		  list_allsub( $table , $rs['id'] );
   }
   //return $subdb;
}

list_allsub('w6_sort');
//print_r( $subdb );
?>
<!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">
<!--<?php
print <<<EOT
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>展示二级域名</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}

.table {
	float: left;
	height: 190px;
	width: 500px;
	margin: 10px;
	border-bottom-width: 1px;
	border-bottom-style: dotted;
	border-bottom-color: #CCCCCC;
}
.table .t1 {
	font-size: 12px;
	font-weight: bold;
	height: 26px;
	line-height: 26px;
}
.table .t2 {
	filter: Gray;
}
.lj {
filter:alpha(opacity=40); 
}
.gz {
	font-size: 12px;
	line-height: 14px;
	margin: 8px;
}
-->
</style>

</head>

<body>
<strong>注意，运行此程序前须先检查栏目设置中的“备注1：”中有没有填“sub”，<font color="#FF0000">包括此栏目对应的一级栏目中也要填写</font></strong><font color="#FF0000"></font>
<br />
<br />

<!--
EOT;
$i = 1;
foreach($subdb AS $key=>$rs){
print <<<EOT
-->

<div class="table">
	<div class="t1"> $i <span style="color:$rs[color]">$rs[name]</span>：<a href="$rs[list_html]" target="_blank">$rs[list_html]</a></div>
  <div class="t2">
    <iframe src="$rs[list_html]" width=480 marginwidth=0 height=90 marginheight=0 scrolling="auto" frameborder=0 class="lj"></iframe>
	<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://$rs[sub_key].$z_ym.$z_ym_hz" target="_blank">http://$rs[sub_key].$z_ym.$z_ym_hz</a>
	<br />
    <iframe src="http://$rs[sub_key].$z_ym.$z_ym_hz" width=480 marginwidth=0 height=70 marginheight=0 scrolling="auto" frameborder=0 class="lj"></iframe>
  </div>
</div>

<!--
EOT;
$i++;
}print <<<EOT
-->


<div style="clear:both"></div>
<hr />

<div class="gz">

nginx的二级域名解析设置规则：


  <br />
  <br />
server <br />
{ <br />
listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;80; <br />
server_name $z_ym.$z_ym_hz; <br />
index index.php index.html index.htm; <br />
root  /home/www/$z_ym; <br />
include location.conf; <br />
error_page 404  /404.html;<br />
} <br />
<br />
server
	<br />
  { <br />
listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;80; <br />
server_name www.$z_ym.$z_ym_hz; <br />
index index.php index.html index.htm; <br />
root  /home/www/$z_ym; <br />
include location.conf; <br />
}


<!--
EOT;
foreach($subdb AS $key=>$rs){
print <<<EOT
-->

<br />
<br />
server
	<br />
	{
		<br />
		listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;80;
		<br />
		server_name $rs[sub_key].$z_ym.$z_ym_hz;
		<br />
		index index.php index.html index.htm;
		<br />
root  /home/www/$z_ym/1web/$rs[sub_key];
  <br />
  include location.conf;
  <br />
  }

<!--
EOT;
}print <<<EOT
-->

<br />
<br />
server
	<br />
  { <br />
listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;80; <br />
server_name *.$z_ym.$z_ym_hz; <br />
index index.php index.html index.htm; <br />
root  /home/www/$z_ym; <br />
include location.conf; <br />
}</div>




</body>

</html>
<!--
EOT;
?>
-->