<? header('Content-type: text/xml; charset=ISO-8859-1'); 

require( 'data.php' );

function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return htmlentities("$pageURL");
}
?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>QuantShare</title>
<description>Trading Software, Sharing Server and Social Network</description>
<link>http://www.quantshare.com/</link>
<copyright>Corporate Trading</copyright>
<atom:link href="http://www.quantshare.com/itemsfeed.xml" rel="self" type="application/rss+xml" />

<?

mysql_connect ("localhost", "daytra00_p2p", "u5*tfe+8") or die ('Cannot connect to the database');
mysql_select_db ("daytra00_P2P");

if(isset($_REQUEST["descnolimit"]))
	$descnolimit = $_REQUEST["descnolimit"];
else
	$descnolimit = "0";

if(isset($_REQUEST["type"]))
	$type = $_REQUEST["type"];
else
	$type = "";
	
if(isset($_REQUEST["order"]))
	$order = $_REQUEST["order"];
else
	$order = "creation_date";

if(isset($_REQUEST["_description"]))	
	$_description = $_REQUEST["_description"];
else
	$_description = "";
	
$start = 0;
$rows_per_page = 20;
$userID = -1;

include("queryrequest.php");
?>


<?
while($row = mysql_fetch_array($myResult)){

$description = $row['description'];
if(strlen($description) > 80 && $descnolimit != "1")
	$description = substr($description, 0, 160 - 3)."...";
$url = str_replace("&", "-", htmlentities("http://www.quantshare.com".htmlspecialchars($seo->GetObjectLink($row['autoID'], $row['name'])))); 
?>
     <item>
        <title> <?=htmlspecialchars(strip_tags($row['name'])); ?></title>
        <description> <?=htmlspecialchars(strip_tags($description,'ENT_QUOTES'));?></description>
        <link><?= $url ?></link>
		<guid><?= $url ?></guid>
        <pubDate> <?= strftime( "%a, %d %b %Y %T +0000" , $row['creation_date']); ?></pubDate>
     </item>  
<? } ?>  

</channel>
</rss>