Commit e1e8bc20 authored by Feu's avatar Feu

galaxy hourly

parent a83254f5
......@@ -366,7 +366,7 @@ $cts->puts("<div class=\"viewer\" id=\"viewer\">
<div class=\"map\" id=\"map\"><img src=\"var/mini_galaxy.png\" />
<div class=\"position\" id=\"position\"></div></div></div><script>init_galaxy($goX,$goY,\"\");</script>");
$cts->add_paragraph("<a href=\"var/galaxy.png\">Tout galaxy sur une seule image</a>");
//$cts->add_paragraph("<a href=\"var/galaxy.png\">Tout galaxy sur une seule image</a>");
$frm = new form("galaxygo",$topdir."galaxy.php",true,"GET","Aller vers une personne");
$frm->add_entity_smartselect("id_utilisateur","Nom/Surnom",new utilisateur($site->db));
......
......@@ -18,18 +18,34 @@ require_once($topdir. "include/lib/magpierss/rss_fetch.inc.php");
$site = new site ();
// Tâche 1 : mettre à jour le cache
// Tâche 1 [planet] : mettre à jour le cache
$req = new requete($site->db,"SELECT `url` FROM `planet_flux` WHERE `modere`='1'");
while ( list($url) = $req->get_row() )
$rs=fetch_rss($url);
// Tâche 1 : nettoyage du cache
// Tâche 1 [planet] : nettoyage du cache
$cache = opendir(MAGPIE_CACHE_DIR);
while ($file = readdir($cache))
if ( is_file(MAGPIE_CACHE_DIR.$file) && filemtime(MAGPIE_CACHE_DIR.$file) < (time()-MAGPIE_CACHE_AGE) )
unlink(MAGPIE_CACHE_DIR.$file);
closedir($cache);
// Tâche 2 [galaxy] : màj, et cycles
require_once($topdir. "include/galaxy.inc.php");
$galaxy = new galaxy($site->db,$site->dbrw);
$galaxy->update();
for($i=0;$i<45;$i++) // Environs 1100 cycles/jours
$galaxy->cycle(!isset($_REQUEST["bypasscollision"]));
$galaxy->mini_render($topdir."var/mini_galaxy.png");
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment