<?PHP
/*
* Copyright (c) www.baojisky.com All rights reserved. 
*/
ob_start(); 
header("Content-type: text/html;charset=utf-8");//输出编码,避免中文乱码
$root_path='.';
include_once($root_path.'/php/connect_sub.php');
include_once($root_path.'/php/sub.php');

if($qid==''){$qid='1287669734';}
if($bnum==''){$bnum='1';}

//版面信息
$result=$db->query("SELECT * from {$db_sux}papers_ban where qid='$qid' and bnum='$bnum' ");
$gb_ban = mysql_fetch_array($result);

//新闻数据
$result_news=$db->query("SELECT * from {$db_sux}papers_news where bid='$gb_ban[bid]' ORDER by addtime ");
$total_news=$db->num_rows($result_news);

$fgfg	=	'<?xml version="1.0" encoding="utf-8"?>
<xmlbase>';
$fgfg.= '<can_shu  bnum="'.$gb_ban[bnum].'" total_news="'.$total_news.'" ban_pic="upload/paper_file/'.$gb_ban[ban_pic].'" />';
//新闻列表
$gb_ban[ban_name]=iconv("gbk", "UTF-8", $gb_ban[ban_name]);

$fgfg.=	'<ban_name>'.$gb_ban[ban_name].'</ban_name>';
$i=1;
	while ($gb_news = mysql_fetch_array($result_news))
	{
		$gb_news[ztitle]=iconv("gbk", "UTF-8", $gb_news[ztitle]);
		$gb_news[ftiltle]=iconv("gbk", "UTF-8", $gb_news[ftiltle]);
		$gb_news[ftiltle2]=iconv("gbk", "UTF-8", $gb_news[ftiltle2]);
		$fgfg.=	'<news_list>';
		$fgfg.=	'<npage>'.$i.'</npage>';
		$fgfg.=	'<nid>'.$gb_news[nid].'</nid>';
		$fgfg.=	'<bnum>'.$bnum.'</bnum>';
		$fgfg.=	'<bid>'.$gb_news[bid].'</bid>';
		$fgfg.=	'<redian>'.$gb_news[redian].'</redian>';
		$fgfg.=	'<ztitle>'.$gb_news[ztitle].'</ztitle>';
		$fgfg.=	'<qtitle>'.$gb_news[ftiltle].'</qtitle>';
		$fgfg.=	'<htitle>'.$gb_news[ftiltle2].'</htitle>';
		$fgfg.=	'</news_list>';
		$i++;
	}	
$fgfg.=	"
</xmlbase>";
echo $fgfg;
ob_end_flush();
?>