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