$recherche))); debut_gauche(); $recherche_aff = _T('info_rechercher'); $onfocus = "onfocus=this.value='';"; echo "
"; echo ''; echo "
"; debut_droite(); if (strlen($recherche) > 0) { echo ""._T('info_resultat_recherche')."
"; echo "$recherche

"; $query_articles = "SELECT * FROM spip_articles WHERE"; $query_breves = "SELECT * FROM spip_breves WHERE "; $query_rubriques = "SELECT * FROM spip_rubriques WHERE "; $query_sites = "SELECT * FROM spip_syndic WHERE "; if (ereg("^[0-9]+$", $recherche)) { $query_articles .= " (id_article = $recherche) OR "; $query_breves .= " (id_breve = $recherche) OR "; $query_rubriques .= " (id_rubrique = $recherche) OR "; $query_sites .= " (id_syndic = $recherche) OR "; } // Eviter les symboles '%', caracteres SQL speciaux $recherche = str_replace("%","\%",$recherche); $rech2 = split("[[:space:]]+", $recherche); if ($rech2) $where = " (titre LIKE '%".join("%' AND titre LIKE '%", $rech2)."%') "; else $where = " 1=2"; $query_articles .= " $where ORDER BY date_modif DESC"; $query_breves .= " $where ORDER BY maj DESC"; $query_rubriques .= " $where ORDER BY maj DESC"; $query_sites .= " $where ORDER BY maj DESC"; $query_sites = ereg_replace("titre LIKE", "nom_site LIKE", $query_sites); $activer_moteur = (lire_meta('activer_moteur') == 'oui'); if ($activer_moteur) { // texte integral include_ecrire ('inc_index.php3'); list($hash_recherche,) = requete_hash ($recherche); $query_articles_int = requete_txt_integral('article', $hash_recherche); $query_breves_int = requete_txt_integral('breve', $hash_recherche); $query_rubriques_int = requete_txt_integral('rubrique', $hash_recherche); $query_sites_int = requete_txt_integral('syndic', $hash_recherche); $query_auteurs_int = requete_txt_integral('auteur', $hash_recherche); } if ($query_articles) $nba = afficher_articles (_T('info_articles_trouves'), $query_articles); if ($activer_moteur) { if ($nba) { $doublons = join($nba, ","); $query_articles_int = ereg_replace ("WHERE", "WHERE objet.id_article NOT IN ($doublons) AND", $query_articles_int); } $nba1 = afficher_articles (_T('info_articles_trouves_dans_texte'), $query_articles_int); } if ($query_breves) $nbb = afficher_breves (_T('info_breves_touvees'), $query_breves, true); if ($activer_moteur) { if ($nbb) { $doublons = join($nbb, ","); $query_breves_int = ereg_replace ("WHERE", "WHERE objet.id_breve NOT IN ($doublons) AND", $query_breves_int); } $nbb1 = afficher_breves (_T('info_breves_touvees_dans_texte'), $query_breves_int, true); } if ($query_rubriques) $nbr = afficher_rubriques (_T('info_rubriques_trouvees'), $query_rubriques); if ($activer_moteur) { if ($nbr) { $doublons = join($nbr, ","); $query_rubriques_int = ereg_replace ("WHERE", "WHERE objet.id_rubrique NOT IN ($doublons) AND", $query_rubriques_int); } $nbr1 = afficher_rubriques (_T('info_rubriques_trouvees_dans_texte'), $query_rubriques_int); } if ($activer_moteur) $nbt = afficher_auteurs (_T('info_auteurs_trouves'), $query_auteurs_int); if ($query_sites) $nbs = afficher_sites (_T('info_sites_trouves'), $query_sites); if ($activer_moteur) { if ($nbs) { $doublons = join($nbs, ","); $query_sites_int = ereg_replace ("WHERE", "WHERE objet.id_syndic NOT IN ($doublons) AND", $query_sites_int); } $nbs1 = afficher_sites (_T('info_sites_trouves_dans_texte'), $query_sites_int); } if (!$nba AND !$nba1 AND !$nbb AND !$nbb1 AND !$nbr AND !$nbr1 AND !$nbt AND !$nbs AND !$nbs1) { echo ""._T('avis_aucun_resultat')."

"; } } echo "

"; fin_page(); ?>