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

23 lines
1 KiB
PHP

<?
require_once "include/standard.inc.php";
$cachefile = "tmp/titres.en.cache.php";
$FileNews = "modules/news/news.en";
$totalnews = gettotal($FileNews);
if (!file_exists($cachefile) || (filemtime($cachefile) < filemtime("modules/news/news.en.dat")))
{
$cachecontent = "\n\n<!-- Cached part (".date("m/d/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=Old%20news%20from%20the%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;
?>