<?php 
error_reporting(E_ALL & ~E_NOTICE); 
//RSS源地址列表数组 
$rssfeed = array("http://news.qq.com/newsgn/rss_newsgn.xml", 
"http://finance.qq.com/scroll/rss_scroll.xml", 
"http://ent.qq.com/movie/rss_movie.xml",
"http://sports.qq.com/rss_newssports.xml",
"http://auto.qq.com/gouche/hangqing09/rss.xml"); 

//设置编码为UTF-8 
header('Content-Type:text/html;charset= UTF-8'); 
$rss_str=array("","","","",""); 
for($i=0;$i<sizeof($rssfeed);$i++){//分解开始 
$buff = ""; 

 
//打开rss地址，并读取，读取失败则中止 
$fp = fopen($rssfeed[$i],"r") or die("can not open $rssfeed"); 
while ( !feof($fp) ) { 
$buff .= fgets($fp,4096); 
} 
//关闭文件打开 
fclose($fp); 
$count =$is_item =  0;
$tag = $type =$value="";
//建立一个 XML 解析器 
$parser = xml_parser_create(); 
//xml_parser_set_option -- 为指定 XML 解析进行选项设置 
xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); 
//xml_parse_into_struct -- 将 XML 数据解析到数组$values中 
xml_parse_into_struct($parser,$buff,$values,$idx); 
//xml_parser_free -- 释放指定的 XML 解析器 
xml_parser_free($parser); 
$count = 1;
foreach ($values as $val) { 
if($count>9) break;
$tag = $val["tag"]; 
$type = $val["type"]; 
$value = $val["value"]; 
//标签统一转为小写 
$tag = strtolower($tag); 

if ($tag == "item" && $type == "open"){ 
$is_item = 1; 
}else if ($tag == "item" && $type == "close") { 
//构造输出字符串 
//$rss_str .= "<a href='".$link."' target=_blank>".$title."</a><br />"; 
  
$rss_str[$i] .= "<span class='fnb'>·</span><a href='".$link."' target=_blank>".$title."</a>   ".$pubDate."<br />";
  
$count=$count+1;	  
$is_item = 0; 
} 

//仅读取item标签中的内容 
if($is_item==1){ 
if ($tag == "title") {$title = $value;} 
if ($tag == "link") {$link = $value;} 
if ($tag == "pubdate") {$pubDate = $value;} 
} 
} 
//输出结果 
//echo $rss_str."<br />"; 
} 
?> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
 
<HTML>
<HEAD>
<TITLE>RTX 微门户</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META http-equiv=Content-Style-Type content=text/css>
<META http-equiv=Content-Script-Type content=text/javascript>
<STYLE type=text/css media="screen, projection">
#loadbox { width:160px;height:60px; position:absolute;top:50%;left:50%;margin-left:-80px;margin-top:-30px;}
#loadbox span {height:30px;display:block;width:160px;text-align:center; color:#FFF; font-size:12px;}

</STYLE>
 
<LINK media="print, projection, screen" href="css/ui.tabs.css" type=text/css rel=stylesheet>

<STYLE type=text/css media="screen, projection">
BODY {
	font-size:12px;line-height:22px;font-family:"宋体"
}
H1 {
	FONT-FAMILY: "宋体", Trebuchet, Verdana, Helvetica, Arial, sans-serif
}
H2 {
	FONT-FAMILY: "宋体", Trebuchet, Verdana, Helvetica, Arial, sans-serif
}
H1 {
	FONT-SIZE: 18px; MARGIN: 1em 0px 1.5em
}
H2 {
	FONT-SIZE: 16px; MARGIN: 2em 0px 1.5em
}
P {
	MARGIN: 0px
	
}
UNKNOWN {
	MARGIN: 0px 0px
}
CODE {
	FONT-FAMILY: "Courier New", Courier, monospace
}
.info{padding:6px 8px 0 6px;color:#BAB9B9;font-size:12px;line-height:23px;}
.info a{ font-size:14px;}

.info a.black:hover{color:#000;}
.fnb{font-weight:200;margin-left:-1px;}


a.button {
    color: #444;
    display: block;
    float: left;
    font: normal 12px arial, sans-serif;
    height: 24px;
    margin-right: 0px;
    padding-right: 9px; 
    text-decoration: none;
}

a.button span {
	display: block;
	line-height: 14px;
	padding-top: 5px;
	padding-right: 0;
	padding-bottom: 5px;
	padding-left: 9px;
} 

/*----------------------------------------------*/

a.button:hover {
	background-position: bottom right;
	background: transparent url('images/bg_button_a.gif') no-repeat scroll top right;
	color: #000;
	outline: none;
}
a.button:hover span {
    background-position: bottom left;
    background: transparent url('images/bg_button_span.gif') no-repeat;
    padding: 4px 0 4px 9px; 
}

/*----------------------------------------------*/

a.button:active {
	background-position: right -25px;
	color: #000;
	outline: none;
	background-attachment: scroll;
	background-color: transparent;
	background-image: url(images/bg_button_a.gif);
	background-repeat: no-repeat;
}

a.button:active span {
	background-position: left -25px;
	padding: 4px 0 4px 9px;
	background-color: transparent;
	background-image: url(images/bg_button_span.gif);
	background-repeat: no-repeat;
} 


</STYLE>

<SCRIPT src="js/jquery-1.2.6.js" 
type=text/javascript></SCRIPT>

 
<SCRIPT src="js/ui.core.js" 
type=text/javascript></SCRIPT>

<SCRIPT src="js/ui.tabs.js" 
type=text/javascript></SCRIPT>
 

<SCRIPT type=text/javascript>
	$(function() {
		$('#rotate > ul').tabs({ fx: { opacity: 'toggle' } }).tabs('rotate',5000);
	});
	function winReLoad()
	{
	 
	 
		window.location.reload();
	}
	 


</SCRIPT>



 
<META content="MSHTML 6.00.2900.5726" name=GENERATOR></HEAD>
<BODY   >
 <span>
	 
	
	<a class="button" href="javascript:winReLoad()"  onClick="this.blur();" title="刷新">
		<span>
			<img src="images/refresh.gif" border="0" align="absmiddle"/>&nbsp;刷新		
			</span>	
	</a>
	
	<div class="top_line"></div>
	</span>

<DIV id=rotate>
<UL>
  <LI><A 
  href="#fragment-1" ><SPAN>新闻</SPAN></A> 
  <LI><A 
  href="#fragment-2" ><SPAN>财经</SPAN></A> 
  <LI><A 
  href="#fragment-3"><SPAN>娱乐</SPAN></A> 
  <LI><A 
  href="#fragment-4"><SPAN>体育</SPAN></A> 
  <LI><A 
  href="#fragment-5"><SPAN>汽车</SPAN></A> </LI>
   
  </UL>
	<DIV id=fragment-1 class="info">
	 <?php echo $rss_str[0];?>
	 </DIV>
	<DIV id=fragment-2 class="info"> 
	<?php echo $rss_str[1];?>

	</DIV>
	<DIV id=fragment-3 class="info">
	<?php echo $rss_str[2];?>

	</DIV>
	<DIV id=fragment-4 class="info">
	<?php echo $rss_str[3];?>
	</DIV>
	<DIV id=fragment-5 class="info">
	<?php echo $rss_str[4];?>
	</DIV>
</DIV>
 <script>
  	 
document.documentElement?document.documentElement.style.overflow="hidden":document.body.style.overflow="hidden" 
 
 </script>
</BODY>
</HTML>
