Subversion Repositories eFlore/Applications.bibliobota

Rev

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

<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1                                                                                      |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or                                        |
// | modify it under the terms of the GNU Lesser General Public                                           |
// | License as published by the Free Software Foundation; either                                         |
// | version 2.1 of the License, or (at your option) any later version.                                   |
// |                                                                                                      |
// | This library is distributed in the hope that it will be useful,                                      |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
// | Lesser General Public License for more details.                                                      |
// |                                                                                                      |
// | You should have received a copy of the GNU Lesser General Public                                     |
// | License along with this library; if not, write to the Free Software                                  |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bbc_statistique.fonct.php,v 1.1 2004/09/10 18:43:31 jpm Exp $
/**
* Fonctions de statistique de Biblio Bota.
*
* Contient les fonctions permettant de faire les statistiques de Biblio Bota.
*
*@package BiblioBota-Consultation
*@subpackage Fonctions
//Auteur original :
*@author        Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright     Tela-Botanica 2000-2004
*@version       $Revision: 1.1 $ $Date: 2004/09/10 18:43:31 $
// +------------------------------------------------------------------------------------------------------+
*/

// +------------------------------------------------------------------------------------------------------+
// |                                            ENTETE du PROGRAMME                                       |
// +------------------------------------------------------------------------------------------------------+
                                    /*Mettre ici les inclusions de fichiers*/                             

                    
// +------------------------------------------------------------------------------------------------------+
// |                                           LISTE de FONCTIONS                                         |
// +------------------------------------------------------------------------------------------------------+
                                        /*Mettre ici la liste de fonctions.*/

/** Fonction spy_validated_finder() - Enregistrement des statistiques.
*
* Fonction insèrant dans la table biblio_spy des données concernant les requêtes
* faites par les utilisateurs de Biblio Botanica.
*
* @param string les arguments d'appel de la page de Biblio Bota.
* @return void les données sont enregistrées dans la base de données.
*/
function spy_validated_finder($page_arg, $nbres)
{
    global $doc;
    global $REMOTE_ADDR;
    global $TabFinder, $TransTab;
    
    if (isset($TransTab)) {
        $TabFinder = UnstoreTransTab($TransTab);
    }
    
    $moment = time();
    
    if (!isset($TabFinder['plugin'])) $TabFinder['plugin'] = "";
    if (!isset($TabFinder['geo'])) $TabFinder['geo'] = "";
    if (!isset($TabFinder['chaine'])) $TabFinder['chaine'] = "";
    if (!isset($TabFinder['sort'])) $TabFinder['sort'] = "";
    if (!isset($TabFinder['auteur'])) $TabFinder['auteur'] = "";
    if (!isset($TabFinder['categ'])) $TabFinder['categ'] = "";
    if (!isset($TabFinder['pstart'])) $TabFinder['pstart'] = "";
    if (!isset($TabFinder['pend'])) $TabFinder['pend'] = "";
    if (!isset($TabFinder['step'])) $TabFinder['step'] = "";
    if (!isset($TabFinder['valid'])) $TabFinder['valid'] = "";
    if (!isset($TabFinder['typque'])) $TabFinder['typque'] = "";
    if (!isset($TabFinder['categ_2'])) $TabFinder['categ_2'] = "";
    if (!isset($TabFinder['categ_3'])) $TabFinder['categ_3'] = "";
    if (!isset($TabFinder['since'])) $TabFinder['since'] = "";
    
    if ($nbres > 0) $calc_pages = "De ".$TabFinder['pstart']." à ".$TabFinder['pend']." sur $nbres";
    else $calc_pages = "Pas de résultats";
    
    $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')";
    
    mysql_query($query) or die("<B>Erreur de stockage dans BiblioCheck :</B> $query");     
}

/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: bbc_statistique.fonct.php,v $
* Revision 1.1  2004/09/10 18:43:31  jpm
* Ajout d'une bibliothèque de gestion de fonction de statistique de Biblio Bota.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>