Subversion Repositories Applications.papyrus

Rev

Rev 851 | Rev 1146 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 851 Rev 1034
Line 19... Line 19...
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: more_recherche.class.php,v 1.8 2006-05-23 14:18:19 jp_milcent Exp $
24
// CVS : $Id: more_recherche.class.php,v 1.9 2006-10-17 09:21:40 jp_milcent Exp $
25
/**
25
/**
26
* Classe permettant d'effectuer des recherches sur les métas informations des menus.
26
* Classe permettant d'effectuer des recherches sur les métas informations des menus.
27
*
27
*
28
* Permet de rechercher et classer les menus en fonction d'une chaine.
28
* Permet de rechercher et classer les menus en fonction d'une chaine.
29
*
29
*
Line 32... Line 32...
32
//Auteur original :
32
//Auteur original :
33
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
33
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
34
//Autres auteurs :
34
//Autres auteurs :
35
*@author        aucun
35
*@author        aucun
36
*@copyright     Tela-Botanica 2000-2004
36
*@copyright     Tela-Botanica 2000-2004
37
*@version       $Revision: 1.8 $ $Date: 2006-05-23 14:18:19 $
37
*@version       $Revision: 1.9 $ $Date: 2006-10-17 09:21:40 $
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
*/
39
*/
Line 40... Line 40...
40
 
40
 
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
Line 134... Line 134...
134
		} else {
134
		} else {
135
			// La chaine saisie par l'utilisateur est recherchée tel quel
135
			// La chaine saisie par l'utilisateur est recherchée tel quel
136
			$tab_motif[] = trim($motif);
136
			$tab_motif[] = trim($motif);
137
		}
137
		}
138
		// Nous recherchons chaque mot
138
		// Nous recherchons chaque mot
-
 
139
		$compteur_mot = 0;
139
		foreach ($tab_motif as $mot) {
140
		foreach ($tab_motif as $mot) {
140
			$nbre_correspondance += substr_count(strtolower($texte), strtolower(stripslashes($mot)));
-
 
141
			//$nbre_correspondance += preg_match_all('/'.$mot.'/i', $texte, $tab_morceaux);
141
			//$nbre_correspondance += preg_match_all('/'.$mot.'/i', $texte, $tab_morceaux);
-
 
142
			$nbre_correspondance = substr_count(strtolower($texte), strtolower(stripslashes($mot)));
-
 
143
			if ($nbre_correspondance > 0) {
-
 
144
				$compteur_mot++;
-
 
145
			}
-
 
146
			$nbre_correspondance_total += $nbre_correspondance; 
-
 
147
		}
-
 
148
		// Si tous les mots recherchés sont présents nous renvoyons le poids de la page.
-
 
149
		if ($compteur_mot == count($tab_motif)) {
-
 
150
			return $nbre_correspondance_total;
-
 
151
		} else {
-
 
152
			return 0;
142
		}
153
		}
143
		return $nbre_correspondance;
-
 
144
	}
154
	}
Line 145... Line 155...
145
	
155
	
146
    function traduireMois($mois_numerique)
156
    function traduireMois($mois_numerique)
147
    {
157
    {
Line 177... Line 187...
177
}
187
}
Line 178... Line 188...
178
 
188
 
179
/* +--Fin du code ----------------------------------------------------------------------------------------+
189
/* +--Fin du code ----------------------------------------------------------------------------------------+
180
*
190
*
-
 
191
* $Log: not supported by cvs2svn $
-
 
192
* Revision 1.8  2006/05/23 14:18:19  jp_milcent
-
 
193
* Ajout de la gestion du mode de recherche au moteur de recherche de Papyrus.
-
 
194
* Soit on recherche chaque mot du motif, soit le motif entier.
181
* $Log: not supported by cvs2svn $
195
*
182
* Revision 1.7  2006/05/19 10:04:55  jp_milcent
196
* Revision 1.7  2006/05/19 10:04:55  jp_milcent
183
* Ajout d'un moteur de recherche analysant les articles des sites sous Spip.
197
* Ajout d'un moteur de recherche analysant les articles des sites sous Spip.
184
*
198
*
185
* Revision 1.6  2006/04/28 12:41:49  florian
199
* Revision 1.6  2006/04/28 12:41:49  florian