From b16476f7bb53a91fa0689658bdb830dfb1fc4fc9 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Wed, 14 Mar 2007 21:10:07 +0000 Subject: [PATCH] Repare search by proximity of pronunciation git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1573 839d8a87-29fc-0310-9880-83ba4fa771e5 --- classes/platalpage.php | 6 +++--- modules/search.php | 6 ++---- templates/search/adv.form.tpl | 24 ++++++++++-------------- templates/search/index.tpl | 20 +++++++++++++++++--- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/classes/platalpage.php b/classes/platalpage.php index 0fe8ec6..9e737eb 100644 --- a/classes/platalpage.php +++ b/classes/platalpage.php @@ -224,10 +224,10 @@ class PlatalPage extends Smarty function escape_html($string) { if (is_string($string)) { - $transtbl = Array('<' => '<', '>' => '>', '"' => '"', '\'' => '''); - return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/u", "&", strtr(pl_entities($string), $transtbl)); + $transtbl = Array('<' => '<', '>' => '>', '"' => '"', '\'' => '''); + return strtr($string, $transtbl); } else { - return $string; + return $string; } } diff --git a/modules/search.php b/modules/search.php index 9f42273..0a0229c 100644 --- a/modules/search.php +++ b/modules/search.php @@ -231,15 +231,13 @@ class SearchModule extends PLModule if (!Env::has('rechercher')) { $this->form_prepare(); } else { - $search = new XOrgSearch(array($this, 'get_advanced')); $search->setNbLines($globals->search->per_page); $page->assign('url_search_form', $search->make_url(Array('rechercher'=>0))); - if (Env::has('with_soundex')) { - $page->assign('with_soundex', $search->make_url(Array())."&with_soundex=1"); + if (!Env::i('with_soundex')) { + $page->assign('with_soundex', $search->make_url(Array()) . "&with_soundex=1"); } - $nb_tot = $search->show(); if ($nb_tot > $globals->search->private_max) { diff --git a/templates/search/adv.form.tpl b/templates/search/adv.form.tpl index ef19e5a..3da46a3 100644 --- a/templates/search/adv.form.tpl +++ b/templates/search/adv.form.tpl @@ -42,22 +42,12 @@ - {if $smarty.request.name && !$with_soundex && $smarty.request.recherche} - - étendre par proximité sonore - - {/if} Prénom - {if $smarty.request.firstname && !$with_soundex && $smarty.request.recherche} - - étendre par proximité sonore - - {/if} @@ -139,11 +129,12 @@ - Géographie - - - + + + + + Géographie Ville @@ -174,6 +165,11 @@ + + + + Activité diff --git a/templates/search/index.tpl b/templates/search/index.tpl index d78610a..21097f6 100644 --- a/templates/search/index.tpl +++ b/templates/search/index.tpl @@ -94,10 +94,24 @@ {/if} {/if} - +

- Astuce: - Si tu survoles une fiche, tu sauras quand elle a été mise à jour la dernière fois !

+ {icon name=lightbulb title=Astruce}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 + proximité sonore + {elseif $advanced} + Essaye d'élargir tes critères de recherche. + {elseif $smarty.session.auth ge AUTH_COOKIE} + Essaye la recherche avancée + {else} + Pour les X inscrits à Polytechnique.org, un module de recherche avancée est disponible permettant de réaliser + des recherches fines dans l'annuaire. Si vous êtes un X et que vous n'êtes pas encore inscrit, commencez dès + maintenant la procédure. + {/if} +

{/if} {else} {if $advanced} -- 2.1.4