From: Pascal Corpet Date: Sat, 15 Sep 2007 22:09:22 +0000 (+0200) Subject: Popup profile window when search has only one result X-Git-Tag: xorg/0.9.15~151 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;ds=sidebyside;h=e35882beae6b03f138e68d7bcf5e943bff1f4d52;hp=44c488102a8268f511fbbe197d0c2ff766ad5ebb;p=platal.git Popup profile window when search has only one result --- diff --git a/modules/search.php b/modules/search.php index a4cd481..46c7850 100644 --- a/modules/search.php +++ b/modules/search.php @@ -129,6 +129,7 @@ class SearchModule extends PLModule $view->apply('search', $page, $action, $subaction); $nb_tot = $view->count(); + $page->assign('search_results_nb', $nb_tot); if ($subaction) { return; } diff --git a/templates/search/index.tpl b/templates/search/index.tpl index 7d4abb8..d44e692 100644 --- a/templates/search/index.tpl +++ b/templates/search/index.tpl @@ -44,13 +44,26 @@

{/if} + {if $search_results_nb eq 1}{literal} + + {/literal}{/if} + {if $smarty.session.auth ge AUTH_COOKIE}

{icon name=lightbulb title=Astuce}Astuce : {if $search_results_nb} Si tu survoles une fiche, tu sauras quand elle a été mise à jour la dernière fois ! {elseif $advanced && $with_soundex && ($smarty.request.name || $smarty.request.firstname)} - Si tu n'es pas sur de l'orthographe d'un nom, tu peux essayer la recherche par + Si tu n'es pas sûr de l'orthographe d'un nom, tu peux essayer la recherche par proximité sonore {elseif $advanced} Essaye d'élargir tes critères de recherche.