Location: PHPKode > projects > infoboard > infoboard/xml.php
<?
include("./data/connect.php");
include("./data/_uconfig.php");
include("./_class/class.global.php");

if(isset($_GET["gid"])){
	      $infoboard = new global_infoboard();
		  $infoboard->isconnect();
		   $print="";
		   $iscon["rewrite"]=$infoboard->txtmod();
		   $iscon["extmod"]=$infoboard->extmod();
		   $print.= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
		   $print.= "<rss version=\"2.0\">\n";
		   $print.= "<channel>\n";
		   $print.= "<title>".$iscon["title"]."</title>\n";
		   $print.= "<description>".$iscon["description"]."</description>\n";
		   $print.= "<link>".$iscon["website"]."</link>\n";
		   $print.= "<lastBuildDate>".date('l dS \of F Y h:i:s A')."</lastBuildDate>\n";
		   $print.= "<generator>".$iscon["title"]."</generator>\n";
		   $print.= "<copyright>".$iscon["copyright"]."</copyright>\n";
		   

		   $query=mysql_db_query($infoboard->dbname, "select * from _infoboardq  where _cat='".$_GET["gid"]."' and _active='1' order by  _page desc  limit 0, 10");
		   while($result = @mysql_fetch_array($query)){
				  $link= $iscon["fullpath"].$iscon["rewrite"]."topic".$iscon["_s"].$result["_cat"].$iscon["_s"].$result["_page"].$iscon["_s"]."1".$iscon["extmod"];
				  $date = date("D, d M Y h:i:s",strtotime($result["_time"]));
				  $print.= "<item>\n";
				  $print.= "<title>".htmlspecialchars(stripslashes($result["_topic"]))."</title>\n";
				  $print.= "<description>".htmlspecialchars(strip_tags(stripslashes($result["_detail"])))."</description>\n";
				  $print.= "<link>".$link."</link>\n";
				  $print.= "<pubDate>".$date." +0700</pubDate>\n";
				  $print.= "</item>\n";
  

		   }
		   $print.= "</channel>\n";
		   $print.= "</rss>\n";
		   $infoboard->isclose();
		   header ("content-type: text/xml\n\n");
		   //header('Content-type: application/rss+xml\n\n');
		   header("Expires: " . date( "D, d M Y H:i:s", strtotime('+12 hours')  ) . " GMT");
		   header("Last-Modified: ".gmdate( "D, d M Y H:i:s")."GMT");
		   header("Cache-Control: no-cache, must-revalidate");
		   header("Pragma: no-cache");
		   echo $print;
}
?>

Return current item: infoboard