<?php require_once('../Connections/ikaro.php'); ?>
<?php require_once('../config/funzioni.php'); ?>
<?php
$now = getdate();
$d_day = $now['mday'];
$d_month = $now['mon'];
$today = $d_day."/".$d_month."/".$now['year'];
$ora=$now['hours'].":".$now['minutes'];
$log_line="Articoli >".$today."-".$ora." ".$_SERVER['REMOTE_ADDR']." viene da ".$_SERVER['HTTP_REFERER']."\n";
$fp = fopen ("data/news.txt", "a");
fwrite($fp, $log_line);
fclose($fp);
?>
<?php $adesso=oggi(); ?>
<?php
$col1_articles = "%";
if (isset($adesso)) {
  $col1_articles = (get_magic_quotes_gpc()) ? $adesso : addslashes($adesso);
}
mysql_select_db($database_ikaro, $ikaro);
$query_articles = sprintf("SELECT * FROM articles WHERE date_pub <> '0000-00-00' AND date_pub<='%s' AND id_language=2 ORDER BY date_pub DESC", $col1_articles);
$articles = mysql_query($query_articles, $ikaro) or die(mysql_error());
$row_articles = mysql_fetch_assoc($articles);
$totalRows_articles = mysql_num_rows($articles);
?>
<?php header ("Content-type: text/xml"); ?>
<?php print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ?>
<rss version="2.0">
<channel>
<title>Ikaro ICT weblog</title>
<link>http://www.ikaro.com/</link> 
<description>Technology and culture, free resource and reviews focusing on a digital lifestyle</description> 
<language>en</language> 
<?php do { ?>
<item>
	<title><?php echo $row_articles['title']; ?></title>
<description><?php echo tronca_parole($row_articles['abstract'],20); ?></description> 
	<link>http://www.ikaro.com/weblog/<?php echo $row_articles['file_name']; ?>.html</link> 
</item>
<?php } while ($row_articles = mysql_fetch_assoc($articles)); ?>
 
<?php
mysql_free_result($articles);
?> 
</channel> 
</rss>