Line 40... |
Line 40... |
40 |
*@copyright Tela-Botanica 2000-2004
|
40 |
*@copyright Tela-Botanica 2000-2004
|
41 |
*@version $Revision: 1.24 $ $Date: 2008-10-21 15:24:50 $
|
41 |
*@version $Revision: 1.24 $ $Date: 2008-10-21 15:24:50 $
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
43 |
*/
|
43 |
*/
|
Line -... |
Line 44... |
- |
|
44 |
|
- |
|
45 |
|
- |
|
46 |
// pour utiliser Sphinx, cela désactive alors l'appel à $moteur->rechercherMotif()
|
- |
|
47 |
// et utilise sphinx_search() (moteur_recherche_sphinx.php)
|
- |
|
48 |
// TODO: un test avec mysql_connect() sur le SPHINX_DSN tel que défini dans moteur_recherche_sphinx.php
|
- |
|
49 |
// pourrait être un plus.
|
- |
|
50 |
define('USE_SPHINX', FALSE);
|
- |
|
51 |
|
44 |
|
52 |
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
53 |
// +------------------------------------------------------------------------------------------------------+
|
46 |
// | ENTETE du PROGRAMME |
|
54 |
// | ENTETE du PROGRAMME |
|
47 |
// +------------------------------------------------------------------------------------------------------+
|
55 |
// +------------------------------------------------------------------------------------------------------+
|
48 |
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherMoteurRecherche';
|
56 |
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherMoteurRecherche';
|
Line 193... |
Line 201... |
193 |
if (!empty($GLOBALS['_MOTEUR_RECHERCHE_']['projet']['url'])) {
|
201 |
if (!empty($GLOBALS['_MOTEUR_RECHERCHE_']['projet']['url'])) {
|
194 |
$recherche_projet = new More_Recherche_Projet($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
|
202 |
$recherche_projet = new More_Recherche_Projet($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
|
195 |
$moteur->ajouterRecherche($recherche_projet);
|
203 |
$moteur->ajouterRecherche($recherche_projet);
|
196 |
}
|
204 |
}
|
Line -... |
Line 205... |
- |
|
205 |
|
- |
|
206 |
if(! USE_SPHINX) {
|
197 |
|
207 |
// recherche traditionnelle
|
198 |
$GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'] = $moteur->rechercherMotif();
|
208 |
$GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'] = $moteur->rechercherMotif();
|
199 |
/*
|
- |
|
200 |
// pour utiliser Sphinx, commenter le $moteur->rechercherMotif(); ci-dessus.
|
- |
|
201 |
|
209 |
} else {
|
202 |
require_once("moteur_recherche_sphinx.php");
|
210 |
require_once("moteur_recherche_sphinx.php");
|
203 |
// ce fichier/cette fonction peut-être réclamé plusieurs fois
|
211 |
// ce fichier/cette fonction peut-être réclamé plusieurs fois
|
204 |
// car le motif du template '{{MoteurRecherche}}' est inclu récursivement,
|
212 |
// car le motif du template '{{MoteurRecherche}}' est inclu récursivement,
|
205 |
// (la première substitution fait réapparaître '{{MoteurRecherche}}')
|
213 |
// (la première substitution fait réapparaître '{{MoteurRecherche}}')
|
206 |
if(!isset($GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'])) {
|
214 |
if(!isset($GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'])) {
|
- |
|
215 |
$GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'] = sphinx_search($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
|
207 |
$GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'] = sphinx_search($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
|
216 |
}
|
208 |
}
|
- |
|
Line 209... |
Line 217... |
209 |
*/
|
217 |
}
|
210 |
|
218 |
|
211 |
//$GLOBALS['_DEBOGAGE_'] = '<pre>'.print_r($GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'], true).'</pre>';
|
219 |
//$GLOBALS['_DEBOGAGE_'] = '<pre>'.print_r($GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats'], true).'</pre>';
|
212 |
$nbre_pages = count($GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats']);
|
220 |
$nbre_pages = count($GLOBALS['_MOTEUR_RECHERCHE_']['resultat']['resultats']);
|