n/oldblog
Archived
1
0
Fork 0
This repository has been archived on 2024-02-13. You can view files and clone it, but cannot push or open issues or pull requests.
oldblog/modules/rssparser2.php
2023-04-30 21:50:11 +02:00

99 lines
3.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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("“","&laquo;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("”","&raquo;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("Â","", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("»","&raquo;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("«","&laquo;", $news[$ga]["title"]);*/
$news[$ga]["link"] = str_replace("&","&amp;", $news[$ga]["link"]);
$news[$ga]["link"] = str_replace("[ampersand]","&amp;", $news[$ga]["link"]);
$news[$ga]["title"] = str_replace("[ampersand]","&amp;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("[agrave]","&agrave;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("[eacute]","&eacute;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("[egrave]","&egrave;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("[ugrave]","&ugrave;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("[ecirc]","&ecirc;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("[icirc]","&icirc;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("[ccedil]","&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)";
?>