[go: up one dir, main page]

Menu

[r32]: / rss.php  Maximize  Restore  History

Download this file

68 lines (51 with data), 2.9 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?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 ' &#35;'.$recent_updates[$i]["issue"].'</title>
<link>http://'.$dirURL.'/index.php?rub=issue&amp;id_series='.$recent_updates[$i]["id_series"].'&amp;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 ' &#35;'.$recent_updates[$i]["issue"].'</description>
</item> ';
}
echo '
</channel>
</rss> ';
?>