X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fpublic%2Fcacher.php;h=ab8d1d976d9a0340b6ffa6cee177f159693331fd;hp=13380c19d5193ed43cf379959eda3ea0a66282dd;hb=e847eea4a82a7396dd0abf860f9b30d654f38629;hpb=d686c3e22e97dd46ef42bcd0f138c65083f8f232 diff --git a/www/ecrire/public/cacher.php b/www/ecrire/public/cacher.php index 13380c1..ab8d1d9 100644 --- a/www/ecrire/public/cacher.php +++ b/www/ecrire/public/cacher.php @@ -111,6 +111,15 @@ function gunzip_page(&$page) { /// http://doc.spip.org/@cache_valide function cache_valide(&$page, $date) { + // Apparition d'un nouvel article post-date ? + if ($GLOBALS['meta']['post_dates'] == 'non' + AND isset($GLOBALS['meta']['date_prochain_postdate']) + AND time() > $GLOBALS['meta']['date_prochain_postdate']) { + spip_log('Un article post-date invalide le cache'); + include_spip('inc/rubriques'); + calculer_prochain_postdate(true); + } + if (defined('_VAR_NOCACHE') AND _VAR_NOCACHE) return -1; if (isset($GLOBALS['meta']['cache_inhib']) AND $_SERVER['REQUEST_TIME']<$GLOBALS['meta']['cache_inhib']) return -1; if (defined('_NO_CACHE')) return (_NO_CACHE==0 AND !isset($page['texte']))?1:_NO_CACHE; @@ -129,17 +138,6 @@ function cache_valide(&$page, $date) { AND $date < $GLOBALS['meta']['derniere_modif']) return 1; - // Apparition d'un nouvel article post-date ? - if ($GLOBALS['meta']['post_dates'] == 'non' - AND isset($GLOBALS['meta']['date_prochain_postdate']) - AND time() > $GLOBALS['meta']['date_prochain_postdate']) { - spip_log('Un article post-date invalide le cache'); - include_spip('inc/rubriques'); - ecrire_meta('derniere_modif', time()); - calculer_prochain_postdate(); - return 1; - } - } // Sinon comparer l'age du fichier a sa duree de cache