1 |
<?php
|
1 |
<?php
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
4 |
// | PHP version 4.1 |
|
4 |
// | PHP version 4.1 |
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
8 |
// | This library is free software; you can redistribute it and/or |
|
8 |
// | This library is free software; you can redistribute it and/or |
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
10 |
// | License as published by the Free Software Foundation; either |
|
10 |
// | License as published by the Free Software Foundation; either |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
12 |
// | |
|
12 |
// | |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 |
// | Lesser General Public License for more details. |
|
16 |
// | Lesser General Public License for more details. |
|
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: bbc_statistique.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
|
22 |
// CVS : $Id: bbc_statistique.fonct.php,v 1.1 2004/09/10 18:43:31 jpm Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Fonctions de statistique de Biblio Bota.
|
24 |
* Fonctions de statistique de Biblio Bota.
|
25 |
*
|
25 |
*
|
26 |
* Contient les fonctions permettant de faire les statistiques de Biblio Bota.
|
26 |
* Contient les fonctions permettant de faire les statistiques de Biblio Bota.
|
27 |
*
|
27 |
*
|
28 |
*@package BiblioBota-Consultation
|
28 |
*@package BiblioBota-Consultation
|
29 |
*@subpackage Fonctions
|
29 |
*@subpackage Fonctions
|
30 |
//Auteur original :
|
30 |
//Auteur original :
|
31 |
*@author Jean-Charles GRANGER <tela@vecteur.org>
|
31 |
*@author Jean-Charles GRANGER <tela@vecteur.org>
|
32 |
//Autres auteurs :
|
32 |
//Autres auteurs :
|
33 |
*@author Jean-Pascal MILCENT <jpm@clapas.org>
|
33 |
*@author Jean-Pascal MILCENT <jpm@clapas.org>
|
34 |
*@copyright Tela-Botanica 2000-2004
|
34 |
*@copyright Tela-Botanica 2000-2004
|
35 |
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
|
35 |
*@version $Revision: 1.1 $ $Date: 2004/09/10 18:43:31 $
|
36 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
// +------------------------------------------------------------------------------------------------------+
|
37 |
*/
|
37 |
*/
|
38 |
|
38 |
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// | ENTETE du PROGRAMME |
|
40 |
// | ENTETE du PROGRAMME |
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
42 |
/*Mettre ici les inclusions de fichiers*/
|
42 |
|
- |
|
43 |
|
43 |
|
44 |
|
44 |
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
46 |
// | LISTE de FONCTIONS |
|
46 |
// | LISTE de FONCTIONS |
|
47 |
// +------------------------------------------------------------------------------------------------------+
|
47 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
48 |
/*Mettre ici la liste de fonctions.*/
|
48 |
|
49 |
|
49 |
/** Fonction spy_validated_finder() - Enregistrement des statistiques.
|
50 |
/** Fonction spy_validated_finder() - Enregistrement des statistiques.
|
50 |
*
|
51 |
*
|
51 |
* Fonction insèrant dans la table biblio_spy des données concernant les requêtes
|
52 |
* Fonction insèrant dans la table biblio_spy des données concernant les requêtes
|
52 |
* faites par les utilisateurs de Biblio Botanica.
|
53 |
* faites par les utilisateurs de Biblio Botanica.
|
53 |
*
|
54 |
*
|
54 |
* @param string les arguments d'appel de la page de Biblio Bota.
|
55 |
* @param string les arguments d'appel de la page de Biblio Bota.
|
55 |
* @return void les données sont enregistrées dans la base de données.
|
56 |
* @return void les données sont enregistrées dans la base de données.
|
56 |
*/
|
57 |
*/
|
57 |
function spy_validated_finder($page_arg, $nbres)
|
58 |
function spy_validated_finder($page_arg, $nbres)
|
58 |
{
|
59 |
{
|
- |
|
60 |
global $doc;
|
- |
|
61 |
global $REMOTE_ADDR;
|
59 |
global $doc, $REMOTE_ADDR, $TabFinder, $TransTab;
|
62 |
global $TabFinder, $TransTab;
|
60 |
|
63 |
|
61 |
if (isset($TransTab)) {
|
64 |
if (isset($TransTab)) {
|
62 |
$TabFinder = FRAG_decoupageChaine($TransTab);
|
65 |
$TabFinder = UnstoreTransTab($TransTab);
|
63 |
}
|
66 |
}
|
64 |
|
67 |
|
65 |
$moment = time();
|
68 |
$moment = time();
|
66 |
|
69 |
|
67 |
if (!isset($TabFinder['plugin'])) {
|
- |
|
68 |
$TabFinder['plugin'] = '';
|
- |
|
69 |
}
|
70 |
if (!isset($TabFinder['plugin'])) $TabFinder['plugin'] = "";
|
70 |
if (!isset($TabFinder['geo'])) {
|
- |
|
71 |
$TabFinder['geo'] = '';
|
- |
|
72 |
}
|
71 |
if (!isset($TabFinder['geo'])) $TabFinder['geo'] = "";
|
73 |
if (!isset($TabFinder['chaine'])) {
|
- |
|
74 |
$TabFinder['chaine'] = '';
|
- |
|
75 |
}
|
72 |
if (!isset($TabFinder['chaine'])) $TabFinder['chaine'] = "";
|
76 |
if (!isset($TabFinder['sort'])) {
|
- |
|
77 |
$TabFinder['sort'] = '';
|
- |
|
78 |
}
|
73 |
if (!isset($TabFinder['sort'])) $TabFinder['sort'] = "";
|
79 |
if (!isset($TabFinder['auteur'])) {
|
- |
|
80 |
$TabFinder['auteur'] = '';
|
- |
|
81 |
}
|
74 |
if (!isset($TabFinder['auteur'])) $TabFinder['auteur'] = "";
|
82 |
if (!isset($TabFinder['categ'])) {
|
- |
|
83 |
$TabFinder['categ'] = '';
|
- |
|
84 |
}
|
75 |
if (!isset($TabFinder['categ'])) $TabFinder['categ'] = "";
|
85 |
if (!isset($TabFinder['pstart'])) {
|
- |
|
86 |
$TabFinder['pstart'] = '';
|
- |
|
87 |
}
|
76 |
if (!isset($TabFinder['pstart'])) $TabFinder['pstart'] = "";
|
88 |
if (!isset($TabFinder['pend'])) {
|
- |
|
89 |
$TabFinder['pend'] = '';
|
- |
|
90 |
}
|
77 |
if (!isset($TabFinder['pend'])) $TabFinder['pend'] = "";
|
91 |
if (!isset($TabFinder['step'])) {
|
- |
|
92 |
$TabFinder['step'] = '';
|
- |
|
93 |
}
|
78 |
if (!isset($TabFinder['step'])) $TabFinder['step'] = "";
|
94 |
if (!isset($TabFinder['valid'])) {
|
- |
|
95 |
$TabFinder['valid'] = '';
|
- |
|
96 |
}
|
79 |
if (!isset($TabFinder['valid'])) $TabFinder['valid'] = "";
|
97 |
if (!isset($TabFinder['typque'])) {
|
- |
|
98 |
$TabFinder['typque'] = '';
|
- |
|
99 |
}
|
80 |
if (!isset($TabFinder['typque'])) $TabFinder['typque'] = "";
|
100 |
if (!isset($TabFinder['categ_2'])) {
|
- |
|
101 |
$TabFinder['categ_2'] = '';
|
- |
|
102 |
}
|
81 |
if (!isset($TabFinder['categ_2'])) $TabFinder['categ_2'] = "";
|
103 |
if (!isset($TabFinder['categ_3'])) {
|
- |
|
104 |
$TabFinder['categ_3'] = '';
|
- |
|
105 |
}
|
82 |
if (!isset($TabFinder['categ_3'])) $TabFinder['categ_3'] = "";
|
106 |
if (!isset($TabFinder['since'])) {
|
- |
|
107 |
$TabFinder['since'] = '';
|
- |
|
108 |
}
|
- |
|
109 |
|
83 |
if (!isset($TabFinder['since'])) $TabFinder['since'] = "";
|
110 |
if ($nbres > 0) {
|
- |
|
111 |
$calc_pages = 'De '.$TabFinder['pstart'].' à '.$TabFinder['pend'].' sur '.$nbres;
|
84 |
|
112 |
} else {
|
- |
|
113 |
$calc_pages = 'Pas de résultats';
|
85 |
if ($nbres > 0) $calc_pages = "De ".$TabFinder['pstart']." à ".$TabFinder['pend']." sur $nbres";
|
114 |
}
|
- |
|
115 |
|
- |
|
116 |
$requete = 'INSERT INTO biblio_spy VALUES ("", "'.$doc.'.'.$TabFinder['plugin'].'", '.
|
- |
|
117 |
'"'.$page_arg.'", "'.$REMOTE_ADDR.'", "'.$TabFinder['chaine'].'", '.
|
- |
|
118 |
'"'.$TabFinder['geo'].'", "'.$TabFinder['auteur'].'", "'.$TabFinder['categ'].'", '.
|
- |
|
- |
|
86 |
else $calc_pages = "Pas de résultats";
|
119 |
'"'.$TabFinder['categ_2'].'", "'.$TabFinder['categ_3'].'", "'.$TabFinder['typque'].'", '.
|
87 |
|
120 |
'"'.$TabFinder['step'].'", "'.$TabFinder['sort'].'", "'.$TabFinder['since'].'", '.
|
88 |
$query = "insert into biblio_spy values ('','$doc ".$TabFinder['plugin']."','$page_arg','$REMOTE_ADDR','".$TabFinder['chaine']."','".$TabFinder['geo']."','".$TabFinder['auteur']."','".$TabFinder['categ']."','".$TabFinder['categ_2']."','".$TabFinder['categ_3']."','".$TabFinder['typque']."','".$TabFinder['step']."','".$TabFinder['sort']."','".$TabFinder['since']."','$calc_pages','$moment')";
|
121 |
'"'.$calc_pages.'", "'.$moment.'")';
|
89 |
|
122 |
mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
|
90 |
mysql_query($query) or die("<B>Erreur de stockage dans BiblioCheck :</B> $query");
|
123 |
}
|
91 |
}
|
124 |
|
92 |
|
125 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
93 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
126 |
*
|
94 |
*
|
127 |
* $Log: not supported by cvs2svn $
|
95 |
* $Log: bbc_statistique.fonct.php,v $
|
128 |
* Revision 1.2 2005/05/17 10:10:08 jpm
|
- |
|
129 |
* Correction des bogues avant mise en ligne du site v4.
|
- |
|
130 |
*
|
- |
|
131 |
* Revision 1.1 2004/09/10 18:43:31 jpm
|
96 |
* Revision 1.1 2004/09/10 18:43:31 jpm
|
132 |
* Ajout d'une bibliothèque de gestion de fonction de statistique de Biblio Bota.
|
97 |
* Ajout d'une bibliothèque de gestion de fonction de statistique de Biblio Bota.
|
133 |
*
|
98 |
*
|
134 |
*
|
99 |
*
|
135 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
100 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
136 |
*/
|
101 |
*/
|
137 |
?>
|
102 |
?>
|