New file |
0,0 → 1,102 |
<?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: bb_commun.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $ |
/** |
* Fonctions communes aux applications de Biblio Bota. |
* |
* Contient des fonctions communes aux applications de Biblio Bota. |
* |
*@package BiblioBota |
*@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: 2005-11-23 10:22:25 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|
|
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
|
// string check_if_modif($table) |
// vérifie dans la table des modifications si une donnée |
// est sujette à modifications |
// entrées : |
// - string $table : nom de la table des modifs |
// - string $field_src : nom du champ source |
// - string $fiche_id : identifiant de la fiche |
// sortie : |
function check_if_modif($table, $tbl_src, $fiche_id) |
{ |
$query = 'SELECT * '. |
'FROM '.$table.' '. |
'WHERE B_MOD_TABLESRC = "'.$tbl_src.'" '. |
'AND B_MOD_FICHESRC = "'.$fiche_id.'"'; |
$resu = mysql_query($query) or die ("<B>Erreur !!!</B> : la vérification des modifications a échoué... $query"); |
$nb_resu = mysql_num_rows($resu); |
mysql_free_result($resu); |
|
return $nb_resu; |
} |
/** |
* La fonction remplaceEntiteHTLM() remplace des caractères par les entités html. |
* |
* Cette fonction retourne un texte dans lequel touts les caractères correspondant |
* à des entités html sont remplacés par la valeur de l'entité, à l'exception |
* des caractères <, >, & et ". |
* Cela permet de remplacer toutes les entités dans une chaine contenant du html. |
* |
*@param string la chaîne html à parsser. |
*@return string contient la chaîne html avec les entités intégrées. |
*/ |
function remplaceEntiteHTLM($texte) |
{ |
$texte_retour = ''; |
$tab_entites = get_html_translation_table(HTML_ENTITIES); |
unset($tab_entites['"']); |
unset($tab_entites['<']); |
unset($tab_entites['>']); |
unset($tab_entites['&']); |
$tab_entites[' & '] = ' & '; |
return strtr($texte, $tab_entites); |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.2 2005/05/17 10:10:08 jpm |
* Correction des bogues avant mise en ligne du site v4. |
* |
* Revision 1.1 2004/09/14 11:12:50 jpm |
* Ajout des fonctions communes aux applications de BiblioBota. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |