Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 850 → Rev 851

/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
*