X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fsearch.php;h=358db585eb1919e12963428142546bd44c97487e;hb=861d4a73f8979b29e758a42f76feb52cd967c553;hp=505e5ee7f84faa33abe1e6a47b834e36b37b5d01;hpb=cecdf74795e71ed038411915dad5e0dff6ea51fa;p=platal.git diff --git a/modules/search.php b/modules/search.php index 505e5ee..358db58 100644 --- a/modules/search.php +++ b/modules/search.php @@ -155,6 +155,12 @@ class SearchModule extends PLModule $page->assign('advanced',1); $page->addJsLink('jquery.autocomplete.js'); + $networks = DirEnum::getOptions(DirEnum::NETWORKS); + $networks[-1] = 'Tous types'; + $networks[0] = '-'; + ksort($networks); + $page->assign('networking_types', $networks); + if (!Env::has('rechercher') && $model != 'geoloc') { $this->form_prepare(); } else { @@ -260,9 +266,10 @@ class SearchModule extends PLModule if ($nbResults == 0) { $res = $q."|-2\n"; } - XDB::query('REPLACE INTO search_autocomplete - VALUES ({?}, {?}, {?}, NOW())', - $type, $q, $res); + XDB::query('INSERT INTO search_autocomplete (name, query, result, generated) + VALUES ({?}, {?}, {?}, NOW()) + ON DUPLICATE KEY UPDATE result = VALUES(result), generated = VALUES(generated)', + $type, $q, $res); echo $res; exit(); }