diff --git a/addons/calendrier.php b/addons/calendrier.php index 7e016df..79b9bd5 100644 --- a/addons/calendrier.php +++ b/addons/calendrier.php @@ -10,7 +10,7 @@ # *** LICENSE *** # This plugin replaces the {calendrier} tag in the public template with -# a navigable HTML calendar. +# a navigable HTML calendar. // include this addon $GLOBALS['addons'][] = array('tag' => '{calendrier}', 'callback_function' => 'addon_calendrier'); @@ -21,7 +21,7 @@ function addon_calendrier() { if ( isset($_GET['d']) and preg_match('#^\d{4}(/\d{2}){5}#', $_GET['d'])) { $id = substr(str_replace('/', '', $_GET['d']), 0, 14); $date = substr(get_entry($GLOBALS['db_handle'], 'articles', 'bt_date', $id, 'return'), 0, 8); - $date = (preg_match('#^\d{4}(/\d{2}){5}#', $date) and $date <= date('Y/m/d/H/i/s')) ? $date : date('Ym'); + $date = ($date <= date('Ymd')) ? $date : date('Ym'); } elseif ( isset($_GET['d']) and preg_match('#^\d{4}/\d{2}(/\d{2})?#', $_GET['d']) ) { $date = str_replace('/', '', $_GET['d']); $date = (preg_match('#^\d{6}\d{2}#', $date)) ? substr($date, 0, 8) : substr($date, 0, 6); // avec jour ? @@ -125,6 +125,3 @@ function addon_calendrier() { return $html; } - - -