23 lines
1 KiB
PHP
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;
|
|
?>
|