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/pages/titres.php
2023-04-30 21:50:11 +02:00

22 lines
1 KiB
PHP

<?
require_once "include/standard.inc.php";
$cachefile = "tmp/titres.cache.php";
$FileNews = "modules/news/news.fr";
$totalnews = gettotal($FileNews);
if (!file_exists($cachefile) || (filemtime($cachefile) < filemtime("modules/news/news.fr.dat")))
{
$cachecontent = "\n\n<!-- Partie mise en cache (".date("d/m/Y@H:i:s").")-->\n\n";
$cachecontent .= file_get_contents("http://".$_SERVER["HTTP_HOST"]."/modules/magicbox.php?module=affnews&titleonly=1&BoxNbMaxNews=$totalnews&NbMaxNews=$totalnews&cropdate=10&bodyclass=centerbody&start=$totalnews&titre=Les%20nouvelles%20anciennes%20de%20la%20Tourmentine&lang=$lang");
$cachecontent .= "\n<!-- fin Partie mise en cache -->\n\n";
$cachecontent = str_replace("<!--NOCACHE","<?php",$cachecontent);
$cachecontent = str_replace("NOCACHE-->","?>",$cachecontent);
$fp = fopen($cachefile,"w");
fwrite($fp,$cachecontent);
fclose($fp);
}
include $cachefile;
?>