Index: extensions/Image_For_All/admin/img_admin.php
===================================================================
--- extensions/Image_For_All/admin/img_admin.php	(revision 3437)
+++ extensions/Image_For_All/admin/img_admin.php	(revision 3437)
@@ -0,0 +1,117 @@
+<?php
+
+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+load_language('plugin.lang', IMG_PATH);
+
+include_once(PHPWG_ROOT_PATH.'include/functions_user.inc.php');
+
+
+
+$conf_imageforall= explode("," , $conf['imageforall']);
+
+$template->assign(array('CURRENT' => $conf_imageforall[0],)); 
+
+
+
+
+
+$query = 'SELECT COUNT(DISTINCT(image_id)) FROM '.IMAGE_CATEGORY_TABLE.';';
+
+$result = pwg_query($query) ;
+
+
+
+$total_img = mysql_fetch_row($result);
+
+
+
+if (isset($_POST['insert_nb_tot'])){
+
+$template->assign(
+
+  array(
+
+    'NEW_EXPRESS' => $_POST['new_form'].'{NB_TOTAL}',		
+
+    ));
+
+}
+
+
+
+if (isset($_POST['insert_nb_access'])){
+
+$template->assign(
+
+  array(
+
+    'NEW_EXPRESS' => $_POST['new_form'].'{NB_PICTURE}',		
+
+    ));
+
+}
+
+
+
+
+
+if (isset($_POST['insert_default'])){
+
+$template->assign(
+
+  array(
+
+    'NEW_EXPRESS' => '{NB_PICTURE} images / {NB_TOTAL} images',		
+
+    ));
+
+} 
+
+    
+
+if (isset($_POST['submit']) and !empty($_POST['new_form']) and !is_adviser())
+
+{
+
+
+
+ $query = '
+
+    UPDATE '.CONFIG_TABLE.'
+
+    SET value="'.$_POST['new_form'].'"
+
+    WHERE param="imageforall"
+
+    LIMIT 1';
+
+  pwg_query($query);
+
+  
+
+$template->assign(array('CURRENT' => $_POST['new_form'],)); 
+
+  
+
+array_push(
+
+     $page['infos'],
+
+     sprintf(l10n('new_express_saved'))
+
+          );
+
+}
+
+
+
+$template->set_filenames(array('plugin_admin_content' => realpath(IMG_PATH . 'admin/img_admin.tpl')));
+
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+
+
+?>
Index: extensions/Image_For_All/admin/img_admin.tpl
===================================================================
--- extensions/Image_For_All/admin/img_admin.tpl	(revision 3437)
+++ extensions/Image_For_All/admin/img_admin.tpl	(revision 3437)
@@ -0,0 +1,112 @@
+{known_script id="jquery.dimensions" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.dimensions.packed.js"}
+
+{known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.cluetip.packed.js"}
+
+{known_script id="jquery.growfield" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.growfield.packed.js"}
+
+
+
+<script type="text/javascript">
+
+jQuery().ready(function(){ldelim}
+
+  jQuery('.cluetip').cluetip({ldelim}
+
+    width: 400,
+
+    splitTitle: '|'
+
+  });
+
+  jQuery("textarea").growfield({ldelim}
+
+    animate: false
+
+  });
+
+});
+
+</script>
+
+
+
+<div class="titrePage">
+
+<h2>{'img_title'|translate}</h2>
+
+</div>
+
+
+
+  <span>{'Howto'|translate}</span>
+
+  
+
+<form method="post" action="" class="properties"  ENCTYPE="multipart/form-data"> 
+
+<fieldset>
+
+    <legend>{'Edit expression'|translate}</legend>
+
+   
+
+	   <table>
+
+	    <tr>
+
+	    <td align="left">{'Current expression'|@translate}&nbsp;
+
+			{$CURRENT}
+
+		</td>
+
+		</tr>
+
+
+
+		<tr>	
+
+		 <td>{'New Expression'|@translate}&nbsp;&nbsp;</td> 
+
+	     <td>
+
+		</tr>
+
+
+
+	    	<tr>
+
+			 <td>
+
+			  <input class="submit" type="submit" name="insert_nb_access" value="{'Insert Nb acces'|@translate}"/>
+
+			  <input class="submit" type="submit" name="insert_nb_tot" value="{'Insert Nb total'|@translate}"/>
+
+		      </td>
+
+           </tr>
+
+		   
+
+		<tr>	
+
+	      <td>
+
+	      <input type="text" name="new_form" size="88" value="{$NEW_EXPRESS}"/>
+
+	      <input class="submit" type="submit" name="insert_default" value="{'Insert_default'|@translate}"/>
+
+	      </td>
+
+        </tr>   
+
+       </table>
+
+   
+
+        <p><input class="submit" type="submit" name="submit" value="{'Submit'|@translate}"/></p>
+
+</fieldset>
+
+</form>
+
Index: extensions/Image_For_All/admin/index.php
===================================================================
--- extensions/Image_For_All/admin/index.php	(revision 3437)
+++ extensions/Image_For_All/admin/index.php	(revision 3437)
@@ -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/Image_For_All/language/en_UK/index.php
===================================================================
--- extensions/Image_For_All/language/en_UK/index.php	(revision 3437)
+++ extensions/Image_For_All/language/en_UK/index.php	(revision 3437)
@@ -0,0 +1,66 @@
+<?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/Image_For_All/language/en_UK/plugin.lang.php
===================================================================
--- extensions/Image_For_All/language/en_UK/plugin.lang.php	(revision 3437)
+++ extensions/Image_For_All/language/en_UK/plugin.lang.php	(revision 3437)
@@ -0,0 +1,23 @@
+<?php
+
+
+
+$lang['Howto'] = 'This plugin allow to change menubar expression of number of image available in your Gallery. By Default it is fixed to xxx images / XXX images.';
+
+$lang['Edit expression'] = 'Edit';
+
+$lang['Current expression'] = 'Current expression :';
+
+$lang['New Expression'] = 'New Expression :';
+
+$lang['Insert Nb total'] = 'Insert total number of images of the Gallery';
+
+$lang['Insert Nb acces'] = 'Inserer number of images authorized';
+
+$lang['new_express_saved'] = 'New expression saved';
+
+$lang['Insert_default'] = 'Default expression';
+
+
+
+?>
Index: extensions/Image_For_All/language/es_ES/index.php
===================================================================
--- extensions/Image_For_All/language/es_ES/index.php	(revision 3437)
+++ extensions/Image_For_All/language/es_ES/index.php	(revision 3437)
@@ -0,0 +1,66 @@
+<?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/Image_For_All/language/es_ES/plugin.lang.php
===================================================================
--- extensions/Image_For_All/language/es_ES/plugin.lang.php	(revision 3437)
+++ extensions/Image_For_All/language/es_ES/plugin.lang.php	(revision 3437)
@@ -0,0 +1,27 @@
+<?php
+
+
+
+$lang['Howto'] = 'Este plugin permite cambiar la expresión en el menubar del número de imágenes de su Galería.<br /> 
+
+Es fijada por defecto a xxx imágenes / XXX imágenes.<br /> 
+
+Usted puede modificar la expresión como usted quiere, en inserant los números totales de imágenes y autorizadas donde usted quiere.';
+
+$lang['Edit expression'] = 'Editar';
+
+$lang['Current expression'] = 'Expresión actual :';
+
+$lang['New Expression'] = 'Nueva formulación :';
+
+$lang['Insert Nb total'] = 'Inserer el número total de imágenes de la Galería';
+
+$lang['Insert Nb acces'] = 'Inserer el número de imágenes autorizadas';
+
+$lang['new_express_saved'] = 'Nueva expresión registrada';
+
+$lang['Insert_default'] = 'Expresión original';
+
+
+
+?>
Index: extensions/Image_For_All/language/fr_FR/index.php
===================================================================
--- extensions/Image_For_All/language/fr_FR/index.php	(revision 3437)
+++ extensions/Image_For_All/language/fr_FR/index.php	(revision 3437)
@@ -0,0 +1,66 @@
+<?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/Image_For_All/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/Image_For_All/language/fr_FR/plugin.lang.php	(revision 3437)
+++ extensions/Image_For_All/language/fr_FR/plugin.lang.php	(revision 3437)
@@ -0,0 +1,12 @@
+<?php
+$lang['Howto'] = 'Ce plugin permet de changer l\'expression dans le menubar du nombre d\'images de votre Galerie.<br />Elle est fixée par défaut à xx images / XXX images.<br /> 
+Vous pouvez modifier l\'expression comme vous voulez, en inserant les nombres totales d\'images et autorisées où vous voulez.';
+$lang['Edit expression'] = 'Editer';
+$lang['Current expression'] = 'Expression actuelle :';
+$lang['New Expression'] = 'Nouvelle formulation :';
+$lang['Insert Nb total'] = 'Inserer le nombre totale d\'images de la Galerie';
+$lang['Insert Nb acces'] = 'Inserer le nombre d\'images autorisées';
+$lang['new_express_saved'] = 'Nouvelle expression enregistrée';
+$lang['Insert_default'] = 'Expression par défaut';
+$lang['img_title'] = 'Image For All';
+?>
Index: extensions/Image_For_All/language/index.php
===================================================================
--- extensions/Image_For_All/language/index.php	(revision 3437)
+++ extensions/Image_For_All/language/index.php	(revision 3437)
@@ -0,0 +1,66 @@
+<?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/Image_For_All/main.inc.php
===================================================================
--- extensions/Image_For_All/main.inc.php	(revision 3437)
+++ extensions/Image_For_All/main.inc.php	(revision 3437)
@@ -0,0 +1,93 @@
+<?php
+
+/*
+
+Plugin Name: ImageForAll
+
+Version: 2.0.b
+
+Description: Allow to show total number of images for everyone.
+
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=167
+
+Author: Sakkhho
+
+Author URI: http://piwigo.org
+
+*/
+
+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+define('IMG_DIR' , basename(dirname(__FILE__)));
+
+define('IMG_PATH' , PHPWG_PLUGINS_PATH . IMG_DIR . '/');
+
+
+
+function img_for_all_admin_menu($menu)
+
+{
+
+    array_push($menu, array('NAME' => 'ImageForAll',
+
+            'URL' => get_admin_plugin_menu_link(IMG_PATH . 'admin/img_admin.php')));
+
+    return $menu;
+
+}
+
+
+
+function img_for_all_replace_tpl_code($menu_ref_arr)
+
+{
+
+  global $conf, $lang ;
+
+ 
+
+  $menu = & $menu_ref_arr[0];
+
+  $block = $menu->get_block('mbCategories');
+
+  $nb_images = $block->data['NB_PICTURE'];
+
+ 
+
+  $query = 'SELECT COUNT(DISTINCT(image_id)) FROM '.IMAGE_CATEGORY_TABLE.';';
+
+  $result = pwg_query($query) ;
+
+  list($total_img) = mysql_fetch_row($result);
+
+
+
+  $img_for_all = str_replace(
+
+    array('{NB_PICTURE}', '{NB_TOTAL}'),
+
+    array($nb_images, $total_img),
+
+    $conf['imageforall']);
+
+ 
+
+  $block->data['IMG_FOR_ALL'] = $img_for_all;
+
+  $block->template = dirname(__FILE__) . '/menubar_categories.tpl';
+
+}
+
+
+
+
+
+add_event_handler('get_admin_plugin_menu_links', 'img_for_all_admin_menu');
+
+add_event_handler('blockmanager_apply', 'img_for_all_replace_tpl_code');
+
+
+
+?>
Index: extensions/Image_For_All/maintain.inc.php
===================================================================
--- extensions/Image_For_All/maintain.inc.php	(revision 3437)
+++ extensions/Image_For_All/maintain.inc.php	(revision 3437)
@@ -0,0 +1,33 @@
+<?php
+  function plugin_install()
+  {
+      global $prefixeTable;
+    $q = '
+     INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+      VALUES ("imageforall","{NB_PICTURE} images / {NB_TOTAL} images","Parameters of ImageForAll plugin");
+    ';
+     
+    pwg_query($q);
+
+
+  }
+
+  function plugin_uninstall()
+
+  {
+
+    global $prefixeTable;
+
+      $q = '
+
+        DELETE FROM '.CONFIG_TABLE.'
+
+        WHERE param="imageforall" LIMIT 1;
+
+      ';
+
+   
+
+      pwg_query($q);
+    }  
+?>
Index: extensions/Image_For_All/menubar_categories.tpl
===================================================================
--- extensions/Image_For_All/menubar_categories.tpl	(revision 3437)
+++ extensions/Image_For_All/menubar_categories.tpl	(revision 3437)
@@ -0,0 +1,21 @@
+<dt>
+  {if isset($U_START_FILTER)}
+  <a href="{$U_START_FILTER}" title="{'start_filter_hint'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/start_filter.png" class="button" alt="start filter"></a>
+  {/if}
+  {if isset($U_STOP_FILTER)}
+  <a href="{$U_STOP_FILTER}" title="{'stop_filter_hint'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/stop_filter.png" class="button" alt="stop filter"></a>
+  {/if}
+	<a href="{$block->data.U_CATEGORIES}">{'Categories'|@translate}</a>
+</dt>
+<dd>
+	{$block->data.MENU_CATEGORIES_CONTENT}
+	{if isset($block->data.U_UPLOAD)}
+	<ul>
+		<li>
+			<a href="{$block->data.U_UPLOAD}">{'upload_picture'|@translate}</a>
+		</li>
+	</ul>
+	{/if}
+	<p class="totalImages">{$block->data.IMG_FOR_ALL}</p>
+</dd>
+
