<? 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/postsfeed.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 = "1";

if(isset($_REQUEST["ct"]))
	$ct = $_REQUEST["ct"];
else
	$ct = "";
	
$start = 0;
$rows_per_page = 20;
$userID = -1;

$query = "Select * from content_content where categoryID=$ct order by date desc LIMIT 20;";
$result = mysql_query($query) or $utils->error(mysql_error());
?>


<?
while($row = mysql_fetch_array($result)){

$content = $row['content'];
if(strlen($content) > 80 && $descnolimit != "1")
	$content = substr($content, 0, 160 - 3)."...";
//$content = htmlspecialchars(strip_tags($content,'ENT_QUOTES'));
$content = nl2br($content);
$url = "http://www.quantshare.com".$seo->GetArticleLink($row['id'], $row['name']);
?>
     <item>
        <title> <?=htmlspecialchars(strip_tags($row['name'])); ?></title>
        <description><![CDATA[ <?= $content ?> ]]></description>
        <link><?= $url ?></link>
		<guid><?= $url ?></guid>
        <pubDate> <?= date("r", strtotime($row['date'])); ?> </pubDate>
     </item>  
<? } ?>  

</channel>
</rss>