/trunk/papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_papyrus_menu.class.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_recherche_papyrus_menu.class.php,v 1.5 2006-04-28 12:41:49 florian Exp $ |
// CVS : $Id: more_recherche_papyrus_menu.class.php,v 1.6 2006-05-19 10:04:55 jp_milcent Exp $ |
/** |
* Classe permettant d'effectuer des recherches sur les informations des menus de Papyrus. |
* |
38,7 → 38,7 |
//Autres auteurs : |
*@author aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.5 $ $Date: 2006-04-28 12:41:49 $ |
*@version $Revision: 1.6 $ $Date: 2006-05-19 10:04:55 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
123,15 → 123,11 |
'gm_source', 'gm_auteur', 'gm_contributeur', 'gm_editeur', 'gm_categorie', |
'gm_public'); |
foreach ($tab_champs_a_visiter as $val) { |
if (stristr($aso_menu_info[$val], $motif)) { |
$aso_resultat['poids']++; |
} |
$aso_resultat['poids'] += $this->retournerOccurenceMotif($motif, $aso_menu_info[$val]); |
} |
// Analyse du poids de cette page vis à vis du contenu |
$tab_morceaux=''; |
$nbre_correspondance = preg_match_all('/'.$motif.'/i', $aso_menu_contenu['gmc_contenu'], $tab_morceaux); |
$aso_resultat['poids'] = $aso_resultat['poids'] + $nbre_correspondance; |
$aso_resultat['poids'] += $this->retournerOccurenceMotif($motif, $aso_menu_contenu['gmc_contenu']); |
if ($aso_resultat['poids'] > 0) { |
$this->setResultat($aso_resultat); |
144,6 → 140,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.5 2006/04/28 12:41:49 florian |
* corrections erreurs chemin |
* |
* Revision 1.4 2005/05/25 13:49:22 jpm |
* Corection erreur pour la recherche dans le contenu. |
* |
/trunk/papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_spip_article.class.php |
---|
New file |
0,0 → 1,251 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id$ |
/** |
* Classe permettant d'effectuer des recherches sur les informations des articles de Spip. |
* |
* Permet de rechercher et classer les articles en fonction d'une chaine. |
* Utilisation des bibliothèques inclue par Papyrus : |
* - Papyrus pap_meta.fonct.php |
* - Papyrus pap_menu.fonct.php |
* - Papyrus pap_url.class.php |
* |
*@package Applette |
*@subpackage Moteur_Recherche |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author aucun |
*@copyright Tela-Botanica 2000-2006 |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
///** Inclusion du fichier contenant les fonctions de manipulations des menus de Papyrus.*/ |
//require_once GEN_CHEMIN_BIBLIO.'pap_menu.fonct.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
class Recherche_Spip_Article extends Recherche { |
// Constructeur |
function Recherche_Menu_Meta($motif) { |
$this->setMotif($motif); |
} |
// Accesseurs |
function getMotif() { |
return $this->motif; |
} |
function setMotif($motif) { |
$this->motif = $motif; |
} |
// Méthodes |
function rechercherMotif($motif) { |
for ($i = 0; $i < count($GLOBALS['_MOTEUR_RECHERCHE_']['spip']); $i++ ) { |
$db = DB::connect($GLOBALS['_MOTEUR_RECHERCHE_']['spip'][$i]['bdd_dsn']); |
if (DB::isError($db)) { |
$msg_erreur_connection = 'Impossible de se connecter à la base de données Spip.'; |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $db->getMessage(), 'connexion à la base de données',$msg_erreur_connection)); |
} |
$prefixe = $GLOBALS['_MOTEUR_RECHERCHE_']['spip'][$i]['table_prefixe']; |
$url_base = $GLOBALS['_MOTEUR_RECHERCHE_']['spip'][$i]['url']; |
$tab_articles = $this->retournerArticles($db, $prefixe); |
foreach ($tab_articles as $article_id => $Article) { |
// Initialisation du tableau de résultat vide |
$aso_resultat = array( 'poids' => 0, 'url' => '', 'titre' => '', |
'hreflang' => '', 'accesskey' => '', 'title' => '', |
'date_creation' => '', 'description' => ''); |
// Création de l'url |
$var_recherche = str_replace(' ', '+', trim($motif)); |
$aso_resultat['url'] = $url_base.'article'.$article_id.'.html?var_recherche='.$var_recherche; |
// Récupération du titre de la page |
if (trim($Article->titre) != '') { |
$aso_resultat['titre'] = htmlentities($Article->titre); |
} else if (trim($Article->surtitre) != '') { |
$aso_resultat['titre'] = htmlentities($Article->surtitre); |
} else if (trim($Article->soustitre) != '') { |
$aso_resultat['titre'] = htmlentities($Article->soustitre); |
} |
$aso_resultat['hreflang'] = htmlentities($Article->lang); |
$aso_resultat['description'] = $this->couper($Article->texte, 450); |
if (($jour = date('d', strtotime($Article->date)) ) != 0 ) { |
$aso_resultat['date_creation'] .= '<span class="page_modification_jour"> '.$jour.'</span>'."\n"; |
} |
if (($mois = $this->traduireMois(date('m', strtotime($Article->date))) ) != '' ) { |
$aso_resultat['date_creation'] .= '<span class="page_modification_mois"> '.$mois.'</span>'."\n"; |
} |
if (($annee = date('Y', strtotime($Article->date)) ) != 0 ) { |
$aso_resultat['date_creation'] .= '<span class="page_modification_annee"> '.$annee.'</span>'."\n"; |
} |
// Analyse du poids de cette page vis à vis des données |
$tab_champs_a_visiter = array( 'surtitre', 'titre', 'soustitre', 'descriptif', 'chapo', 'texte', 'ps'); |
foreach ($tab_champs_a_visiter as $val) { |
$aso_resultat['poids'] += $this->retournerOccurenceMotif($motif, $Article->$val); |
} |
if ($aso_resultat['poids'] > 0) { |
$this->setResultat($aso_resultat); |
} |
} |
} |
return $this->getResultats(); |
} |
/** Renvoie un tableau contenant les infos sur les articles |
* |
* @param mixed une instance de la classse Pear DB. |
* @param string le préfixe pour les tables spip. |
* @return array tableau contenant les articles. |
*/ |
function retournerArticles(&$db, $prefixe = '') |
{ |
//---------------------------------------------------------------------------- |
// Recherche des informations sur le menu |
$requete = 'SELECT * '. |
'FROM '.$prefixe.'spip_articles '. |
'WHERE statut = "publie"'; |
$resultat = $db->query($requete); |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : ''; |
//---------------------------------------------------------------------------- |
// Récupération des infos |
$tab_retour = array(); |
while ($info_article = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tab_retour[$info_article->id_article] = $info_article; |
} |
$resultat->free(); |
return $tab_retour; |
} |
// Fichier : inc_texte.php3 |
function couper($texte, $taille = 50) |
{ |
$texte = substr($texte, 0, 400 + 2*$taille); /* eviter de travailler sur 10ko pour extraire 150 caracteres */ |
// on utilise les \r pour passer entre les gouttes |
$texte = str_replace("\r\n", "\n", $texte); |
$texte = str_replace("\r", "\n", $texte); |
// sauts de ligne et paragraphes |
$texte = ereg_replace("\n\n+", "\r", $texte); |
$texte = ereg_replace("<(p|br)( [^>]*)?".">", "\r", $texte); |
// supprimer les traits, lignes etc |
$texte = ereg_replace("(^|\r|\n)(-[-#\*]*|_ )", "\r", $texte); |
// supprimer les tags |
$texte = $this->supprimer_tags($texte); |
$texte = trim(str_replace("\n"," ", $texte)); |
$texte .= "\n"; // marquer la fin |
// travailler en accents charset |
// On supprime dans Papyrus car cela tire trop de fonctions... |
//$texte = $this->filtrer_entites($texte); |
// supprimer les liens |
$texte = ereg_replace("\[->([^]]*)\]","\\1", $texte); // liens sans texte |
$texte = ereg_replace("\[([^\[]*)->([^]]*)\]","\\1", $texte); |
// supprimer les notes |
$texte = ereg_replace("\[\[([^]]|\][^]])*\]\]", "", $texte); |
// supprimer les codes typos |
$texte = ereg_replace("[}{]", "", $texte); |
// supprimer les tableaux |
$texte = ereg_replace("(^|\r)\|.*\|\r", "\r", $texte); |
// couper au mot precedent |
$long = $this->spip_substr($texte, 0, max($taille-4,1)); |
$court = ereg_replace("([^[:space:]][[:space:]]+)[^[:space:]]*\n?$", "\\1", $long); |
$points = ' (...)'; |
// trop court ? ne pas faire de (...) |
if (strlen($court) < max(0.75 * $taille,2)) { |
$points = ''; |
$long = $this->spip_substr($texte, 0, $taille); |
$texte = ereg_replace("([^[:space:]][[:space:]]+)[^[:space:]]*$", "\\1", $long); |
// encore trop court ? couper au caractere |
if (strlen($texte) < 0.75 * $taille) |
$texte = $long; |
} else |
$texte = $court; |
if (strpos($texte, "\n")) // la fin est encore la : c'est qu'on n'a pas de texte de suite |
$points = ''; |
// remettre les paragraphes |
$texte = ereg_replace("\r+", "\n\n", $texte); |
// supprimer l'eventuelle entite finale mal coupee |
$texte = preg_replace('/&#?[a-z0-9]*$/', '', $texte); |
return trim($texte).$points; |
} |
// Gerer les outils mb_string |
// Fichier : inc_texte.php3 |
function spip_substr($c, $start=0, $end='') |
{ |
// methode substr normale |
if ($end) { |
return substr($c, $start, $end); |
} else { |
return substr($c, $start); |
} |
} |
// Suppression basique et brutale de tous les <...> |
// Fichier : inc_filtres.php3 |
function supprimer_tags($texte, $rempl = "") |
{ |
$texte = preg_replace(",<[^>]*>,U", $rempl, $texte); |
// ne pas oublier un < final non ferme |
$texte = str_replace('<', ' ', $texte); |
return $texte; |
} |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_recherche.class.php,v 1.6 2006-04-28 12:41:49 florian Exp $ |
// CVS : $Id: more_recherche.class.php,v 1.7 2006-05-19 10:04:55 jp_milcent Exp $ |
/** |
* Classe permettant d'effectuer des recherches sur les métas informations des menus. |
* |
34,7 → 34,7 |
//Autres auteurs : |
*@author aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.6 $ $Date: 2006-04-28 12:41:49 $ |
*@version $Revision: 1.7 $ $Date: 2006-05-19 10:04:55 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
90,19 → 90,10 |
function ajouterRecherche(&$objet_recherche) { |
return $this->setMoteur($objet_recherche); |
} |
/* |
function supprimerRecherche($id_objet_recherche) { |
if (isset($this->getMoteur($id_objet_recherche))) { |
$this->setMoteur($id_objet_recherche, null); |
return true; |
} else { |
return false; |
} |
} |
*/ |
function rechercherMotif() { |
foreach ($this->getMoteurs() as $cle => $val) { |
$this->setResultats(array_merge((array)$this->getResultats(),(array) $val->rechercherMotif($this->getMotif()))); |
$this->setResultats(array_merge((array)$this->getResultats(),(array)$val->rechercherMotif($this->getMotif()))); |
} |
$aso_resultats = $this->getResultats(); |
function comparer($a, $b) { |
128,6 → 119,25 |
return $aso_resultats; |
} |
/** Renvoie le nombre d'occurences total de la présence de chaque mot. |
* |
* @param string le motif à rechercher. |
* @param string le texte dans lequel effectuer la recherche. |
* @return integer le nombre de fois où les mots sont trouvés. |
*/ |
function retournerOccurenceMotif($motif, &$texte) |
{ |
$nbre_correspondance = 0; |
// Découpage en mot |
$tab_motif = explode(' ', trim($motif)); |
// Nous recherchons chaque mot |
foreach ($tab_motif as $mot) { |
$nbre_correspondance += substr_count(strtolower($texte), ' '.strtolower(stripslashes($mot)).' '); |
//$nbre_correspondance += preg_match_all('/'.$mot.'/i', $texte, $tab_morceaux); |
} |
return $nbre_correspondance; |
} |
function traduireMois($mois_numerique) |
{ |
switch ($mois_numerique) { |
164,6 → 174,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.6 2006/04/28 12:41:49 florian |
* corrections erreurs chemin |
* |
* Revision 1.5 2005/09/20 17:01:22 ddelon |
* php5 et bugs divers |
* |
/trunk/papyrus/applettes/moteur_recherche/langues/more_langue_en.inc.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_langue_en.inc.php,v 1.2 2006-03-02 10:49:49 ddelon Exp $ |
// CVS : $Id: more_langue_en.inc.php,v 1.3 2006-05-19 10:04:55 jp_milcent Exp $ |
/** |
* Gestion des langues de l'applette Moteur_Recherche |
* |
34,7 → 34,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ $Date: 2006-03-02 10:49:49 $ |
*@version $Revision: 1.3 $ $Date: 2006-05-19 10:04:55 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
59,7 → 59,8 |
define('MORE_LG_USURPATION', 'Search of : '); |
// Les résultats de la recherche : |
define('MORE_LG_RESULTAT_TITRE', 'Search results'); |
define('MORE_LG_RESULTAT_TITRE', 'Search results : %s page found'); |
define('MORE_LG_RESULTAT_TITRE_PLURIEL', 'Search results : %s pages found'); |
define('MORE_LG_RESULTAT_RACCOURCI', 'Shortcut : '); |
define('MORE_LG_RESULTAT_DESCRIPTION', 'Description : '); |
define('MORE_LG_RESULTAT_DATE_CREATION', 'Creation date : '); |
80,6 → 81,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.2 2006/03/02 10:49:49 ddelon |
* Fusion branche multilinguisme dans branche principale |
* |
* Revision 1.1.2.2 2005/12/27 15:56:00 ddelon |
* Fusion Head vers multilinguisme (wikini double clic) |
* |
/trunk/papyrus/applettes/moteur_recherche/langues/more_langue_fr.inc.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_langue_fr.inc.php,v 1.5 2006-03-02 10:49:49 ddelon Exp $ |
// CVS : $Id: more_langue_fr.inc.php,v 1.6 2006-05-19 10:04:55 jp_milcent Exp $ |
/** |
* Gestion des langues de l'applette Moteur_Recherche |
* |
34,7 → 34,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.5 $ $Date: 2006-03-02 10:49:49 $ |
*@version $Revision: 1.6 $ $Date: 2006-05-19 10:04:55 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
59,7 → 59,8 |
define('MORE_LG_USURPATION', 'Recherche de : '); |
// Les résultats de la recherche : |
define('MORE_LG_RESULTAT_TITRE', 'Résultats de la recherche'); |
define('MORE_LG_RESULTAT_TITRE', 'Résultats de la recherche : %s page trouvée'); |
define('MORE_LG_RESULTAT_TITRE_PLURIEL', 'Résultats de la recherche : %s pages trouvées'); |
define('MORE_LG_RESULTAT_RACCOURCI', 'Raccourci : '); |
define('MORE_LG_RESULTAT_DESCRIPTION', 'Description : '); |
define('MORE_LG_RESULTAT_DATE_CREATION', 'Date de création : '); |
80,6 → 81,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.5 2006/03/02 10:49:49 ddelon |
* Fusion branche multilinguisme dans branche principale |
* |
* Revision 1.4.2.1 2005/12/27 15:56:00 ddelon |
* Fusion Head vers multilinguisme (wikini double clic) |
* |
/trunk/papyrus/applettes/moteur_recherche/configuration/more_config_spip.inc.php |
---|
New file |
0,0 → 1,66 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id$ |
/** |
* Fichier de configuration de la recherche dans Spip. |
* |
* Permet de définir certains paramètres valables pour toutes l'applette MORE. |
* |
*@package Applette |
*@subpackage Moteur_Recherche |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author aucun |
*@copyright Tela-Botanica 2000-2006 |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$GLOBALS['_MOTEUR_RECHERCHE_']['spip'] = array(); |
// Information pour un premier site Spip... |
//$GLOBALS['_MOTEUR_RECHERCHE_']['spip'][0] = |
// array( 'bdd_dsn' => 'mysql://nom_utilisateur:mot_de_passe@localhost/nom_base_de_donnees', |
// 'table_prefixe' => '', |
// 'url' => 'url_de_base_du_spip'); |
// Information pour un deuxième site Spip... |
//$GLOBALS['_MOTEUR_RECHERCHE_']['spip'][1] = |
// array( 'bdd_dsn' => 'mysql://nom_utilisateur:mot_de_passe@localhost/nom_base_de_donnees', |
// 'table_prefixe' => '', |
// 'url' => 'url_de_base_du_spip'); |
// Ainsi de suite... |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applettes/moteur_recherche/moteur_recherche.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: moteur_recherche.php,v 1.9 2006-04-28 12:41:49 florian Exp $ |
// CVS : $Id: moteur_recherche.php,v 1.10 2006-05-19 10:04:55 jp_milcent Exp $ |
/** |
* Applette : moteur de recherche |
* |
38,7 → 38,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.9 $ $Date: 2006-04-28 12:41:49 $ |
*@version $Revision: 1.10 $ $Date: 2006-05-19 10:04:55 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
53,6 → 53,8 |
//Utilisation de la bibliothèque PEAR NET_URL inclue par Papyrus |
/** Inclusion du fichier de configuration de cette application.*/ |
require_once GEN_CHEMIN_APPLETTE.'moteur_recherche/configuration/more_configuration.inc.php'; |
/** Inclusion du fichier de configuration des Spip.*/ |
require_once GEN_CHEMIN_APPLETTE.'moteur_recherche/configuration/more_config_spip.inc.php'; |
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/ |
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php'; |
/** Inclusion de la bibliothèque PEAR de modification des squelettes des formulaires QuickForm.*/ |
73,13 → 75,11 |
if (isset($_POST['more_motif']) && $_POST['more_motif'] != '') { |
// Initialisation de variable extérieures |
$GLOBALS['_VEI_']['usurpation'] = MORE_LG_USURPATION.$_POST['more_motif']; |
$GLOBALS['_VEI_']['usurpation'] = MORE_LG_USURPATION.htmlentities(stripslashes($_POST['more_motif'])); |
$GLOBALS['_GEN_commun']['info_menu'] = null; |
$GLOBALS['_PAPYRUS_']['general']['application_chemin'] = null; |
// Titre de la page |
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = MORE_LG_TITRE.$_POST['more_motif']; |
// Modification des meta de l'entête de la page |
GEN_modifierMetaHttpEquiv('Content-Type', 'text/html; charset=iso-8859-15'); |
GEN_modifierMetaHttpEquiv('Content-Type', 'text/html; charset=ISO-8859-15'); |
GEN_modifierMetaHttpEquiv('Content-style-type', 'text/css'); |
GEN_modifierMetaHttpEquiv('Content-script-type', 'text/javascript'); |
GEN_modifierMetaHttpEquiv('Content-language', $GLOBALS['_GEN_commun']['i18n']); |
122,6 → 122,8 |
$indent_pas = 4;// Pas d'indentation en nombre d'espace |
$retour = ''; |
$retour_resultats = ''; |
// Titre de la page |
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = MORE_LG_TITRE.htmlentities(stripslashes($_POST['more_motif'])); |
// -------------------------------------------------------------------------------------------------------- |
// Lancement de la recherche si nécessaire |
133,15 → 135,24 |
$_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = $_POST['more_motif']; |
/** Inclusion de la classe Recherche.*/ |
require_once MORE_CHEMIN_BIBLIO.'more_recherche.class.php'; |
/** Inclusion de la classe Recherche_Menu_Meta.*/ |
/** Inclusion de la classe Recherche_Papyrus_Menu.*/ |
require_once MORE_CHEMIN_BIBLIO.'more_recherche_papyrus_menu.class.php'; |
/** Inclusion de la classe Recherche_Spip_Article.*/ |
require_once MORE_CHEMIN_BIBLIO.'more_recherche_spip_article.class.php'; |
$moteur = new Recherche($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']); |
$recherche_papyrus_menu = new Recherche_Papyrus_Menu($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']); |
$recherche_spip_article = new Recherche_Spip_Article($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']); |
$moteur->ajouterRecherche($recherche_papyrus_menu); |
$moteur->ajouterRecherche($recherche_spip_article); |
$aso_resultats = $moteur->rechercherMotif(); |
//$GLOBALS['_DEBOGAGE_'] = '<pre>'.print_r($aso_resultats, true).'</pre>'; |
$retour_resultats .= '<h1>'.MORE_LG_RESULTAT_TITRE.'</h1>'."\n"; |
if (count($aso_resultats) == 0) { |
$nbre_pages = count($aso_resultats); |
if ($nbre_pages <= 1) { |
$retour_resultats .= '<h1>'.sprintf(MORE_LG_RESULTAT_TITRE, $nbre_pages).'</h1>'."\n"; |
} else { |
$retour_resultats .= '<h1>'.sprintf(MORE_LG_RESULTAT_TITRE_PLURIEL, $nbre_pages).'</h1>'."\n"; |
} |
if ($nbre_pages == 0) { |
$retour_resultats .= '<p class="information">'.MORE_LG_RESULTAT_VIDE.'</p>'."\n"; |
} else { |
$retour_resultats .= '<ul id="more_resultat">'."\n"; |
209,7 → 220,7 |
$id = 'more_motif'; |
$aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH, |
'accesskey' => MORE_LG_FORM_ACCESSKEY, 'onclick' => "javascript: this.value='';"); |
'accesskey' => MORE_LG_FORM_ACCESSKEY); |
$label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>'; |
$more_form->addElement('text', $id, $label, $aso_attributs); |
238,6 → 249,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.9 2006/04/28 12:41:49 florian |
* corrections erreurs chemin |
* |
* Revision 1.8 2006/03/02 10:49:49 ddelon |
* Fusion branche multilinguisme dans branche principale |
* |