Line 19... |
Line 19... |
19 |
// | |
|
19 |
// | |
|
20 |
// | You should have received a copy of the GNU General Public License |
|
20 |
// | You should have received a copy of the GNU General Public License |
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
24 |
// CVS : $Id: gallerie.php,v 1.1 2006-12-07 17:29:20 jp_milcent Exp $
|
24 |
// CVS : $Id: gallerie.php,v 1.2 2006-12-08 16:00:11 jp_milcent Exp $
|
25 |
/**
|
25 |
/**
|
26 |
* papyrus_bp - gallerie.php
|
26 |
* papyrus_bp - gallerie.php
|
27 |
*
|
27 |
*
|
28 |
* Le code provient de "Simple Image Gallery" (in content items) Plugin for Joomla 1.0.x - Version 1.0
|
28 |
* Le code provient de "Simple Image Gallery" (in content items) Plugin for Joomla 1.0.x - Version 1.0
|
29 |
* License: http://www.gnu.org/copyleft/gpl.html
|
29 |
* License: http://www.gnu.org/copyleft/gpl.html
|
Line 35... |
Line 35... |
35 |
//Auteur original :
|
35 |
//Auteur original :
|
36 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
36 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
37 |
//Autres auteurs :
|
37 |
//Autres auteurs :
|
38 |
*@author Aucun
|
38 |
*@author Aucun
|
39 |
*@copyright Tela-Botanica 1999-2006
|
39 |
*@copyright Tela-Botanica 1999-2006
|
40 |
*@version $Revision: 1.1 $ $Date: 2006-12-07 17:29:20 $
|
40 |
*@version $Revision: 1.2 $ $Date: 2006-12-08 16:00:11 $
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
*/
|
42 |
*/
|
Line 43... |
Line 43... |
43 |
|
43 |
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
45 |
// | ENTÊTE du PROGRAMME |
|
45 |
// | ENTÊTE du PROGRAMME |
|
Line 46... |
Line 46... |
46 |
// +------------------------------------------------------------------------------------------------------+
|
46 |
// +------------------------------------------------------------------------------------------------------+
|
47 |
|
47 |
|
Line 48... |
Line 48... |
48 |
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherGallerie';
|
48 |
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherGallerie';
|
49 |
$GLOBALS['_GEN_commun']['info_applette_balise'] = '\{\{[Gg]allerie(?: (?:(dossier="[^"]+")|(largeur="[^"]+")|(hauteur="[^"]+")|(qualite="[^"]+")))+\}\}';
|
49 |
$GLOBALS['_GEN_commun']['info_applette_balise'] = '\{\{[Gg]allerie(?:\s*(?:(dossier="[^"]+")|(largeur="[^"]+")|(hauteur="[^"]+")|(qualite="[^"]+")|))+\s*\}\}';
|
Line 50... |
Line 50... |
50 |
|
50 |
|
Line 64... |
Line 64... |
64 |
*/
|
64 |
*/
|
65 |
function afficherGallerie($tab_applette_arguments, $_GEN_commun)
|
65 |
function afficherGallerie($tab_applette_arguments, $_GEN_commun)
|
66 |
{
|
66 |
{
|
67 |
// Initialisation des variables
|
67 |
// Initialisation des variables
|
68 |
$sortie = '';
|
68 |
$sortie = '';
|
- |
|
69 |
$GLOBALS['_GALLERIE_']['erreur'] = '';
|
Line -... |
Line 70... |
- |
|
70 |
|
- |
|
71 |
//+----------------------------------------------------------------------------------------------------------------+
|
69 |
|
72 |
// Gestion des arguments
|
70 |
$tab_arguments = $tab_applette_arguments;
|
73 |
$tab_arguments = $tab_applette_arguments;
|
71 |
unset($tab_arguments[0]);
|
74 |
unset($tab_arguments[0]);
|
72 |
foreach($tab_arguments as $argument) {
|
75 |
foreach($tab_arguments as $argument) {
|
73 |
$tab_parametres = explode('=', trim($argument));
|
76 |
$tab_parametres = explode('=', trim($argument));
|
74 |
$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
|
77 |
$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
|
75 |
}
|
78 |
}
|
- |
|
79 |
|
- |
|
80 |
//+----------------------------------------------------------------------------------------------------------------+
|
76 |
|
81 |
// Gestion des erreurs de paramètrage
|
77 |
if (!isset($options['dossier'])) {
|
82 |
if (!isset($options['dossier'])) {
|
78 |
$GLOBALS['_GALLERIE_']['erreur'] = "Applette GALLERIE : le paramètre 'dossier' est obligatoire !";
|
83 |
$GLOBALS['_GALLERIE_']['erreur'] = "Applette GALLERIE : le paramètre 'dossier' est obligatoire !";
|
79 |
}
|
84 |
}
|
80 |
if (!isset($options['largeur'])) {
|
85 |
if (!isset($options['largeur'])) {
|
Line 84... |
Line 89... |
84 |
$options['hauteur'] = 160;
|
89 |
$options['hauteur'] = 160;
|
85 |
}
|
90 |
}
|
86 |
if (!isset($options['qualite'])) {
|
91 |
if (!isset($options['qualite'])) {
|
87 |
$options['qualite'] = 70;
|
92 |
$options['qualite'] = 70;
|
88 |
}
|
93 |
}
|
89 |
|
94 |
|
- |
|
95 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
96 |
// Récupération des données
|
90 |
$noimage = 0;
|
97 |
$noimage = 0;
|
91 |
// Read directory
|
- |
|
92 |
$GLOBALS['_GALLERIE_']['dossier'] = PAP_CHEMIN_RACINE.$options['dossier'];
|
98 |
$GLOBALS['_GALLERIE_']['dossier'] = PAP_CHEMIN_RACINE.$options['dossier'];
|
93 |
if (is_dir($GLOBALS['_GALLERIE_']['dossier'])) {
|
99 |
if (is_dir($GLOBALS['_GALLERIE_']['dossier'])) {
|
94 |
if ($dh = opendir($GLOBALS['_GALLERIE_']['dossier'])) {
|
100 |
if ($dh = opendir($GLOBALS['_GALLERIE_']['dossier'])) {
|
95 |
while (($f = readdir($dh)) !== false) {
|
101 |
while (($f = readdir($dh)) !== false) {
|
96 |
if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'gif') || (substr(strtolower($f),-3) == 'png')) {
|
102 |
if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'gif') || (substr(strtolower($f),-3) == 'png')) {
|
Line 117... |
Line 123... |
117 |
$aso_img['url_img_mini'] = preg_replace('/papyrus\.php$/', '', PAP_URL).GALL_CHEMIN_SCRIPTS.'showthumb.php?img='.urlencode(PAP_CHEMIN_RACINE.$options['dossier'].'/'.$image['filename']).'&width='.$options['largeur'].'&height='.$options['hauteur'].'&quality='.$options['qualite'];
|
123 |
$aso_img['url_img_mini'] = preg_replace('/papyrus\.php$/', '', PAP_URL).GALL_CHEMIN_SCRIPTS.'showthumb.php?img='.urlencode(PAP_CHEMIN_RACINE.$options['dossier'].'/'.$image['filename']).'&width='.$options['largeur'].'&height='.$options['hauteur'].'&quality='.$options['qualite'];
|
118 |
$GLOBALS['_GALLERIE_']['images'][] = $aso_img;
|
124 |
$GLOBALS['_GALLERIE_']['images'][] = $aso_img;
|
119 |
}
|
125 |
}
|
120 |
}
|
126 |
}
|
121 |
}
|
127 |
}
|
- |
|
128 |
|
- |
|
129 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
130 |
// Gestion des squelettes
|
122 |
// Extrait les variables et les ajoutes à l'espace de noms local
|
131 |
// Extrait les variables et les ajoutes à l'espace de noms local
|
123 |
extract($GLOBALS['_GALLERIE_']);
|
132 |
extract($GLOBALS['_GALLERIE_']);
|
124 |
// Démarre le buffer
|
133 |
// Démarre le buffer
|
125 |
ob_start();
|
134 |
ob_start();
|
126 |
// Inclusion du fichier
|
135 |
// Inclusion du fichier
|
127 |
include(GALL_CHEMIN_SQUELETTE.GALL_SQUELETTE_LISTE);
|
136 |
include(GALL_CHEMIN_SQUELETTE.GALL_SQUELETTE_LISTE);
|
128 |
// Récupérer le contenu du buffer
|
137 |
// Récupérer le contenu du buffer
|
129 |
$sortie = ob_get_contents();
|
138 |
$sortie = ob_get_contents();
|
130 |
// Arrête et détruit le buffer
|
139 |
// Arrête et détruit le buffer
|
131 |
ob_end_clean();
|
140 |
ob_end_clean();
|
132 |
|
141 |
|
- |
|
142 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
143 |
// Sortie
|
133 |
return $sortie;
|
144 |
return $sortie;
|
134 |
}
|
145 |
}
|
Line 135... |
Line 146... |
135 |
|
146 |
|
136 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
147 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
137 |
*
|
148 |
*
|
- |
|
149 |
* $Log: not supported by cvs2svn $
|
- |
|
150 |
* Revision 1.1 2006/12/07 17:29:20 jp_milcent
|
- |
|
151 |
* Ajout de l'applette Gallerie dans Client car elle n'a pas un rapport direct avec Papyrus.
|
138 |
* $Log: not supported by cvs2svn $
|
152 |
*
|
139 |
* Revision 1.2 2006/12/07 16:25:23 jp_milcent
|
153 |
* Revision 1.2 2006/12/07 16:25:23 jp_milcent
|
140 |
* Ajout de la gestion de messages d'erreur.
|
154 |
* Ajout de la gestion de messages d'erreur.
|
141 |
* Ajout de la gestion des squelettes.
|
155 |
* Ajout de la gestion des squelettes.
|
142 |
*
|
156 |
*
|