X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fgadgets.php;h=d3bbe8b5056f3f08c7338dae5c6630e71b5172bd;hb=290dca06a494e75001f2bde2e5836938dacac88d;hp=188dc57077e017a65edcae31b6d586a225160ad8;hpb=b58e5ac25d105716cef952d5c3933c695e357cbe;p=platal.git diff --git a/modules/gadgets.php b/modules/gadgets.php index 188dc57..d3bbe8b 100644 --- a/modules/gadgets.php +++ b/modules/gadgets.php @@ -42,14 +42,13 @@ class GadgetsModule extends PLModule require_once 'gadgets/gadgets.inc.php'; init_igoogle_html('gadgets/ig-events.tpl', AUTH_COOKIE); - $events = XDB::iterator('SELECT SQL_CALC_FOUND_ROWS + $events = XDB::iterator("SELECT SQL_CALC_FOUND_ROWS e.id, e.titre, UNIX_TIMESTAMP(e.creation_date) AS creation_date, - IF(u.nom_usage = "", u.nom, u.nom_usage) AS nom, u.prenom, u.promo, - ev.user_id IS NULL AS nonlu, e.uid - FROM announces AS e + ev.uid IS NULL AS nonlu, e.uid + FROM announces AS e LEFT JOIN announce_read AS ev ON (e.id = ev.evt_id AND ev.uid = {?}) - WHERE FIND_IN_SET("valide", e.flags) AND expiration >= NOW() - ORDER BY e.creation_date DESC', S::i('uid')); + WHERE FIND_IN_SET('valide', e.flags) AND expiration >= NOW() + ORDER BY e.creation_date DESC", S::i('uid')); $page->assign('event_count', XDB::query("SELECT FOUND_ROWS()")->fetchOneCell()); Platal::load('events', 'feed.inc.php'); @@ -72,8 +71,10 @@ class GadgetsModule extends PLModule function handler_ig_search(&$page) { if (Env::has('quick') && Env::s('quick') != '') { + global $globals; require_once 'userset.inc.php'; - $view = new SearchSet(true); + + $view = new QuickSearchSet(); $view->addMod('gadget', 'Gadget', true); $view->apply(null, $page); @@ -86,6 +87,8 @@ class GadgetsModule extends PLModule $page->assign('error', 'Recherche trop générale.'); } elseif (empty($nb_tot)) { $page->assign('error', 'Il n\'existe personne correspondant à ces critères dans la base !'); + } else { + $page->assign('error', false); } }