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
// +------------------------------------------------------------------------------------------------------+
30 mathias 22
// CVS : $Id: bbc_statistique.fonct.php,v 1.1 2004/09/10 18:43:31 jpm Exp $
2 jp_milcent 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
30 mathias 35
*@version       $Revision: 1.1 $ $Date: 2004/09/10 18:43:31 $
2 jp_milcent 36
// +------------------------------------------------------------------------------------------------------+
37
*/
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
30 mathias 42
                                    /*Mettre ici les inclusions de fichiers*/
2 jp_milcent 43
 
30 mathias 44
 
2 jp_milcent 45
// +------------------------------------------------------------------------------------------------------+
46
// |                                           LISTE de FONCTIONS                                         |
47
// +------------------------------------------------------------------------------------------------------+
30 mathias 48
                                        /*Mettre ici la liste de fonctions.*/
2 jp_milcent 49
 
50
/** Fonction spy_validated_finder() - Enregistrement des statistiques.
51
*
52
* Fonction insèrant dans la table biblio_spy des données concernant les requêtes
53
* faites par les utilisateurs de Biblio Botanica.
54
*
55
* @param string les arguments d'appel de la page de Biblio Bota.
56
* @return void les données sont enregistrées dans la base de données.
57
*/
58
function spy_validated_finder($page_arg, $nbres)
59
{
30 mathias 60
    global $doc;
61
    global $REMOTE_ADDR;
62
    global $TabFinder, $TransTab;
2 jp_milcent 63
 
64
    if (isset($TransTab)) {
30 mathias 65
        $TabFinder = UnstoreTransTab($TransTab);
2 jp_milcent 66
    }
67
 
68
    $moment = time();
69
 
30 mathias 70
    if (!isset($TabFinder['plugin'])) $TabFinder['plugin'] = "";
71
    if (!isset($TabFinder['geo'])) $TabFinder['geo'] = "";
72
    if (!isset($TabFinder['chaine'])) $TabFinder['chaine'] = "";
73
    if (!isset($TabFinder['sort'])) $TabFinder['sort'] = "";
74
    if (!isset($TabFinder['auteur'])) $TabFinder['auteur'] = "";
75
    if (!isset($TabFinder['categ'])) $TabFinder['categ'] = "";
76
    if (!isset($TabFinder['pstart'])) $TabFinder['pstart'] = "";
77
    if (!isset($TabFinder['pend'])) $TabFinder['pend'] = "";
78
    if (!isset($TabFinder['step'])) $TabFinder['step'] = "";
79
    if (!isset($TabFinder['valid'])) $TabFinder['valid'] = "";
80
    if (!isset($TabFinder['typque'])) $TabFinder['typque'] = "";
81
    if (!isset($TabFinder['categ_2'])) $TabFinder['categ_2'] = "";
82
    if (!isset($TabFinder['categ_3'])) $TabFinder['categ_3'] = "";
83
    if (!isset($TabFinder['since'])) $TabFinder['since'] = "";
2 jp_milcent 84
 
30 mathias 85
    if ($nbres > 0) $calc_pages = "De ".$TabFinder['pstart']." à ".$TabFinder['pend']." sur $nbres";
86
    else $calc_pages = "Pas de résultats";
2 jp_milcent 87
 
30 mathias 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')";
89
 
90
    mysql_query($query) or die("<B>Erreur de stockage dans BiblioCheck :</B> $query");
2 jp_milcent 91
}
92
 
93
/* +--Fin du code ----------------------------------------------------------------------------------------+
94
*
30 mathias 95
* $Log: bbc_statistique.fonct.php,v $
2 jp_milcent 96
* Revision 1.1  2004/09/10 18:43:31  jpm
97
* Ajout d'une bibliothèque de gestion de fonction de statistique de Biblio Bota.
98
*
99
*
100
* +-- Fin du code ----------------------------------------------------------------------------------------+
101
*/
102
?>