nb total de news:$totalnews"; if (isset($_GET["typebackend"])) $typebackend = $_GET["typebackend"]; if (!isset($typebackend)) $typebackend = "rss"; switch($typebackend) { case "txt": $outputfile = "../backends/txt/tourmentine.$language.txt"; if ($NbMax > $totalnews) $NbMax = $totalnews; if ($totalnews >= 1) { $backend = fopen("$outputfile","w"); for($n = 0 ; $n < $NbMax ; $n++) { $newsnb = $totalnews-$n; $MyNews = getnews("$FileNews",$newsnb,"file"); fwrite ($backend," %%\n"); fwrite ($backend,$MyNews["date"]."\n"); fwrite ($backend,$MyNews["titre"]."\n"); #fwrite ($backend,"$urlsite/index.php?modulepage=affnews&File=$FileNews&start=".$newsnb."\n"); fwrite ($backend,"$urlsite/billet.".$newsnb.".".$language.".html\n"); } fclose($backend); echo "
$outputfile généré.
"; } else echo "fichier non créé : nombre de news insuffisant ($totalnews)
"; break; case "atom": // entete atom $entete = " $titlesite $descriptionsite WebLoom n http://tourmentine.com/ ".date("c")."\n\n"; $outputfile = "../backends/atom/tourmentine.$language.xml"; if ($NbMax > $totalnews) $NbMax = $totalnews; if ($totalnews >= 1) { $backend = fopen("$outputfile","w"); fwrite($backend,$entete); for($n = 0 ; $n < $NbMax ; $n++) { $newsnb = $totalnews-$n; $MyNews = getnews("$FileNews",$newsnb,"file"); fwrite ($backend," \n"); fwrite ($backend," ".$MyNews["titre"]."\n"); if (strlen(strip_tags($MyNews["message"])) > 100) $summary = substr(strip_tags($MyNews["message"]), 0, 100)."..."; else $summary = strip_tags($MyNews["message"]); fwrite ($backend," ".$summary."\n"); fwrite ($backend," \n\n\n"); fwrite ($backend," \n"); fwrite ($backend," ".date("c",$MyNews["timestamp"])."\n"); fwrite ($backend," ".date("c",$MyNews["timestamp"])."\n"); fwrite ($backend," $urlsite/billet.".$newsnb.".html\n"); fwrite ($backend," \n\n"); } fwrite ($backend,""); fclose($backend); echo "
$outputfile généré.
"; } else echo "fichier non créé : nombre de news insuffisant ($totalnews)
"; break; case "opml": $entete = " $titlesite \n\n"; $outputfile = "../backends/opml/tourmentine.$language.opml"; if ($NbMax > $totalnews) $NbMax = $totalnews; if ($totalnews >= 1) { $backend = fopen("$outputfile","w"); fwrite($backend,$entete); for($n = 0 ; $n < $NbMax ; $n++) { $newsnb = $totalnews-$n; $MyNews = getnews("$FileNews",$newsnb,"file"); fwrite ($backend," \n"); } fwrite ($backend," \n"); fclose($backend); echo "
$outputfile généré.
"; } else echo "fichier non créé : nombre de news insuffisant ($totalnews)
"; break; default: // entete rss $entete = " $titlesite $linksite $descriptionsite $language ".date("r")." ".date("r")." $MailAdr $MailAdr WebLoom beta\n\n"; $outputfile = "../backends/xml/tourmentine.$language.rss"; if ($NbMax > $totalnews) $NbMax = $totalnews; if ($totalnews >= 1) { $backend = fopen("$outputfile","w"); fwrite($backend,$entete); for($n = 0 ; $n < $NbMax ; $n++) { $newsnb = $totalnews-$n; $MyNews = getnews("$FileNews",$newsnb,"file"); fwrite ($backend," \n"); fwrite ($backend," ".$MyNews["titre"]."\n"); fwrite ($backend," \n"); fwrite ($backend," $urlsite/billet.".$newsnb.".".$language.".html\n"); fwrite ($backend," ".date("r",$MyNews["timestamp"])."\n"); fwrite ($backend," \n\n"); } fwrite ($backend," \n\n"); fclose($backend); echo "

$outputfile généré.
"; } else echo "fichier non créé : nombre de news insuffisant ($totalnews)
"; } ?>