<?php 
// Let us first make sure the php file is 
// interpeted as xml information 
require_once ("config.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("classes/settings.class.php");
$objST	= new settings($objDB);
$siteSettings=$objST->select();

$curdat=date('Y-m-d');

header ("Content-Type: text/xml"); 

echo '<?xml version="1.0" encoding="ISO-8859-1" ?>'; 

// SQL connection 
$sql= "select * from ".TABLEPREFIX."user where vStatus='ANNN' order by dStartDate desc limit 0,10";

$result=mysql_query($sql) ;



$num = mysql_num_rows($result); 

  	// First we print the overall xml information 
	echo "<rss version=\"2.0\">\n"; 
  	echo "<channel>\n"; 
  	// Here comes the global title for you rss 
  	echo "<title>".$siteSettings['sitename']."</title>\n"; 
  	// Here comes the url for the page that the rss applies for 
  	echo "<link>".$siteSettings['site_normal_url']."</link>\n"; 
  	// Here comes a short description of the page 
  	echo "<description>Latest User feed</description>\n"; 
	
	// Now over to the dynamic part 
      
   if($num == 0) 
	{ 
  			echo "<item>\n";
			echo "<title>Sorry, no records to display.</title>\n"; 
    		echo "<link>".$siteSettings['site_normal_url']."/index.php</link>\n"; 
    		echo "<description>\n"; 
    		echo "Sorry, no records to display."; 
    		echo "</description>\n"; 
    		echo "</item>\n"; 
	} 
	else 
	{ 
  		  
		while($row = mysql_fetch_array($result)) 
  		{	
			$pos=strpos($row["tAbout_Me"],".");
			echo "<item>\n"; 
	   		echo "<title>".ucfirst($row["vFirstName"])."</title>\n"; 
    		echo "<link>".$siteSettings['site_normal_url']."/profile.php?id=".$row["nUser_Id"]."</link>\n";
                echo "<description>\n"; 
    		echo substr($row["tAbout_Me"],0,$pos+1); 
    		echo "</description>\n"; 
                echo "<pubDate>".date("D, j M Y G:i:s",strtotime($row["dStartDate"]))." -5.00</pubDate>\n";
    		echo "</item>\n"; 
  		} 
   }
  	// And at last the closing tags for the overall info 
  	echo "</channel>\n"; 
  	echo "</rss>\n"; 
?>

