99 lines
3.4 KiB
PHP
99 lines
3.4 KiB
PHP
<?php
|
||
|
||
/*
|
||
Name rssParser
|
||
Author NicoSoft
|
||
Création 10/08/01
|
||
MAJ 13/10/01
|
||
*/
|
||
|
||
require_once "rssparser.inc.php";
|
||
|
||
global $nbnews;
|
||
global $titre;
|
||
$rootdir="/home/www/website/backends/xml/";
|
||
|
||
if (file_exists($rootdir.$source) && filesize($rootdir.$source) != 0)
|
||
{
|
||
$sourcetocheck=implode("\n",file($rootdir.$source));
|
||
/* if ((strstr($sourcetocheck, "<rss") || strstr($sourcetocheck, "<rdf")) && !stristr($sourcetocheck, "<html>"))
|
||
{*/
|
||
$sitedata=get_sitedata($source);
|
||
extract($sitedata);
|
||
$news=parse_rss2($source);
|
||
/*}
|
||
else
|
||
{
|
||
echo "XML not valid";
|
||
unset($sitedata);
|
||
unset($source);
|
||
unset($news);
|
||
}*/
|
||
|
||
/************************ partie affichage *************************/
|
||
extract($themeset, EXTR_OVERWRITE);
|
||
|
||
if (!isset($nbnews))
|
||
{
|
||
$nbnews = $index_title;
|
||
}
|
||
|
||
$ga = 0;
|
||
while($ga<=$nbnews-1)
|
||
{
|
||
/* $news[$ga]["title"] = str_replace("Ă©","é", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("è","č", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("Ă´","ô", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("ĂŞ","ę", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("Ă«","ë", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("Ă ","ŕ", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("ç","ç", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("ĂŻ","ď", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("Ă»","ű", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("Ă®","î", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("ö","ö", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("’","'", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("“","«", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("”","»", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("Â","", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("»","»", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("«","«", $news[$ga]["title"]);*/
|
||
$news[$ga]["link"] = str_replace("&","&", $news[$ga]["link"]);
|
||
$news[$ga]["link"] = str_replace("[ampersand]","&", $news[$ga]["link"]);
|
||
$news[$ga]["title"] = str_replace("[ampersand]","&", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("[agrave]","à", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("[eacute]","é", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("[egrave]","è", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("[ugrave]","ù", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("[ecirc]","ê", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("[icirc]","î", $news[$ga]["title"]);
|
||
$news[$ga]["title"] = str_replace("[ccedil]","ç", $news[$ga]["title"]);
|
||
|
||
//echo "<a href=\"$base_url".htmlspecialchars($news[$ga]["link"])."\" target=\"_blank\">".htmlspecialchars($news[$ga++]["title"])."</a><br />\n";
|
||
echo "<a href=\"".$news[$ga]["link"]."\" target=\"_blank\">".$news[$ga++]["title"]."</a><br />\n";
|
||
}
|
||
|
||
// libération des variables
|
||
|
||
@array_splice($item_title,0);
|
||
@array_splice($item_link,0);
|
||
|
||
unset($rss_ver);
|
||
unset($image_url);
|
||
unset($image_localurl);
|
||
unset($image_title);
|
||
unset($image_width);
|
||
unset($image_height);
|
||
|
||
unset($textinput_title);
|
||
unset($textinput_description);
|
||
unset($textinput_name);
|
||
unset($textinput_link);
|
||
unset($source);
|
||
|
||
// merci et ŕ bientôt
|
||
}
|
||
|
||
else
|
||
echo "Fichier source introuvable ou corrompu ($source)";
|
||
?>
|