Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 19 | Go to most recent revision | Details | 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: bb_commun.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
23
/**
24
* Fonctions communes aux applications de Biblio Bota.
25
*
26
* Contient des fonctions communes aux applications de Biblio Bota.
27
*
28
*@package BiblioBota
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
// |                                           LISTE de FONCTIONS                                         |
46
// +------------------------------------------------------------------------------------------------------+
47
 
48
// string check_if_modif($table)
49
// vérifie dans la table des modifications si une donnée
50
// est sujette à modifications
51
// entrées :
52
// - string $table : nom de la table des modifs
53
// - string $field_src : nom du champ source
54
// - string $fiche_id : identifiant de la fiche
55
// sortie :
56
function check_if_modif($table, $tbl_src, $fiche_id)
57
{
58
    $query =    'SELECT * '.
59
                'FROM '.$table.' '.
60
                'WHERE B_MOD_TABLESRC = "'.$tbl_src.'" '.
61
                'AND B_MOD_FICHESRC = "'.$fiche_id.'"';
62
    $resu = mysql_query($query) or die ("<B>Erreur !!!</B> : la vérification des modifications a échoué... $query");
63
    $nb_resu = mysql_num_rows($resu);
64
    mysql_free_result($resu);
65
 
66
    return $nb_resu;
67
}
68
/**
69
* La fonction remplaceEntiteHTLM() remplace des caractères par les entités html.
70
*
71
* Cette fonction retourne un texte dans lequel touts les caractères correspondant
72
* à des entités html sont remplacés par la valeur de l'entité, à l'exception
73
* des caractères <, >, & et ".
74
* Cela permet de remplacer toutes les entités dans une chaine contenant du html.
75
*
76
*@param string la chaîne html à parsser.
77
*@return string contient la chaîne html avec les entités intégrées.
78
*/
79
function remplaceEntiteHTLM($texte)
80
{
81
    $texte_retour = '';
82
    $tab_entites = get_html_translation_table(HTML_ENTITIES);
83
    unset($tab_entites['"']);
84
    unset($tab_entites['<']);
85
    unset($tab_entites['>']);
86
    unset($tab_entites['&']);
87
    $tab_entites[' & '] = ' &amp; ';
88
    return strtr($texte, $tab_entites);
89
}
90
/* +--Fin du code ----------------------------------------------------------------------------------------+
91
*
92
* $Log: not supported by cvs2svn $
93
* Revision 1.2  2005/05/17 10:10:08  jpm
94
* Correction des bogues avant mise en ligne du site v4.
95
*
96
* Revision 1.1  2004/09/14 11:12:50  jpm
97
* Ajout des fonctions communes aux applications de BiblioBota.
98
*
99
*
100
* +-- Fin du code ----------------------------------------------------------------------------------------+
101
*/
102
?>