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

	
@$job=$submitted_vars['job'];


$id  = $_GET['id'];//网站栏目
$module_id    = $_GET['mid'];//栏目模块
$mid    = $_GET['mid'];//栏目模块

if(!is_numeric($id) || !is_numeric($module_id) || !is_numeric($mid)){
	exit ( 'ID出错' );
}


$query       =  "SELECT * FROM `w6_sort` WHERE `id` = '$id'";
$result      =  mysql_query($query);

$sort_name       =  stripslashes(mysql_result($result,"0","name"));
$type       =  stripslashes(mysql_result($result,"0","type"));
if( $type == "2" ){

$htmldescription       =  stripslashes(mysql_result($result,"0","htmldescription"));

require("post_dy.htm");
exit();
}


//模块设置 读取显示
  $query="SELECT * FROM `w6_module` WHERE `module_id`='".$module_id."'";
  $result=mysql_query($query);
  $f_module_config       =  mysql_result($result,"0","module_config");
  $f_array = unserialize($f_module_config);
  $field_set = $f_array['field_set'];



foreach($f_array AS $key=>$rs){

	$wnTpl .= formMoudlePost( $rs );
	
}


$tplFile_0 = '../tpl/mother/post.htm';
$tplFile_1 = "../tpl/wn_tpl/post_$mid.htm";
if ( !file_exists( $tplFile_1 ) ) {
	$tplFile = $tplFile_0;
}else{
	$tplFile = $tplFile_1;
}
	
//生成静态页
ob_start();
//require($tpl_head);
require( $tplFile );
//require($tpl_foot);
$html = ob_get_contents();
ob_end_clean();

echo $html;

?>