100 lines
3.4 KiB
PHP
100 lines
3.4 KiB
PHP
|
<?php
|
|||
|
|
|||
|
/*
|
|||
|
Name rssParser
|
|||
|
Author NicoSoft
|
|||
|
Cr<EFBFBD>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("é","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("è","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("ô","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("ê","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("ë","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("à","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("ç","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("ï","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("û","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("î","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("ö","<EFBFBD>", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("<EFBFBD>","'", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("<EFBFBD>","«", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("<EFBFBD>","»", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("<EFBFBD>","", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("<EFBFBD>","»", $news[$ga]["title"]);
|
|||
|
$news[$ga]["title"] = str_replace("<EFBFBD>","«", $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<69>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 <20> bient<6E>t
|
|||
|
}
|
|||
|
|
|||
|
else
|
|||
|
echo "Fichier source introuvable ou corrompu ($source)";
|
|||
|
?>
|