[go: up one dir, main page]

Menu

[r19]: / rss.php  Maximize  Restore  History

Download this file

105 lines (87 with data), 4.2 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
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
<?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.('classes/series.class.php');
require_once LIBS.('classes/publisher.class.php');
require_once LIBS.('classes/issue.class.php');
require_once LIBS.('functions.php');
$madPluginManager = new PluginManager();
$DB_connexion = mysql_connect($cfg_host, $cfg_user, $cfg_password);
if (! $DB_connexion){
exit ;
}
if(!mysql_select_db($cfg_database)){
exit ;
}
//Disabling magic_quotes
if (get_magic_quotes_gpc()) {
$_SERVER = stripslashes_array($_SERVER);
$_GET = stripslashes_array($_GET);
$_POST = stripslashes_array($_POST);
$_COOKIE = stripslashes_array($_COOKIE);
$_FILES = stripslashes_array($_FILES);
$_ENV = stripslashes_array($_ENV);
$_REQUEST = stripslashes_array($_REQUEST);
$HTTP_SERVER_VARS = stripslashes_array($HTTP_SERVER_VARS);
$HTTP_GET_VARS = stripslashes_array($HTTP_GET_VARS);
$HTTP_POST_VARS = stripslashes_array($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = stripslashes_array($HTTP_COOKIE_VARS);
$HTTP_POST_FILES = stripslashes_array($HTTP_POST_FILES);
$HTTP_ENV_VARS = stripslashes_array($HTTP_ENV_VARS);
if (isset($_SESSION)) { #These are unconfirmed (?)
$_SESSION = stripslashes_array($_SESSION, '');
$HTTP_SESSION_VARS = stripslashes_array($HTTP_SESSION_VARS, '');
}
}
$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>';
//reste à afficher la liste des numéros
$requete_recent_updates = '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;';
$envoi_requete_recent_updates = mysql_query($requete_recent_updates,$DB_connexion);
if($envoi_requete_recent_updates) $nb_occur_issues = mysql_num_rows($envoi_requete_recent_updates);
if($nb_occur_issues >0 )
{
//TEST
while ($table_result = mysql_fetch_array($envoi_requete_recent_updates, MYSQL_BOTH))
{
$newPublisher = new Publisher($table_result);
$newSeries = new Series($table_result);
$newIssue = new Issue($table_result);
echo '
<item>
<title>'.htmlspecialchars($newSeries->name).' vol.'.$newSeries->volume;
if($newSeries->year != 0) $temp .= " (".$newSeries->year.")";
echo ' &#35;'.$newIssue->number.'</title>
<link>http://'.$dirURL.'/index.php?rub=issue&amp;id_series='.$newSeries->id_series.'&amp;issue='.urlencode($newIssue->number).'</link>
<description>'.htmlspecialchars($newPublisher->name).' : '.htmlspecialchars($newSeries->name).' vol.'.$newSeries->volume;
if($newSeries->year != 0) $temp .= " (".$newSeries->year.")";
echo ' &#35;'.$newIssue->number.'</description>
</item> ';
}
mysql_free_result($envoi_requete_recent_updates);
echo '
</channel>
</rss> ';
}
?>