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.8 2006-05-23 14:18:19 jp_milcent Exp $ |
// CVS : $Id: more_recherche.class.php,v 1.9 2006-10-17 09:21:40 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.8 $ $Date: 2006-05-23 14:18:19 $ |
*@version $Revision: 1.9 $ $Date: 2006-10-17 09:21:40 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
136,11 → 136,21 |
$tab_motif[] = trim($motif); |
} |
// Nous recherchons chaque mot |
$compteur_mot = 0; |
foreach ($tab_motif as $mot) { |
$nbre_correspondance += substr_count(strtolower($texte), strtolower(stripslashes($mot))); |
//$nbre_correspondance += preg_match_all('/'.$mot.'/i', $texte, $tab_morceaux); |
$nbre_correspondance = substr_count(strtolower($texte), strtolower(stripslashes($mot))); |
if ($nbre_correspondance > 0) { |
$compteur_mot++; |
} |
$nbre_correspondance_total += $nbre_correspondance; |
} |
return $nbre_correspondance; |
// Si tous les mots recherchés sont présents nous renvoyons le poids de la page. |
if ($compteur_mot == count($tab_motif)) { |
return $nbre_correspondance_total; |
} else { |
return 0; |
} |
} |
|
function traduireMois($mois_numerique) |
179,6 → 189,10 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.8 2006/05/23 14:18:19 jp_milcent |
* Ajout de la gestion du mode de recherche au moteur de recherche de Papyrus. |
* Soit on recherche chaque mot du motif, soit le motif entier. |
* |
* Revision 1.7 2006/05/19 10:04:55 jp_milcent |
* Ajout d'un moteur de recherche analysant les articles des sites sous Spip. |
* |