[SPIP] ~maj v3.0.14-->v3.0.17
[ptitvelo/web/www.git] / www / ecrire / inc / rubriques.php
index 0d0cd5c..f707250 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2012                                                *
+ *  Copyright (c) 2001-2014                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -616,7 +616,7 @@ function inc_calcul_hierarchie_in_dist($id, $tout=true) {
 
        if (isset($b[$id])) {
                // Notre branche commence par la rubrique de depart si $tout=true
-               return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : "";
+               return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
        }
 
        $hier = "";
@@ -675,9 +675,16 @@ function calculer_prochain_postdate($check= false) {
        
        if ($t) {
                $t =  $t['date'];
-               ecrire_meta('date_prochain_postdate', strtotime($t));
-       } else
+               if (!isset($GLOBALS['meta']['date_prochain_postdate'])
+                       OR $t<>$GLOBALS['meta']['date_prochain_postdate']){
+                       ecrire_meta('date_prochain_postdate', strtotime($t));
+                       ecrire_meta('derniere_modif', time());
+               }
+       }
+       else {
                effacer_meta('date_prochain_postdate');
+               ecrire_meta('derniere_modif', time());
+       }
 
        spip_log("prochain postdate: $t");
 }