<?php
/* This file is part of Madcollector.
* Madcollector created by Thomas Andrieu,
* Developped by Mickael Jardet and Thomas Andrieu.
* Madcollector is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
* Madcollector is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
session_start();
define("LIBS", "libs/");
define("PLUGINS", "plugins/");
require 'cfg/param.php'; // Config file
require_once LIBS.('classes/pluginmanager.class.php');
require_once LIBS.('functions.php');
require_once LIBS.('dao.php');
$madPluginManager = new PluginManager();
$dbconnector = null;
$dbconnector = maddb_connect($cfg_database_driver,$cfg_host,$cfg_database,$cfg_user,$cfg_password);
//Disabling magic_quotes
disable_magic_quotes();
$madPluginManager->loadPlugins(PLUGINS);
$thisURL = $_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"];
$dirURL = substr($thisURL, 0, strlen($thisURL) - 8);
header("Content-Type: application/xml");
echo '<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>'.$cfg_site_title.'</title>
<link>http://'.$dirURL.'</link>';
$recent_updates = maddb_selectAll('SELECT '.$cfg_table_prefix.'issues.id_series,'.$cfg_table_prefix.'issues.issue,'.$cfg_table_prefix.'series.series_name,'.$cfg_table_prefix.'series.series_volume,'.$cfg_table_prefix.'series.series_year,'.$cfg_table_prefix.'publishers.publisher_name, '.$cfg_table_prefix.'publishers.id_publisher FROM '.$cfg_table_prefix.'issues,'.$cfg_table_prefix.'series,'.$cfg_table_prefix.'publishers WHERE '.$cfg_table_prefix.'series.id_series='.$cfg_table_prefix.'issues.id_series AND '.$cfg_table_prefix.'series.id_publisher='.$cfg_table_prefix.'publishers.id_publisher ORDER BY '.$cfg_table_prefix.'issues.last_date DESC LIMIT 0,20;');
for($i=0;$i<sizeOf($recent_updates);$i++)
{
echo '
<item>
<title>'.htmlspecialchars($recent_updates[$i]["series_name"]).' vol.'.$recent_updates[$i]["series_volume"];
if($recent_updates[$i]["series_year"] != 0) echo " (".$recent_updates[$i]["series_year"].")";
echo ' #'.$recent_updates[$i]["issue"].'</title>
<link>http://'.$dirURL.'/index.php?rub=issue&id_series='.$recent_updates[$i]["id_series"].'&issue='.urlencode($recent_updates[$i]["issue"]).'</link>
<description>'.htmlspecialchars($recent_updates[$i]["publisher_name"]).' : '.htmlspecialchars($recent_updates[$i]["series_name"]).' vol.'.$recent_updates[$i]["series_volume"];
if($recent_updates[$i]["series_year"] != 0) echo " (".$recent_updates[$i]["series_year"].")";
echo ' #'.$recent_updates[$i]["issue"].'</description>
</item> ';
}
echo '
</channel>
</rss> ';
?>