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/menu.php

55 lines
1.5 KiB
PHP
Raw Permalink Normal View History

2023-04-30 21:28:42 +02:00
<?php
extract($themeset, EXTR_OVERWRITE);
include "include/logo.inc.php";
$lang = $_GET["lang"];
$cachefile = "tmp/menu.$lang.cache.php";
if (!file_exists($cachefile) || (filemtime($cachefile) < filemtime("modules/news")))
{
//echo $lang;
//echo $_SERVER["HTTP_HOST"];
//$cachecontent=file_get_contents("http://192.168.1.1/modules/affnews.php?lang=$lang");
$cachecontent=file_get_contents("http://".$_SERVER["HTTP_HOST"]."/modules/affnews.php?lang=$lang");
//$cachecontent=file_get_contents("http://".$_SERVER["HTTP_HOST"]."/modules/affnews.php");
//$cachecontent=eval(file_get_contents("modules/affnews.php"));
//$cachecontent= eval(implode("",file("modules/affnews.php")));
$cachecontent = str_replace("<!--NOCACHE","<?php",$cachecontent);
$cachecontent = str_replace("NOCACHE-->","?>",$cachecontent);
$fp = fopen($cachefile,"w");
fwrite($fp,$cachecontent);
fclose($fp);
//echo "wrote";
}
if (file_exists($cachefile))
{
echo "\n\n<!-- Partie mise en cache (".date("d/m/Y@H:i:s", filemtime($cachefile)).")-->\n\n";
include $cachefile;
echo "\n<!-- fin Partie mise en cache -->\n\n";
}
else
{
// $NbMaxNews = 1;
// $FileNews = "modules/news/edito";
// $footerbox = 0;
// include "modules/affnews.php";
unset($newsnb);
unset($titleonly);
unset($FileNews);
unset($start);
// $NbMaxNews = 3;
$FileNews = "modules/news/news";
$footerbox = 0;
//$NbMaxNews=3;
include "modules/affnews.php";
echo "<br /><br />";
unset($newsnb);
unset($titleonly);
unset($FileNews);
unset($start);
}
?>