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

100 lines
3.4 KiB
PHP
Raw Permalink Normal View History

2023-04-30 21:28:42 +02:00
<?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>","&laquo;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("<EFBFBD>","&raquo;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("<EFBFBD>","", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("<EFBFBD>","&raquo;", $news[$ga]["title"]);
$news[$ga]["title"] = str_replace("<EFBFBD>","&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<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)";
?>