<?php
header("content-type: text/xml");
require 'include/configurations.php'; // ITECHBIDS Configuration File 
$domain2 = $_SERVER['SERVER_NAME'];
$siteurl="http://$domain2";
echo '<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/">
 <channel> 
  <title>' . $siteurl . '</title> 
  <link>' . $siteurl . '/rsshot.php</link> 
  <description>' . $siteurl . '</description>
  <pubDate>' . date("D, d M Y h:i:s O") . '</pubDate>
  <generator>built-in RSS/XML Feed, v.1.0</generator>
  <copyright>Copyright 2008. All Rights Reserved.</copyright>
  <managingEditor>' . $adminmail. '('.$sitename.')</managingEditor>
  <webMaster>' . $adminmail. '('.$sitename.')</webMaster>
     ';

	$sql="select * from auction_details  where status='Active' and bid_starting_date <= NOW() and selling_method!='want_it_now' and selling_method!='ads' and picture1!='' order by clicks DESC";
     $res=mysql_query($sql);

	 while($record=mysql_fetch_array($res))
     {

echo '
  <item>
   <title>' . $record['producttitle'] . '</title> 
   <link>' . $siteurl . '/productid.php?id=' . $record['productid'] . '</link> 
   <description>' . str_replace("<br>", " ", str_replace("&amp;", "and", strip_tags(str_replace("&nbsp;", " ", $record['detailed_descrip'])))) . '</description> 
   <pubDate>' . date("D, d M Y h:i:s O") . '</pubDate>
   <category>Hot Auction</category>
   <guid isPermaLink="true">' . $siteurl . '/productid.php?id=' . $record['productid'] . '</guid>
  </item>
    ';

   }


echo '
 </channel>
</rss>
     ';

?>