Index: /extensions/ExtendedDescription/admin.inc.php
===================================================================
--- /extensions/ExtendedDescription/admin.inc.php	(revision 3294)
+++ /extensions/ExtendedDescription/admin.inc.php	(revision 3294)
@@ -0,0 +1,31 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+add_event_handler('get_popup_help_content', 'extended_desc_popup', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+add_event_handler('loc_end_page_tail', 'add_ed_js');
+
+function add_ed_js()
+{
+  global $page, $template;
+  
+  $change = array('cat_modify', 'picture_modify', 'configuration', 'notification_by_mail');
+
+  if (!isset($page['page']) or !in_array($page['page'], $change)) return;
+
+  $template->assign('ed_page', $page['page']);
+  $template->set_filename('add_ed_popup', dirname(__FILE__) . '/template/add_popup.tpl');
+  $template->append('footer_elements', $template->parse('add_ed_popup', true));
+}
+
+function  extended_desc_popup($help_content, $get)
+{
+  if ($get == 'extended_desc')
+  {
+    $help_content = load_language('help.html', EXTENDED_DESC_PATH, array('return'=>true));
+  }
+  return $help_content;
+}
+
+
+?>
Index: /extensions/ExtendedDescription/config.php
===================================================================
--- /extensions/ExtendedDescription/config.php	(revision 3294)
+++ /extensions/ExtendedDescription/config.php	(revision 3294)
@@ -0,0 +1,8 @@
+<?php
+
+// Vous pouvez modifier ici les balises à utiliser
+
+$more = '<!--more-->';
+$complete  = '<!--complete-->';
+
+?>
Index: /extensions/ExtendedDescription/index.php
===================================================================
--- /extensions/ExtendedDescription/index.php	(revision 3294)
+++ /extensions/ExtendedDescription/index.php	(revision 3294)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program 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      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ExtendedDescription/language/en_UK/help.html
===================================================================
--- /extensions/ExtendedDescription/language/en_UK/help.html	(revision 3294)
+++ /extensions/ExtendedDescription/language/en_UK/help.html	(revision 3294)
@@ -0,0 +1,85 @@
+<h2>Extended Description</h2>
+
+<h3>Multilanguage descriptions</h3>
+
+<p>Multilanguage descriptions are placed between [lang=xx] and [/lang] tags, where xx is the language code (for example en, es, fr). There is also 2 special languages : [lang=default] and [lang=all]</p>
+
+<ul>
+  <li><b>Example</b>:<br>
+  <br>
+<code>[lang=default] default description [/lang]<br>
+[lang=en] description in english [/lang]<br>
+[lang=de] deutsche Beschreibung [/lang]</code>
+</li>
+</ul>
+
+<p>The default description will be used if the description is not available in the connected user selected language.
+If [lang=default] does not exists, anything outside the [lang] tags will be considered as the default description.</p>
+
+<p><u>Special language <i>all</i></u>: anything inside [lang=all] will be included in the description, anywhat the connected user defined language is.
+This is mainly useful to include HTML/JavaScript code inside a description.</p>
+
+<h3>Extended descriptions</h3>
+
+<p>Extended description tags make it possible to have a short description for the category outside the category,
+a longer description for the category inside the category page,
+or even 2 distinct descriptions inside the category page.</p>
+
+<p>tag &lt;!--more--&gt; adds text to the short description.<br>
+tag &lt;!--complete--&gt; let the user have 2 distinct descriptions.<br>
+tag &lt;!--up-down--&gt; let the user have a top and a bottom description.</p>
+
+<ul>
+  <li><b>tag &lt;!--more--&gt;</b></li>
+</ul>
+<code>short description &lt;!--more--&gt; long description</code>
+<p>Only the short description is displayed outside the category. On the category page, you will see short description + long description.</p>
+
+<ul>
+  <li><b>tag &lt;!--complete--&gt;</b></li>
+</ul>
+<code>short description &lt;!--complete--&gt; long description</code>
+<p>Only the short description is displayed outside the category. On the category page, you will only see the long description, so you have 2 distinct descriptions.</p>
+
+<ul>
+  <li><b>tag &lt;!--up-down--&gt;</b></li>
+</ul>
+<code>top description &lt;!--up-down--&gt; bottom description</code>
+<p>Only the top description is displayed outside the category.  On the category page, the top description is displayed above the thumbnails, the bottom description is displayed below the thumbnails.</p>
+
+<h3>Insert a category or a photo</h3>
+
+<ul>
+  <li><b>tag [cat=xx]</b></li>
+</ul>
+<p>This tag inserts a category in the description, where xx is the category identifier.</p>
+
+<ul>
+  <li><b>tag [img=xx1 xx2 xxN;yyyy;name]</b></li>
+</ul>
+<p>This tag allows to insert one or more thumbnail in the description, with:<br><br>
+- xx the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.
+<br>
+- yyyy (optional) : can take any value among {left, right}.</p>
+- name (optional) : if tagged, the name of the picture is diplayed under the thumbnail.</p>
+
+<h3>Hide a category</h3>
+
+<p>Use tag <b>&lt;!--hidden--&gt;</b> in the category name:<br>
+<br>
+- it won't be displayed in the parent category<br>
+- it remains visible in the category menu</p>
+
+<h3>Hide a category in menu</h3>
+
+<p>Use tag <b>&lt;!--mb-hidden--&gt;</b> in the category name:<br>
+<br>
+- it won't be displayed in the category menu<br>
+- it remains visible in the parent category</p>
+
+<h3>Hide an image</h3>
+
+<p>Use tag <b>&lt;!--hidden--&gt;</b> in the image name:<br>
+<br>
+- it won't be displayed on the thumbnails page<br>
+- it remains visible inside the category</p>
Index: /extensions/ExtendedDescription/language/en_UK/index.php
===================================================================
--- /extensions/ExtendedDescription/language/en_UK/index.php	(revision 3294)
+++ /extensions/ExtendedDescription/language/en_UK/index.php	(revision 3294)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program 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      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ExtendedDescription/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/en_UK/plugin.lang.php	(revision 3294)
+++ /extensions/ExtendedDescription/language/en_UK/plugin.lang.php	(revision 3294)
@@ -0,0 +1,5 @@
+<?php
+
+$lang['ExtendedDesc_help'] = 'Use Extended Description tags...';
+
+?>
Index: /extensions/ExtendedDescription/language/es_ES/help.html
===================================================================
--- /extensions/ExtendedDescription/language/es_ES/help.html	(revision 3294)
+++ /extensions/ExtendedDescription/language/es_ES/help.html	(revision 3294)
@@ -0,0 +1,92 @@
+<h2>Extended Description</h2>
+
+<h3>Descripciones multilingües</h3>
+
+<p>Las descripciones multilingües se hacen entre las balizas [lang=xx] y [/lang], O xx es el código de la lengua (por ejemplo fr, en, es, it, de ....)
+Existen también 2 balizas especiales: [lang=default] y [lang=all]</p>
+
+<ul>
+  <li><b>Ejemplo de utilización</b>:<br>
+  <br>
+<code>[lang=default] Descripción por defecto [/lang]<br>
+[lang=fr] Descripción ello francais [/lang]<br>
+[lang=it] Descripción en italiano [/lang]</code>
+</li>
+</ul>
+
+<p>La descripción por defecto será utilizada si la descripción en la lengua del usuario no es definida.
+Si [lang=default] no existe, todo lo que está situado aparte de las balizas de lenguas estará considerado como descripción por defecto.</p>
+
+<p><u>Baliza  <i>all</i></u>: Todo lo que está situado entre las balizas [lang=all] y [/lang] será incluido en la descripción, cualquiera que sea la lengua del usuario.
+Esto es particularmente práctico para incluir del código html o javascript en una descripción.</p>
+
+
+<h3>Descripciones extensas</h3>
+
+<p>Las balizas de descripción extensa permiten tener una descripción reducida para la presentación de una categoría,
+ una descripción extendida para la descripción que se exhibe sobre la página de la categoría,
+ o dos descripciones diferentes sobre la página de la categoría.</p>
+
+<p>La baliza &lt;!--more--&gt; permite añadir del texto a la descripción reducida.<br>
+La baliza &lt;!--complete--&gt; permite tener 2 descripciones distintas.<br>
+La baliza &lt;!--up-down--&gt; Permite tener una descripción alta y un descrition bajo.</p>
+
+<ul>
+  <li><b>Baliza &lt;!--more--&gt;</b></li>
+</ul>
+<code>descripción reducida &lt;!--more--&gt; descripción detallada</code>
+<p>Sólo la descripción reducida será fijada para la presentación de la categoría.
+Sobre la categoría misma, la descripción será la descripción reducida + la descripción detallada.</p>
+
+<ul>
+  <li><b>Baliza &lt;!--complete--&gt;</b></li>
+</ul>
+<code>descripción reducida &lt;!--complete--&gt; descripción detallada</code>
+<p>Sólo la descripción reducida será fijada para la presentación de la categoría.
+En cambio, sobre la categoría misma, la descripción únicamente será la descripción detallada, es decir 2 descripciones diferentes.</p>
+
+<ul>
+  <li><b>Baliza &lt;!--up-down--&gt;</b></li>
+</ul>
+<code>descripción alta &lt;!--up-down--&gt; descripción baja</code>
+<p>Sólo la descripción alta será fijada para la presentación de la categoría.
+Sobre la categoría misma, la descripción alta será fijada por encima de las miniaturas, mientras que
+ la descripción baja sea fijada debajo (en el emplazamiento normal de la descripción).</p>
+
+
+<h3>Insertar una categoría o una imagen</h3>
+
+<ul>
+  <li><b>Baliza [cat=xx]</b></li>
+</ul>
+<p>Esta baliza permite insertar una categoría en la descripción, con xx el número de la categoría</p>
+
+<ul>
+  <li><b>Baliza [img=xx;yyyy]</b></li>
+</ul>
+<p>Esta baliza permite insertar una imagen en la descripción, con:<br><br>
+- xx El número de la imagen; Es posible precisar el número de la categoría madre después del número de la imagen : <code>xx.ccc</code>.
+<br>
+- yyyy (facultativo) agarra o el valor <i>left</i>, sea el valor <i>right</i> y permite situar la viñeta de la imagen sobre la derecha o la izquierda.</p>
+
+<h3>Enmascarar una categoría</h3>
+
+<p>Ponemos la baliza <b>&lt;!--hidden--&gt;</b> En el nombre de la categoría :<br>
+<br>
+- Ésta no será fijada más sobre la página de la categoría allegada<br>
+- Queda visible en el menú de las categorías</p>
+
+<!-- TODO -->
+<h3>Hide a category in menu</h3>
+
+<p>Use tag <b>&lt;!--mb-hidden--&gt;</b> in the category name:<br>
+<br>
+- it won't be displayed in the category menu<br>
+- it remains visible in the parent category</p>
+
+<h3>Hide an image</h3>
+
+<p>Use tag <b>&lt;!--hidden--&gt;</b> in the image name:<br>
+<br>
+- it won't be displayed on the thumbnails page<br>
+- it remains visible inside the category</p>
Index: /extensions/ExtendedDescription/language/es_ES/index.php
===================================================================
--- /extensions/ExtendedDescription/language/es_ES/index.php	(revision 3294)
+++ /extensions/ExtendedDescription/language/es_ES/index.php	(revision 3294)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program 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      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ExtendedDescription/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/es_ES/plugin.lang.php	(revision 3294)
+++ /extensions/ExtendedDescription/language/es_ES/plugin.lang.php	(revision 3294)
@@ -0,0 +1,5 @@
+<?php
+
+$lang['ExtendedDesc_help'] = 'Utilizar las balizas de...';
+
+?>
Index: /extensions/ExtendedDescription/language/fr_FR/help.html
===================================================================
--- /extensions/ExtendedDescription/language/fr_FR/help.html	(revision 3294)
+++ /extensions/ExtendedDescription/language/fr_FR/help.html	(revision 3294)
@@ -0,0 +1,92 @@
+<h2>Extended Description</h2>
+
+<h3>Descriptions multilingues</h3>
+
+<p>Les descriptions multilingues se font entre les balises [lang=xx] et [/lang], ou xx est le code de la langue (par exemple fr, en, es, it, etc....)
+Il existe également 2 balises spéciales: [lang=default] et [lang=all]</p>
+
+<ul>
+  <li><b>Exemple d'utilisation</b>:<br>
+  <br>
+<code>[lang=default] description par défaut [/lang]<br>
+[lang=fr] description en francais [/lang]<br>
+[lang=it] description en italien [/lang]</code>
+</li>
+</ul>
+
+<p>La description par défaut sera utilisée si la description dans la langue de l'utilisateur n'est pas définie.
+Si [lang=default] n'existe pas, tout ce qui est situé en dehors des balises de langues sera considéré comme description par défaut.</p>
+
+<p><u>Balise <i>all</i></u>: tout ce qui est situé entre les balises [lang=all] et [/lang] sera inclus dans la description, quelle que soit la langue de l'utilisateur.
+Ceci est particulièrement pratique pour inclure du code html ou javascript dans une description.</p>
+
+
+<h3>Descriptions étendues</h3>
+
+<p>Les balises de description étendue permettent d'avoir une description réduite pour la présentation d'une catégorie,
+une description étendue pour la description qui s'affiche sur la page de la catégorie,
+ou deux descriptions différentes sur la page de la catégorie.</p>
+
+<p>La balise &lt;!--more--&gt; permet de rajouter du texte à la description réduite.<br>
+La balise &lt;!--complete--&gt; permet d'avoir 2 descriptions distinctes.<br>
+La balise &lt;!--up-down--&gt; permet d'avoir une description haute et une descrition basse.</p>
+
+<ul>
+  <li><b>Balise &lt;!--more--&gt;</b></li>
+</ul>
+<code>description réduite &lt;!--more--&gt; description détaillée</code>
+<p>Seule la description réduite sera affichée pour la présentation de la catégorie.
+Sur la catégorie elle-même, la description sera la description réduite + la description détaillée.</p>
+
+<ul>
+  <li><b>Balise &lt;!--complete--&gt;</b></li>
+</ul>
+<code>description réduite &lt;!--complete--&gt; description détaillée</code>
+<p>Seule la description réduite sera affichée pour la présentation de la catégorie.
+Par contre, sur la catégorie elle-même, la description sera uniquement la description détaillée, soit 2 descriptions différentes.</p>
+
+<ul>
+  <li><b>Balise &lt;!--up-down--&gt;</b></li>
+</ul>
+<code>description haute &lt;!--up-down--&gt; description basse</code>
+<p>Seule la description haute sera affichée pour la présentation de la catégorie.
+Sur la catégorie elle-même, la description haute sera affichée au-dessus des miniatures, alors que la description basse sera affichée au-dessous (à l'emplacement normal de la description).</p>
+
+
+<h3>Insérer une catégorie ou une image</h3>
+
+<ul>
+  <li><b>Balise [cat=xx]</b></li>
+</ul>
+<p>Cette balise permet d'insérer une catégorie dans la description, avec xx le numéro de la catégorie</p>
+
+<ul>
+  <li><b>Balise [img=xx1 xx2 xx3 xxN;yyyy;name]</b></li>
+</ul>
+<p>Cette balise permet d'insérer une ou plusieurs vignettes dans la description, avec :<br><br>
+- xx le numéro de l'image ; il est possible de préciser le numéro de la catégorie mère après le numéro : <code>xx.ccc</code>.<br/>
+<br/>
+- yyyy (facultatif) prend soit la valeur <i>left</i>, soit la valeur <i>right</i> et permet de positionner la vignette de l'image sur la droite ou la gauche.
+<br/>
+- name (facultatif) : s'il est précisé, le nom de la photo sera affiché sous la vignette.</p>
+
+<h3>Masquer une catégorie</h3>
+
+<p>On met la balise <b>&lt;!--hidden--&gt;</b> dans le nom de la catégorie:<br>
+<br>
+- celle-ci ne sera plus affichée sur la page de la catégorie parente<br>
+- elle reste visible dans le menu des catégories</p>
+
+<h3>Masquer une catégorie dans le menu</h3>
+
+<p>On met la balise <b>&lt;!--mb-hidden--&gt;</b> dans le nom de la catégorie:<br>
+<br>
+- celle-ci ne sera plus affichée dans le menu des catégories<br>
+- elle reste visible sur la page de la catégorie parente</p>
+
+<h3>Masquer une image</h3>
+
+<p>On met la balise <b>&lt;!--hidden--&gt;</b> dans le nom de l'image :<br>
+<br>
+- celle-ci ne sera plus affichée sur la page des vignettes<br>
+- elle reste néanmoins visible au sein de la catégorie</p>
Index: /extensions/ExtendedDescription/language/fr_FR/index.php
===================================================================
--- /extensions/ExtendedDescription/language/fr_FR/index.php	(revision 3294)
+++ /extensions/ExtendedDescription/language/fr_FR/index.php	(revision 3294)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program 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      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ExtendedDescription/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/fr_FR/plugin.lang.php	(revision 3294)
+++ /extensions/ExtendedDescription/language/fr_FR/plugin.lang.php	(revision 3294)
@@ -0,0 +1,5 @@
+<?php
+
+$lang['ExtendedDesc_help'] = 'Utiliser les balises d\'Extended Description...';
+
+?>
Index: /extensions/ExtendedDescription/language/index.php
===================================================================
--- /extensions/ExtendedDescription/language/index.php	(revision 3294)
+++ /extensions/ExtendedDescription/language/index.php	(revision 3294)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program 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      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ExtendedDescription/main.inc.php
===================================================================
--- /extensions/ExtendedDescription/main.inc.php	(revision 3294)
+++ /extensions/ExtendedDescription/main.inc.php	(revision 3294)
@@ -0,0 +1,343 @@
+<?php
+/*
+Plugin Name: Extended Description
+Version: 2.0.f
+Description: Add multilinguale descriptions, banner, NMB, category name, etc...
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=175
+Author: P@t & Grum
+
+--------------------------------------------------------------------------------
+ history
+
+| date       | release |                                                       
+|            | 2.0.c   | P@t
+| 2009-04-01 | 2.0.d   | Grum 
+|            |         | * bug corrected, markup <!--hidden--> now works again 
+|            |         |   on categories name
+|            |         | * new functionality, can use a markup <!--hidden-->  
+|            |         |   on image's name
+|            |         | * new functionality, add a new parameter for the image   
+|            |         |   markup [img=] ; possibility to show the image name 
+|            |         |   with the "name" parameter
+|            |         | * new functionality, the image markup [img=] allows now 
+|            |         |   to display more than one image
+| 2009-04-30 | 2.0.e   | P@t
+|            |         | * bug corrected, avoid errors on categories pages when
+|            |         |   $conf['show_thumbnail_caption'] = false
+| 2009-05-10 | 2.0.f   | P@t
+|            |         | * add possibility to remove a category from menubar
+|            |         |   with markup <!--mb-hidden-->
+|            |         | 
+
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+define('EXTENDED_DESC_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
+load_language('plugin.lang', EXTENDED_DESC_PATH);
+
+global $conf;
+
+$extdesc_conf = array(
+  'more'           => '<!--more-->',
+  'complete'       => '<!--complete-->',
+  'up-down'        => '<!--up-down-->',
+  'not_visible'    => '<!--hidden-->',
+  'mb_not_visible' => '<!--mb-hidden-->'
+);
+
+$conf['ExtendedDescription'] = isset($conf['ExtendedDescription']) ?
+  array_merge($extdesc_conf, $conf['ExtendedDescription']) :
+  $extdesc_conf;
+
+
+// Traite les balises [lang=xx]
+function get_user_language_desc($desc)
+{
+	global $user;
+  
+	$user_lang = substr($user['language'], 0, 2);
+
+	if (!substr_count(strtolower($desc), '[lang=' . $user_lang . ']'))
+	{
+		$user_lang = 'default';
+  }
+  
+  if (substr_count(strtolower($desc), '[lang=' . $user_lang . ']'))
+	{
+    // la balise avec la langue de l'utilisateur a été trouvée
+    $patterns[] = '#(^|\[/lang\])(.*?)(\[lang=(' . $user_lang . '|all)\]|$)#is';
+    $replacements[] = '';
+    $patterns[] = '#\[lang=(' . $user_lang . '|all)\](.*?)\[/lang\]#is';
+    $replacements[] = '\\1';
+  }
+  else
+  {
+    // la balise avec la langue de l'utilisateur n'a pas été trouvée
+    // On prend tout ce qui est hors balise
+    $patterns[] = '#\[lang=all\](.*?)\[/lang\]#is';
+    $replacements[] = '\\1';
+    $patterns[] = '#\[lang=.*\].*\[/lang\]#is';
+    $replacements[] = '';
+  }
+  return preg_replace($patterns, $replacements, $desc);
+}
+
+// Traite les autres balises
+function get_extended_desc($desc, $param='')
+{
+	global $conf;
+  
+  $desc = get_user_language_desc($desc);
+  
+  // Balises [cat=xx]
+  $patterns[] = '#\[cat=(\d*)\]#ie';
+  $replacements[] = ($param == 'subcatify_category_description') ? '' : 'get_cat_thumb("$1")';
+  
+  // Balises [img=xx.yy,xx.yy,xx.yy;float;name]
+  //$patterns[] = '#\[img=(\d*)\.?(\d*|);?(left|right|);?(name|)\]#ie';
+  $patterns[] = '#\[img=([\d\s\.]*);?(left|right|);?(name|)\]#ie';
+  $replacements[] = ($param == 'subcatify_category_description') ? '' : 'get_img_thumb("$1", "$2", "$3")';
+
+  
+  // Balises <!--complete-->, <!--more--> et <!--up-down-->
+	switch ($param)
+	{
+		case 'subcatify_category_description' :
+      $patterns[] = '#^(.*?)('. preg_quote($conf['ExtendedDescription']['complete']) . '|' . preg_quote($conf['ExtendedDescription']['more']) . '|' . preg_quote($conf['ExtendedDescription']['up-down']) . ').*$#is';
+      $replacements[] = '$1';
+      $desc = preg_replace($patterns, $replacements, $desc);
+      break;
+			
+    case 'main_page_category_description' :
+      $patterns[] = '#^.*' . preg_quote($conf['ExtendedDescription']['complete']) . '|' . preg_quote($conf['ExtendedDescription']['more']) . '#is';
+      $replacements[] = '';
+      $desc = preg_replace($patterns, $replacements, $desc);
+      if (substr_count($desc, $conf['ExtendedDescription']['up-down']))
+      {
+        list($conf['ExtendedDescription']['top_comment'], $desc) = explode($conf['ExtendedDescription']['up-down'], $desc);
+        add_event_handler('loc_end_index', 'add_top_description');
+      }
+      break;
+      
+    default:
+      $desc = preg_replace($patterns, $replacements, $desc);
+	}
+
+  return $desc;
+}
+
+function extended_desc_mail_group_assign_vars($assign_vars)
+{
+	if (isset($assign_vars['CPL_CONTENT']))
+	{
+		$assign_vars['CPL_CONTENT'] = get_extended_desc($assign_vars['CPL_CONTENT']);
+	}
+	return $assign_vars;
+}
+
+// Add top description
+function add_top_description()
+{
+  global $template, $conf;
+  $template->concat('PLUGIN_INDEX_CONTENT_BEGIN', '
+    <div class="additional_info">
+    ' . $conf['ExtendedDescription']['top_comment'] . '
+    </div>');
+}
+
+// Remove a category
+function ext_remove_cat($tpl_var, $categories)
+{
+  global $conf;
+
+  $i=0;
+  while($i<count($tpl_var))
+  {
+    if (substr_count($tpl_var[$i]['NAME'], $conf['ExtendedDescription']['not_visible']))
+    {
+      array_splice($tpl_var, $i, 1);
+    }
+    else
+    {
+      $i++;
+    }
+  }
+
+  return $tpl_var;
+}
+
+// Remove a category from menubar
+function ext_remove_menubar_cats($where)
+{
+  global $conf;
+
+  $query = 'SELECT id, uppercats
+    FROM '.CATEGORIES_TABLE.'
+    WHERE name LIKE "%'.$conf['ExtendedDescription']['mb_not_visible'].'%"';
+
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_assoc($result))
+  {
+    $ids[] = $row['id'];
+    $where .= '
+      AND uppercats NOT LIKE "'.$row['uppercats'].',%"';
+  }
+  if (!empty($ids))
+  {
+    $where .= '
+      AND id NOT IN ('.implode(',', $ids).')';
+  }
+  return $where;
+}
+
+// Remove an image
+function ext_remove_image($tpl_var, $pictures)
+{
+  global $conf;
+
+  $i=0;
+  while($i<count($tpl_var))
+  {
+    if (substr_count($pictures[$i]['name'], $conf['ExtendedDescription']['not_visible']))
+    {
+      array_splice($tpl_var, $i, 1);
+      array_splice($pictures, $i, 1);
+    }
+    else
+    {
+      $i++;
+    }
+  }
+
+  return $tpl_var;
+}
+
+// Return html code for  caterogy thumb
+function get_cat_thumb($elem_id)
+{
+  global $template;
+
+  $query = 'SELECT cat.id, cat.name, cat.comment, cat.representative_picture_id, cat.permalink,
+            uc.nb_images, uc.count_images, uc.count_categories,
+            img.path, img.tn_ext
+            FROM ' . CATEGORIES_TABLE . ' AS cat
+            INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' as uc
+            INNER JOIN ' . IMAGES_TABLE . ' AS img
+            ON cat.id = uc.cat_id
+            AND img.id = cat.representative_picture_id
+            WHERE cat.id = ' . $elem_id . ';';
+  $result = pwg_query($query);
+
+  if($result)
+  {
+    $template->set_filename('extended_description_content', dirname(__FILE__) . '/template/cat.tpl');
+    while($category=mysql_fetch_array($result))
+    {
+      $template->assign(array(
+          'ID'    => $category['id'],
+          'TN_SRC'   => get_thumbnail_url($category),
+          'TN_ALT'   => strip_tags($category['name']),
+          'URL'   => make_index_url(array('category' => $category)),
+          'CAPTION_NB_IMAGES' => get_display_images_count
+                                  (
+                                    $category['nb_images'],
+                                    $category['count_images'],
+                                    $category['count_categories'],
+                                    true,
+                                    '<br />'
+                                  ),
+          'DESCRIPTION' =>
+            trigger_event('render_category_literal_description',
+              trigger_event('render_category_description',
+                @$category['comment'],
+                'subcatify_category_description')),
+          'NAME'  => trigger_event(
+                       'render_category_name',
+                       $category['name'],
+                       'subcatify_category_name'
+                     ),
+        ));
+    }
+    return $template->parse('extended_description_content', true);
+  }
+  return '';
+}
+
+// Return html code for img thumb
+//function get_img_thumb($elem_id, $cat_id='', $align='', $name='')
+function get_img_thumb($elem_ids, $align='', $name='')
+{
+  global $template;
+
+  $ids=explode(" ",$elem_ids);
+  $assoc = array();
+  foreach($ids as $key=>$val)
+  {    
+    list($a,$b)=array_pad(explode(".",$val),2,"");
+    $assoc[0][]=$a;
+    $assoc[1][]=$b;
+  }
+
+  $query = 'SELECT * FROM ' . IMAGES_TABLE . ' WHERE id in (' . implode(",",$assoc[0]). ');';
+  $result = pwg_query($query);
+  
+  if($result)
+  {
+    $template->set_filename('extended_description_content', dirname(__FILE__) . '/template/img.tpl');
+
+    $imglist=array();
+    while ($picture = mysql_fetch_array($result))
+    {
+      $imglist[$picture["id"]]=$picture;
+    }
+
+    $img=array();
+    for($i=0;$i<count($assoc[0]);$i++)
+    {
+      if (!empty($assoc[1][$i]))
+      {
+        $url = make_picture_url(array(
+          'image_id' => $imglist[$assoc[0][$i]]['id'],
+          'category' => array(
+            'id' => $assoc[1][$i],
+            'name' => '',
+            'permalink' => '')));
+      }
+      else
+      {
+        $url = make_picture_url(array('image_id' => $imglist[$assoc[0][$i]]['id']));
+      }
+
+      $img[]=array(
+          'IMAGE'       => get_thumbnail_url($imglist[$assoc[0][$i]]),
+          'IMAGE_ALT'   => $imglist[$assoc[0][$i]]['file'],
+          'IMG_TITLE'   => get_thumbnail_title($imglist[$assoc[0][$i]]),
+          'U_IMG_LINK'  => $url,
+          'LEGEND'  => ($name!="")?$imglist[$assoc[0][$i]]['name']:"",
+          'FLOAT' => !empty($align) ? 'float: ' . $align . ';' : '',
+          'COMMENT' => $imglist[$assoc[0][$i]]['file']);
+      
+
+    }
+     $template->assign('img', $img);
+    return $template->parse('extended_description_content', true);
+  }
+  return '';
+}
+
+
+if (script_basename() == 'admin' or script_basename() == 'popuphelp')
+{
+  include(EXTENDED_DESC_PATH . 'admin.inc.php');
+}
+
+add_event_handler ('render_page_banner', 'get_user_language_desc');
+add_event_handler ('render_category_name', 'get_user_language_desc');
+add_event_handler ('render_category_description', 'get_extended_desc', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+add_event_handler ('render_element_description', 'get_extended_desc');
+add_event_handler ('nbm_render_user_customize_mail_content', 'get_extended_desc');
+add_event_handler ('mail_group_assign_vars', 'extended_desc_mail_group_assign_vars');
+add_event_handler ('loc_end_index_category_thumbnails', 'ext_remove_cat', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+add_event_handler ('loc_end_index_thumbnails', 'ext_remove_image', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+add_event_handler ('get_categories_menu_sql_where', 'ext_remove_menubar_cats');
+?>
Index: /extensions/ExtendedDescription/template/add_popup.tpl
===================================================================
--- /extensions/ExtendedDescription/template/add_popup.tpl	(revision 3294)
+++ /extensions/ExtendedDescription/template/add_popup.tpl	(revision 3294)
@@ -0,0 +1,26 @@
+<script type="text/javascript">
+pop = '<a href="./popuphelp.php?page=extended_desc" onclick="popuphelp(this.href); return false;" title="{'ExtendedDesc_help'|@translate|@escape:'javascript'}" style="vertical-align: middle; border: 0; margin: 0.5em;"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png" class="button" alt="{'ExtendedDesc_help'|@translate|@escape:'javascript'}"></a>';
+{if $ed_page == 'cat_modify'}
+comment = jQuery("td:has(textarea[name=\'comment\'])").html();
+mail_content = jQuery("td:has(textarea[name=\'mail_content\'])").html();
+jQuery("td:has(textarea[name=\'comment\'])").html(comment + pop);
+jQuery("td:has(textarea[name=\'mail_content\'])").html(mail_content + pop);
+jQuery("td:has(input[name=\'name\'])").html('<textarea cols="50" rows="2" name="name" id="name" class="description" style="height: 2em">' + '{$CAT_NAME|@escape:'javascript'}' + '</textarea>' + pop);
+{/if}
+{if $ed_page == 'picture_modify'}
+name = jQuery("td:has(input[name=\'name\'])").html();
+desc = jQuery("td:has(textarea[name=\'description\'])").html();
+jQuery("td:has(input[name=\'name\'])").html(name + pop);
+jQuery("td:has(textarea[name=\'description\'])").html(desc + pop);
+{/if}
+{if $ed_page == 'configuration'}
+page_banner = jQuery("li:has(textarea[name=\'page_banner\'])").html();
+jQuery("li:has(textarea[name=\'page_banner\'])").html(page_banner + pop);
+{/if}
+{if $ed_page == 'notification_by_mail'}
+nbm_complementary_mail_content = jQuery("td:has(textarea[name=\'nbm_complementary_mail_content\'])").html();
+send_customize_mail_content = jQuery("td:has(textarea[name=\'send_customize_mail_content\'])").html();
+jQuery("td:has(textarea[name=\'nbm_complementary_mail_content\'])").html(nbm_complementary_mail_content + pop);
+jQuery("td:has(textarea[name=\'send_customize_mail_content\'])").html(send_customize_mail_content + pop);
+{/if}
+</script>
Index: /extensions/ExtendedDescription/template/cat.tpl
===================================================================
--- /extensions/ExtendedDescription/template/cat.tpl	(revision 3294)
+++ /extensions/ExtendedDescription/template/cat.tpl	(revision 3294)
@@ -0,0 +1,25 @@
+<ul class="thumbnailCategories">
+	<li style="width: 99.5%;">
+		<div class="thumbnailCategory">
+			<div class="illustration">
+			<a href="{$URL}">
+				<img src="{$TN_SRC}" alt="{$TN_ALT}" title="{'hint_category'|@translate}">
+			</a>
+			</div>
+			<div class="description">
+				<h3>
+					<a href="{$URL}">{$NAME}</a>
+				</h3>
+        <div class="text" style="text-align: left;">
+  				{if isset($INFO_DATES) }
+  				<p class="dates">{$INFO_DATES}</p>
+  				{/if}
+  				<p class="Nb_images">{$CAPTION_NB_IMAGES}</p>
+  				{if not empty($DESCRIPTION)}
+  				<p>{$DESCRIPTION}</p>
+  				{/if}
+        </div>
+			</div>
+		</div>
+	</li>
+</ul>
Index: /extensions/ExtendedDescription/template/img.tpl
===================================================================
--- /extensions/ExtendedDescription/template/img.tpl	(revision 3294)
+++ /extensions/ExtendedDescription/template/img.tpl	(revision 3294)
@@ -0,0 +1,16 @@
+<ul class="thumbnails" style="margin:4px;display:inline;text-align:none;{$FLOAT}">
+  {foreach from=$img key=name item=data}
+  <li>
+    <span class="wrap1">
+      <span class="wrap2">
+        <a href="{$data.U_IMG_LINK}">
+            <img class="thumbnail" src="{$data.IMAGE}" alt="{$data.IMAGE_ALT}" title="{$data.IMG_TITLE}">
+        </a>
+      </span>
+    {if $data.LEGEND!=""}
+      <span class="thumbLegend">{$data.LEGEND}</span>
+    {/if}
+    </span>
+  </li>
+  {/foreach}
+</ul>
Index: /extensions/ExtendedDescription/template/index.php
===================================================================
--- /extensions/ExtendedDescription/template/index.php	(revision 3294)
+++ /extensions/ExtendedDescription/template/index.php	(revision 3294)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program 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      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
