Index: /extensions/ExtendedDescription/changelog.txt
===================================================================
--- /extensions/ExtendedDescription/changelog.txt	(revision 8314)
+++ /extensions/ExtendedDescription/changelog.txt	(revision 8314)
@@ -0,0 +1,32 @@
+| 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-->
+|            |         |
+| 2010-25-09 | 2.0.g   | Grum
+|            |         | * possibility to display the picture's name into the
+|            |         |   image title ('titleName' parameter) rather than under
+|            |         |    the picture ('name' parameter)
+|            |         | * add Id for image & anchor for [img=...] markup
+|            |         |
+| 2010-12-27 | 2.1.e   | P@t
+|            |         | * add redirect tag
+|            |         |
Index: /extensions/ExtendedDescription/language/cs_CZ/help.html
===================================================================
--- /extensions/ExtendedDescription/language/cs_CZ/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/cs_CZ/help.html	(revision 8314)
@@ -84,2 +84,25 @@
 - fotografie potom nebude viditelná mezi náhledy<br>
 - ale zůstane viditelná při prohlížení kategorie</p>
+
+<!-- TODO -->
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/cs_CZ/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/cs_CZ/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/cs_CZ/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Používat elementy rozšířeného popisu......';
+/*TODO*/$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/de_DE/help.html
===================================================================
--- /extensions/ExtendedDescription/language/de_DE/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/de_DE/help.html	(revision 8314)
@@ -81,2 +81,25 @@
 - diese wird nicht mehr auf der Vignettenseite angezeigt<br>
 - bleibt weiterhin ersichtlich in der Kategorie</p>
+
+<!-- TODO -->
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/de_DE/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/de_DE/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Benützen der HTML-Tags Extended Description...';
+/*TODO*/$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/en_UK/help.html
===================================================================
--- /extensions/ExtendedDescription/language/en_UK/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/en_UK/help.html	(revision 8314)
@@ -85,2 +85,24 @@
 - it won't be displayed on the thumbnails page<br>
 - it remains visible inside the category</p>
+
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/en_UK/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/en_UK/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Use Extended Description tags...';
+$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/es_ES/help.html
===================================================================
--- /extensions/ExtendedDescription/language/es_ES/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/es_ES/help.html	(revision 8314)
@@ -91,2 +91,25 @@
 - Ésta no será fijada más sobre la página de las viñetas<br>
 - Queda sin embargo visible en el seno de la categoría</p>
+
+<!-- TODO -->
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/es_ES/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/es_ES/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Utilizar las balizas de...';
+/*TODO*/$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/fr_FR/help.html
===================================================================
--- /extensions/ExtendedDescription/language/fr_FR/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/fr_FR/help.html	(revision 8314)
@@ -91,2 +91,24 @@
 - 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>
+
+<h3>Catégorie redirigée</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insérez cette balise dans la description d'une catégorie afin de la rediriger vers l'URL de votre choix.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirige vers une image de votre galerie où xx est l'identifiant de l'image; vous pouvez également préciser l'identifiant de la catégorie après le numéro de l'image: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirige vers une catégorie de votre galerie où xx est l'identifiant de la catégorie.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirige vers une page de recherche de votre galerie où xx est l'identifiant de la page de recherche.</p>
Index: /extensions/ExtendedDescription/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/fr_FR/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/fr_FR/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Utiliser les balises d\'Extended Description...';
+$lang['This category is redirected to %s'] = 'Cette catégorie est redirigée vers %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/hu_HU/help.html
===================================================================
--- /extensions/ExtendedDescription/language/hu_HU/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/hu_HU/help.html	(revision 8314)
@@ -85,2 +85,25 @@
 - nem fog megjelenni a bélyegkép oldalon<br>
 - továbbra is megjelenik a kategóriában</p>
+
+<!-- TODO -->
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/hu_HU/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/hu_HU/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/hu_HU/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Bővített leírás címkék használatával...';
+/*TODO*/$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/it_IT/help.html
===================================================================
--- /extensions/ExtendedDescription/language/it_IT/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/it_IT/help.html	(revision 8314)
@@ -91,2 +91,25 @@
 - L'immagine non viene più visualizzata sulla pagina delle miniature<br>
 - L'immagine rimane visibile nella categoria</p>
+
+<!-- TODO -->
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/it_IT/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/it_IT/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Usare i tag di Extended Description ...';
+/*TODO*/$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/lv_LV/help.html
===================================================================
--- /extensions/ExtendedDescription/language/lv_LV/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/lv_LV/help.html	(revision 8314)
@@ -83,2 +83,25 @@
 - netiks rādīta sīkbilžu lapā<br>
 - paliks redzama iekšpus kategorijas</p>
+
+<!-- TODO -->
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/lv_LV/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/lv_LV/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/lv_LV/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Lietot Paplašinātā Apraksta iezīmes...';
+/*TODO*/$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/sk_SK/help.html
===================================================================
--- /extensions/ExtendedDescription/language/sk_SK/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/sk_SK/help.html	(revision 8314)
@@ -85,2 +85,25 @@
 - nebude zobrazené na stránke náhľadov<br>
 - zostane viditeľné vo vnútri kategórie</p>
+
+<!-- TODO -->
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/sk_SK/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/sk_SK/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/sk_SK/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = 'Použiť rozšírený popis kľúčových slov...';
+/*TODO*/$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/language/zh_CN/help.html
===================================================================
--- /extensions/ExtendedDescription/language/zh_CN/help.html	(revision 8313)
+++ /extensions/ExtendedDescription/language/zh_CN/help.html	(revision 8314)
@@ -82,3 +82,26 @@
 <br>
 - 它将不会在缩略图页面中显示<br>
-- 但它仍可在分类页面里看见</p> 
+- 但它仍可在分类页面里看见</p>
+
+<!-- TODO -->
+<h3>Redirected category</h3>
+
+<ul>
+  <li><b>[redirect http://piwigo.org]</b></li>
+</ul>
+<p>Insert this tag into a category description to redirect it to the URL of your choice.</p>
+
+<ul>
+  <li><b>[redirect img=xx]</b></li>
+</ul>
+<p>Redirect to an image of your gallery where xx is the photo identifier; you can add the category identifier next to the photo identifier: <code>xx.ccc</code>.</p>
+
+<ul>
+  <li><b>[redirect cat=xx]</b></li>
+</ul>
+<p>Redirect to a category of your gallery where xx the category identifier.</p>
+
+<ul>
+  <li><b>[redirect search=xx]</b></li>
+</ul>
+<p>Redirect to a search page of your gallery where xx is the search identifier.</p>
Index: /extensions/ExtendedDescription/language/zh_CN/plugin.lang.php
===================================================================
--- /extensions/ExtendedDescription/language/zh_CN/plugin.lang.php	(revision 8313)
+++ /extensions/ExtendedDescription/language/zh_CN/plugin.lang.php	(revision 8314)
@@ -2,4 +2,5 @@
 
 $lang['ExtendedDesc_help'] = '使用扩展描述标签...';
+/*TODO*/$lang['This category is redirected to %s'] = 'This category is redirected to %s';
 
 ?>
Index: /extensions/ExtendedDescription/main.inc.php
===================================================================
--- /extensions/ExtendedDescription/main.inc.php	(revision 8313)
+++ /extensions/ExtendedDescription/main.inc.php	(revision 8314)
@@ -2,39 +2,8 @@
 /*
 Plugin Name: Extended Description
-Version: 2.0.g
+Version: 2.1.e
 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-->
-| 2010-25-09 | 2.0.g   | Grum
-|            |         | * possibility to display the picture's name into the
-|            |         |   image title ('titleName' parameter) rather than under
-|            |         |    the picture ('name' parameter)
-|            |         | * add Id for image & anchor for [img=...] markup
-|            |         |
-|            |         |
-|            |         |
-
 */
 
@@ -93,7 +62,51 @@
 function get_extended_desc($desc, $param='')
 {
-  global $conf;
+  global $conf, $page;
+
+  if (isset($page['category']) and !isset($page['image_id']) and preg_match('#\[redirect (.*?)\]#i', $desc, $m1))
+  {
+    if (preg_match('#^(img|cat|search)=(\d*)\.?(\d*|)$#i', $m1[1], $m2))
+    {
+      $url  = get_absolute_root_url();
+      switch ($m2[1])
+      {
+        case 'img':
+        $url_params = array('image_id' => $m2[2]);
+        if (!empty($m2[3]))
+        {
+          $url_params['category'] = array('id' => $m2[3], 'name' => '', 'permalink' => '');
+        }
+        $url .= make_picture_url($url_params);
+        break;
+
+        case 'cat':
+        $url_params = array('category' => array('id' => $m2[2], 'name' => '', 'permalink' => ''));
+        $url .= make_index_url($url_params);
+        break;
+
+        case 'search':
+        $url .= make_index_url(array('section' => 'search', 'search' => $m2[2]));
+      }
+    }
+    else
+    {
+      $url = $m1[1];
+    }
+    if (is_admin())
+    {
+      global $header_notes;
+      $header_notes[] = sprintf(l10n('This category is redirected to %s'), '<a href="'.$url.'">'.$url.'</a>');
+    }
+    else
+    {
+      redirect($url);
+    }
+  }
 
   $desc = get_user_language_desc($desc);
+
+  // Remove redirect tags for subcatify_category_description
+  $patterns[] = '#\[redirect .*?\]#i';
+  $replacements[] = ''; 
 
   // Balises [cat=xx]
