getDateDerniereConnexion(); $nouveautes = array(); if ( $date!=null || $date!='0000-00-00 00:00:00' ) { $time = mktime(0, 0, 0, date('m'), date('d')-$nbJourGlisssant, date('Y')); $dateglissant = date('Y-m-d', $time); $now = date('Y-m-d'); $nouveautesM = new Application_Model_Nouveautes(); $sql = $nouveautesM->select() ->where("date>='".$dateglissant."' AND date<='".$now."'") ->order('date DESC') ->limit($nbNewsMax); //Zend_Registry::get('firebug')->info($sql->__toString()); $nouveautes = $nouveautesM->fetchAll($sql); } $this->view->assign('nouveautes', $nouveautes); } /** * Afficher la liste des nouveautés */ public function newlisteAction() { $request = $this->getRequest(); //Selection $nouveautesM = new Application_Model_Nouveautes(); $sql = $nouveautesM->select() ->from('nouveautes', array('categorie', 'intitule', "date", 'fichier')) ->order('date DESC'); $nouveautes = $nouveautesM->fetchAll($sql); $this->view->assign('nouveautes', $nouveautes); } }