Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 850 → Rev 851

/trunk/papyrus/applettes/moteur_recherche/configuration/more_configuration.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_configuration.inc.php,v 1.1 2004-12-07 10:24:12 jpm Exp $
// CVS : $Id: more_configuration.inc.php,v 1.2 2006-05-23 14:18:19 jp_milcent Exp $
/**
* Fichier de configuration général de l'applette Moteur_Recherche.
*
34,7 → 34,7
//Autres auteurs :
*@author aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004-12-07 10:24:12 $
*@version $Revision: 1.2 $ $Date: 2006-05-23 14:18:19 $
// +------------------------------------------------------------------------------------------------------+
*/
 
48,6 → 48,8
// +------------------------------------------------------------------------------------------------------+
/** Constante stockant la valeur de la langue par défaut pour l'applette MORE.*/
define('MORE_I18N_DEFAUT', GEN_I18N_ID_DEFAUT);
/** Constante stockant la valeur de la langue par défaut pour l'applette MORE.*/
define('MORE_MODE', 2);// 1 : recherche de chaque mot du motif; 2: recherche du motif complet
 
// Chemin des fichiers à inclure.
/** Chemin vers la bibliothèque PEAR.*/
72,6 → 74,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/12/07 10:24:12 jpm
* Moteur de recherche version de départ.
*
*
* +-- 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.7 2006-05-19 10:04:55 jp_milcent Exp $
// CVS : $Id: more_recherche.class.php,v 1.8 2006-05-23 14:18:19 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.7 $ $Date: 2006-05-19 10:04:55 $
*@version $Revision: 1.8 $ $Date: 2006-05-23 14:18:19 $
// +------------------------------------------------------------------------------------------------------+
*/
 
125,14 → 125,19
* @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)
function retournerOccurenceMotif($motif, &$texte, $mode = MORE_MODE)
{
$nbre_correspondance = 0;
// Découpage en mot
$tab_motif = explode(' ', trim($motif));
if ($mode == 1) {
// Découpage en mot
$tab_motif = explode(' ', trim($motif));
} else {
// La chaine saisie par l'utilisateur est recherchée tel quel
$tab_motif[] = trim($motif);
}
// Nous recherchons chaque mot
foreach ($tab_motif as $mot) {
$nbre_correspondance += substr_count(strtolower($texte), ' '.strtolower(stripslashes($mot)).' ');
$nbre_correspondance += substr_count(strtolower($texte), strtolower(stripslashes($mot)));
//$nbre_correspondance += preg_match_all('/'.$mot.'/i', $texte, $tab_morceaux);
}
return $nbre_correspondance;
174,6 → 179,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.7 2006/05/19 10:04:55 jp_milcent
* Ajout d'un moteur de recherche analysant les articles des sites sous Spip.
*
* Revision 1.6 2006/04/28 12:41:49 florian
* corrections erreurs chemin
*