Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

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