Index: /extensions/PWG_Stuffs/admin/add_module.php
===================================================================
--- /extensions/PWG_Stuffs/admin/add_module.php	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/add_module.php	(revision 3300)
@@ -0,0 +1,146 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $template, $conf;
+
+include_once(STUFFS_PATH . 'include/functions.inc.php');
+include_once(STUFFS_PATH . 'admin/functions.inc.php');
+load_language('plugin.lang', STUFFS_PATH);
+
+if (!isset($_GET['type']) or !is_dir(STUFFS_PATH . 'modules/' . $_GET['type']))
+{
+  die('Wrong parameters...');
+}
+else
+{
+  $type = $_GET['type'];
+}
+
+// Cas particulier des News
+if ($type == 'News') include(STUFFS_PATH . 'modules/News/config.inc.php');
+
+// Enregistrement du module
+if (isset($_POST['submit']) and !is_adviser())
+{
+  include(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
+  if (empty($page['errors']))
+  {
+    if (empty($_POST['module_name']))
+    {
+      array_push($page['errors'], l10n('stuffs_no_name'));
+    }
+    else
+    {
+      $module_name = $_POST['module_name'];
+      $desc = (!empty($_POST['module_desc']) ? '"' . $_POST['module_desc'] . '"' : 'NULL');
+      $groups = (!empty($_POST['groups']) ? '"' . implode(',', $_POST['groups']) . '"' : 'NULL');
+      $users = (!empty($_POST['users']) ? '"' . implode(',', $_POST['users']) . '"' : 'NULL');
+      $show_title = isset($_POST['show_title']) ? '"true"' : '"false"';
+      $on_home = isset($_POST['on_home'])  ? '"true"' : '"false"';
+      $on_cats = isset($_POST['on_cats'])  ? '"true"' : '"false"';
+      $on_picture = isset($_POST['on_picture'])  ? '"true"' : '"false"';
+
+			$sav_datas = (!empty($datas) ? '"' . addslashes(serialize($datas)) . '"' : 'NULL');
+
+      if (isset($_GET['edit']))
+      {			
+        pwg_query('
+UPDATE ' . STUFFS_TABLE . '
+SET name ="' . $module_name . '",
+		descr=' . $desc . ',
+		type="' . $type . '",
+		datas=' . $sav_datas . ',
+		users=' . $users . ',
+		groups=' . $groups . ',
+    show_title=' . $show_title .',
+    on_home=' . $on_home .',
+    on_cats=' . $on_cats . ',
+    on_picture='. $on_picture . '
+WHERE id = ' . $_GET['edit'] . ';');
+      }
+      else
+      {
+        $query = 'SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id  FROM ' . STUFFS_TABLE . ' ;';
+        list($next_element_id) = mysql_fetch_array(pwg_query($query));
+
+        $query = 'SELECT MAX(pos)+1 AS next_pos  FROM ' . STUFFS_TABLE . ' ;';
+        list($pos) = mysql_fetch_array(pwg_query($query));
+
+        $query = '
+INSERT INTO ' . STUFFS_TABLE . ' ( id, pos, name, descr, type, datas, users, groups, show_title, on_home, on_cats, on_picture, id_line, width )
+VALUES (' . $next_element_id . ' ,
+	' . $pos . ',
+	"' . $module_name . '",
+	' . $desc . ',
+	"' . $type . '",
+	' . $sav_datas . ',
+	' . $users . ',
+	' . $groups . ',
+  ' . $show_title . ',
+  ' . $on_home . ',
+  ' . $on_cats . ',
+  ' . $on_picture . ',
+  NULL,
+  NULL);';
+        pwg_query($query);
+      }
+
+      redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php');
+    }
+  }
+}
+
+// Récupération des données du module
+if (isset($_GET['edit']))
+{
+  $q = ('SELECT * FROM ' . STUFFS_TABLE . ' WHERE id = ' . $_GET['edit'] . ';');
+  $module = mysql_fetch_array(pwg_query($q));
+
+  $module['users'] = explode(',', $module['users']);
+  $module['groups'] = explode(',', $module['groups']);
+
+  $datas = (!empty($module['datas']) ? unserialize($module['datas']) : false);
+
+  $template->assign(array(
+    'STUFFS_TITLE' => l10n('stuffs_edit_mod') . ' <i>' . trigger_event('render_stuffs_name', $module['name']) . '</i>',
+    'MODULE_NAME' => $module['name'],
+    'DESC_VALUE' => (isset($module['descr']) ? $module['descr'] : ''),
+    'show_title_CHECKED' => ($module['show_title'] == 'true' ? 'checked="checked"' : ''),
+    'on_home_CHECKED' => ($module['on_home'] == 'true' ? 'checked="checked"' : ''),
+    'on_cats_CHECKED' => ($module['on_cats'] == 'true' ? 'checked="checked"' : ''),
+    'on_picture_CHECKED' => ($module['on_picture'] == 'true' ? 'checked="checked"' : '')));
+}
+else
+{
+  $module['users'] = array('guest', 'generic', 'normal', 'admin', 'webmaster');
+  $module['groups'] = array();
+  $template->assign(array(
+    'STUFFS_TITLE' => l10n('stuffs_add_mod'),
+    'MODULE_NAME' => l10n('module_name_' . $type),
+    'show_title_CHECKED' => 'checked="checked"',
+    'on_home_CHECKED' => 'checked="checked"'));
+}
+
+// Selection des utilisateurs
+$template->assign('user_perm', array(
+  'GUEST' => (in_array('guest', $module['users']) ? 'checked="checked"' : ''),
+  'GENERIC' => (in_array('generic', $module['users']) ? 'checked="checked"' : ''),
+  'NORMAL' => (in_array('normal', $module['users']) ? 'checked="checked"' : ''),
+  'ADMIN' => (in_array('admin', $module['users']) ? 'checked="checked"' : ''),
+  'WEBMASTER' => (in_array('webmaster', $module['users']) ? 'checked="checked"' : '')));
+
+// Selection des groupes
+$groups = get_all_groups();
+if (!empty($groups))
+{
+  $template->assign('group_perm', array('GROUPSELECTION' => get_html_groups_selection($groups, 'groups', $module['groups'])));
+}
+
+// Configuration du module
+include_once(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/add_module.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+?>
Index: /extensions/PWG_Stuffs/admin/admin.php
===================================================================
--- /extensions/PWG_Stuffs/admin/admin.php	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/admin.php	(revision 3300)
@@ -0,0 +1,57 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $template, $conf, $user;
+
+load_language('plugin.lang', STUFFS_PATH);
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+include_once(STUFFS_PATH . 'include/functions.inc.php');
+include_once(STUFFS_PATH . 'admin/functions.inc.php');
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+// +-----------------------------------------------------------------------+
+// |                            Tabsheet
+// +-----------------------------------------------------------------------+
+if (!isset($_GET['tab']))
+    $page['tab'] = 'manage';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('manage',
+               l10n('stuffs_mods_management'),
+               $my_base_url.'&amp;tab=manage');
+$tabsheet->add('new',
+               l10n('stuffs_add_mod'),
+               $my_base_url.'&amp;tab=new');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+//Ajout d'un module
+if (isset($_POST['addModule']) and !is_adviser())
+{
+	if (!isset($_POST['module']))
+  {
+		array_push($page['errors'], l10n('stuffs_error_no_mod_selected'));
+	}
+  else
+  {
+    redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadd_module.php&type=' . $_POST['module']);
+	}
+}
+
+//Suppression d'un module
+if (isset($_GET['del']) and !is_adviser())
+{
+	pwg_query('DELETE FROM ' . STUFFS_TABLE . ' WHERE id = ' . $_GET['del'] . ' LIMIT 1;');
+  redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php');
+}
+
+//Récupération des modules disponibles
+$modules = get_stuffs_modules();
+
+// Include file
+include(STUFFS_PATH.'admin/'.$page['tab'].'.php');
+
+?>
Index: /extensions/PWG_Stuffs/admin/functions.inc.php
===================================================================
--- /extensions/PWG_Stuffs/admin/functions.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/functions.inc.php	(revision 3300)
@@ -0,0 +1,80 @@
+<?php
+
+function get_stuffs_modules()
+{
+	$dir = opendir(STUFFS_PATH . 'modules/');
+    while ($file = readdir($dir)) {
+        if ($file != '.' and $file != '..') {
+            $path = STUFFS_PATH . 'modules/' . $file;
+            if (is_dir($path) and !is_link($path)) {
+                $modules[$file] = array('type' => $file,
+                    'name' => l10n('module_name_' . $file),
+                    'description' => l10n('module_desc_' . $file));
+            }
+        }
+    }
+    closedir($dir);
+    uasort($modules, 'name_compare');
+    return $modules;
+}
+
+function get_html_groups_selection(
+  $groups,
+  $fieldname,
+  $selecteds = array()
+  )
+{
+  global $conf;
+  if (count ($groups) == 0 )
+  {
+    return '';
+  }
+  $output = '<div id="'.$fieldname.'">';
+  $id = 1;
+  foreach ($groups as $group)
+  {
+    $output.=
+
+      '<input type="checkbox" name="'.$fieldname.'[]"'
+      .' id="group_'.$id++.'"'
+      .' value="'.$group['id'].'"'
+      ;
+
+    if (in_array($group['id'], $selecteds))
+    {
+      $output.= ' checked="checked"';
+    }
+
+    $output.=
+      '><label>'
+      .'&nbsp;'. $group['name']
+      .'</label>'
+      ."\n"
+      ;
+  }
+  $output.= '</div>';
+
+  return $output;
+}
+
+
+function get_all_groups()
+{
+$query = '
+SELECT id, name
+  FROM '.GROUPS_TABLE.'
+  ORDER BY name ASC
+;';
+$result = pwg_query($query);
+
+$groups = array();
+  while ($row = mysql_fetch_assoc($result))
+  {
+    array_push($groups, $row);
+  }
+
+  uasort($groups, 'name_compare');
+  return $groups;
+}
+
+?>
Index: /extensions/PWG_Stuffs/admin/index.php
===================================================================
--- /extensions/PWG_Stuffs/admin/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/index.php	(revision 3300)
@@ -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/PWG_Stuffs/admin/manage.php
===================================================================
--- /extensions/PWG_Stuffs/admin/manage.php	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/manage.php	(revision 3300)
@@ -0,0 +1,67 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Enregistrement de l'ordre
+if (isset($_POST['submitOrder']) and !is_adviser())
+{
+  asort($_POST['position'], SORT_NUMERIC);
+  $pos = 1;
+  foreach($_POST['position'] as $id => $old_pos)
+  {
+    $id_line = !empty($_POST['id_line'][$id]) ? '"'.$_POST['id_line'][$id].'"' : 'NULL';
+    $width = (!empty($_POST['width'][$id]) and is_numeric($_POST['width'][$id])) ? '"'.$_POST['width'][$id].'"' : 'NULL';
+
+    pwg_query('
+UPDATE ' . STUFFS_TABLE . '
+SET pos=' . $pos++ . ' , id_line='.$id_line.', width='.$width.'
+WHERE id=' . $id . ' LIMIT 1');
+  }
+  array_push($page['infos'], l10n('stuffs_order_saved'));
+}
+
+// Affichage des modules et de leur position
+$q = 'SELECT id, name, descr, type, id_line, width
+FROM ' . STUFFS_TABLE . '
+ORDER BY pos ASC;';
+$result = pwg_query($q);
+$num = 0;
+$pos = 1;
+$cat_mod = array('name' => l10n('Categories'), 'type' => '-', 'description' => '');
+$id_line_options = array(
+    '' => '-',
+    'A' => 'A',
+    'B' => 'B',
+    'C' => 'C',
+    'D' => 'D',
+    'E' => 'E',
+    'F' => 'F',
+    'G' => 'G',
+    'H' => 'H',
+    'I' => 'I',
+    'J' => 'J');
+
+while ($module = mysql_fetch_assoc($result))
+{
+	$module['name'] = $module['type'] != 'MainBlock' ? $module['name'] : l10n('stuffs_main_block');
+
+  $template->append('modules', array(
+    'ID' => $module['id'],
+    'NAME' => trigger_event('render_stuffs_name', $module['name']),
+    'DESC' => $module['descr'],
+    'TYPE' => $module['type'],
+    'TYPE_NAME' => (isset($modules[$module['type']]['name']) ? $modules[$module['type']]['name'] : ''),
+    'POS' => 10 * $pos++,
+    'ID_LINE_OPTIONS' => $id_line_options,
+    'ID_LINE_SELECTED' => $module['id_line'],
+		'WIDTH' => $module['width'],
+		'ID' => $module['id'],
+    'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . STUFFS_DIR . '%2Fadmin%2Fadd_module.php&amp;type=' . $module['type'] . '&amp;edit=' . $module['id'],
+    'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&amp;del=' . $module['id'] : '',
+  ));
+}
+
+$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+?>
Index: /extensions/PWG_Stuffs/admin/new.php
===================================================================
--- /extensions/PWG_Stuffs/admin/new.php	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/new.php	(revision 3300)
@@ -0,0 +1,16 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Affichages des modules à ajouter
+foreach($modules as $module)
+{
+	$template->append('add_module', array(
+    'MODULE' => $module['type'],
+    'NAME' => $module['name'],
+		'DESC' => $module['description']));
+}
+
+$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/new.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/PWG_Stuffs/admin/template/add_module.tpl
===================================================================
--- /extensions/PWG_Stuffs/admin/template/add_module.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/template/add_module.tpl	(revision 3300)
@@ -0,0 +1,92 @@
+{include file='include/autosize.inc.tpl'}
+
+{$TINYMCE_SCRIPT}
+
+<div class="titrePage">
+  <h2>PWG Stuffs - {$STUFFS_TITLE}</h2>
+</div>
+
+<form method="post" action="" class="properties"  ENCTYPE="multipart/form-data">
+
+<fieldset>
+	<legend>{'stuffs_module_config'|@translate}</legend>
+	<table>
+
+		<tr><td colspan="3"><br></td></tr>
+
+		<tr>
+			<td><b>{'stuffs_module_title'|@translate}&nbsp;&nbsp;</b></td>
+			<td colspan="2"><textarea cols="50" rows="2" name="module_name" id="module_name" class="description" style="height: 2em">{$MODULE_NAME}</textarea></td>
+		</tr>
+
+		<tr><td colspan="3"><br></td></tr>
+
+		<tr>
+			<td><b>{'stuffs_desc'|@translate}&nbsp;&nbsp;</b></td>
+			<td colspan="2"><input type="text" size="65" maxlength="255" value="{$DESC_VALUE}" name="module_desc"/></td>
+		</tr>
+		<tr>
+			<td></td>
+			<td colspan="2">{'stuffs_only_for_admin'|@translate}</td>
+		</tr>
+
+		<tr><td colspan="3"><br></td></tr>
+		<tr>
+			<td><b>{'stuffs_authorized_users'|@translate} &nbsp;&nbsp;</b></td>
+			<td colspan="2">
+				<div id="users">
+				<input type="checkbox" name="users[]" id="guest" value="guest" {$user_perm.GUEST}><label>&nbsp;{'user_status_guest'|@translate}</label>
+				<input type="checkbox" name="users[]" id="generic" value="generic" {$user_perm.GENERIC}><label>&nbsp;{'user_status_generic'|@translate}</label>
+				<input type="checkbox" name="users[]" id="normal" value="normal" {$user_perm.NORMAL}><label>&nbsp;{'user_status_normal'|@translate}</label>
+				<input type="checkbox" name="users[]" id="admin" value="admin" {$user_perm.ADMIN}><label>&nbsp;{'user_status_admin'|@translate}</label>
+				<input type="checkbox" name="users[]" id="webmaster" value="webmaster" {$user_perm.WEBMASTER}><label>&nbsp;{'user_status_webmaster'|@translate}</label>
+				</div>
+			</td>
+        </tr>
+
+		{if isset($group_perm)}
+		<tr><td colspan="3"><br></td></tr>
+		<tr>
+			<td><b>{'stuffs_authorized_group'|@translate} &nbsp;&nbsp;</b></td>
+			<td colspan="2">{$group_perm.GROUPSELECTION}</td>
+        </tr>
+        <tr>
+        	<td></td>
+			<td colspan="2"><i>{'stuffs_public_module'|@translate}</i></td>
+        </tr>
+    {/if}
+
+        <tr><td colspan="3"><br></td></tr>
+	</table>
+</fieldset>
+
+<fieldset>
+	<legend>{'stuffs_visual_config'|@translate}</legend>
+	<table>
+		<tr><td colspan="2"><br></td></tr>
+		<tr>
+			<td colspan="2"><input type="checkbox" name="show_title" value="1" {$show_title_CHECKED}>&nbsp;&nbsp;{'stuffs_show_title'|@translate}</td>
+		</tr>
+		<tr><td><br></td></tr>
+		<tr>
+			<td>{'stuffs_show_module_on'|@translate}</td>
+			<td>&nbsp;&nbsp;<input type="checkbox" name="on_home" value="1" {$on_home_CHECKED}>&nbsp;&nbsp;<i>{'stuffs_show_on_home'|@translate}</i></td>
+		</tr>
+		<tr><td></td>
+			<td>&nbsp;&nbsp;<input type="checkbox" name="on_cats" value="1" {$on_cats_CHECKED}>&nbsp;&nbsp;<i>{'stuffs_show_on_cats'|@translate}</i></td>
+		</tr>
+		<tr><td></td>
+			<td>&nbsp;&nbsp;<input type="checkbox" name="on_picture" value="1" {$on_picture_CHECKED}>&nbsp;&nbsp;<i>{'stuffs_show_on_pictures'|@translate}</i></td>
+		</tr>
+		<tr><td colspan="2"><br></td></tr>
+	</table>
+
+
+</fieldset>
+
+<fieldset>
+	<legend>{'stuffs_module_options'|@translate}</legend>
+	{$MODULE_OPTIONS}
+</fieldset>
+<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}/></p>
+</form>
Index: /extensions/PWG_Stuffs/admin/template/manage.tpl
===================================================================
--- /extensions/PWG_Stuffs/admin/template/manage.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/template/manage.tpl	(revision 3300)
@@ -0,0 +1,129 @@
+{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js" }
+{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.sortable.packed.js" }
+
+{html_head}
+{literal}
+<style type="text/css">
+#categoryOrdering li {
+  height: 60px;
+}
+#categoryOrdering p {
+  margin-bottom: 0 !important;
+  margin-top: 0.5em !important;
+}
+.stuffs_line {
+  margin: 0 10px;
+}
+.MainBlock {
+  color: #ff3363;
+}
+</style>
+{/literal}
+{/html_head}
+
+<script type="text/javascript">
+  jQuery().ready(function(){ldelim}
+    jQuery(".catPos").hide();
+    jQuery(".drag_button").show();
+    jQuery(".categoryLi").css("cursor","move");
+    jQuery(".categoryUl").sortable({ldelim}
+      axis: "y",
+      opacity: 0.8
+    });
+    jQuery("#categoryOrdering").submit(function(){ldelim}
+      ar = jQuery('.categoryUl').sortable('toArray');
+      for(i=0;i<ar.length;i++) {ldelim}
+        module = ar[i].split('module_');
+        document.getElementsByName('position[' + module[1] + ']')[0].value = i;
+      }
+    });
+  });
+</script>
+
+<div class="titrePage">
+  <h2>PWG Stuffs</h2>
+</div>
+
+<form id="categoryOrdering" method="post" action="">
+
+	<ul class="categoryUl">
+  {foreach from=$modules item=module}
+
+    <li class="categoryLi virtual_cat" id="module_{$module.ID}">
+      {if $module.TYPE != 'MainBlock'}
+      <ul class="categoryActions">
+        {if $module.TYPE != 'MainBlock'}
+        <li class="stuffs_line">
+          {'stuffs_id_ligne'|@translate}&nbsp;
+          <select name="id_line[{$module.ID}]">
+          {html_options options=$module.ID_LINE_OPTIONS selected=$module.ID_LINE_SELECTED}
+          </select>
+        </li>
+        <li class="stuffs_line">
+          {'stuffs_width'|@translate}&nbsp;
+          <input type="text" size="2" maxlength="2" value="{$module.WIDTH}" name="width[{$module.ID}]" > %
+        </li>
+        {/if}
+        <li><a href="{$module.U_EDIT}" title="{'stuffs_edit'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'stuffs_edit'|@translate}"/></a></li>
+        {if !empty($module.U_DELETE) }
+        <li><a href="{$module.U_DELETE}" title="{'stuffs_delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"><img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'stuffs_delete'|@translate}" /></a></li>
+        {/if}
+      </ul>
+      {/if}
+
+      <p>
+      <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}"/>
+      <strong>{if $module.TYPE == 'MainBlock'}<span class="MainBlock">{$module.NAME}</span>{else}<a href="{$module.U_EDIT}">{$module.NAME}</a>{/if}</strong>
+      {if $module.TYPE != 'MainBlock'}&nbsp;-  &nbsp;{$module.TYPE_NAME}{/if}
+      </p>
+
+      {if !empty($module.DESC)}
+      <p style="margin-left: 30px;"><i>{$module.DESC}</i></p>
+      {/if}
+
+      <p class="catPos">
+        <label>
+          {'Position'|@translate}
+          <input type="text" size="4" name="position[{$module.ID}]" maxlength="4" value="{$module.POS}" />
+        </label>
+      </p>
+    </li>
+    {/foreach}
+  </ul>
+
+  <p style="text-align: center;">
+  <br />
+    <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED} />
+  </p>
+</form>
+
+
+
+{*
+	<legend>{'stuffs_mods_management'|@translate}</legend>
+	<table class="table2">
+	<thead>
+		<tr class="throw">
+  		<td>{'stuffs_module_title'|@translate}</td>
+  		<td>{'stuffs_desc'|@translate}</td>
+ 			<td>{'stuffs_type'|@translate}</td>
+ 			<td>{'stuffs_position'|@translate}</td>
+ 			<td>{'stuffs_id_ligne'|@translate}</td>
+			<td>{'stuffs_width'|@translate}</td>
+ 			<td>{'stuffs_action'|@translate}</td>
+		</tr>
+	</thead>
+
+	{foreach from=$modules item=module}
+	<tr class="{$module.CLASS}" height="28">
+  		<td align="center">{$module.NAME}</td>
+  		<td align="center">{$module.DESC}</td>
+  		<td align="center">{$module.TYPE}</td>
+  		<td align="center"><input type="text" size="2" maxlength="2" value="{$module.POS}" name="position[{$module.ID}]"/></td>
+  		<td align="center">{$module.ID_LINE}</td>
+		<td align="center">{$module.WIDTH}</td>
+  		<td align="center">{$module.ACTION}</td>
+	</tr>
+	{/foreach}
+*}
Index: /extensions/PWG_Stuffs/admin/template/new.tpl
===================================================================
--- /extensions/PWG_Stuffs/admin/template/new.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/admin/template/new.tpl	(revision 3300)
@@ -0,0 +1,25 @@
+<div class="titrePage">
+  <h2>PWG Stuffs</h2>
+</div>
+
+<form method="post" action="" class="general">
+
+<fieldset>
+	<legend>{'stuffs_add_mod'|@translate}</legend>
+
+	<table>
+	{foreach from=$add_module item=module}
+	<tr>
+		<td><input type="radio" value="{$module.MODULE}" name="module"/>
+			<b>{$module.NAME}</b> : {$module.DESC}</td>
+	</tr>
+	{/foreach}
+	</table>
+<br>
+<div style="text-align:center;">
+<input class="submit" name="addModule" type="submit" value="{'stuffs_add_mod'|@translate}" {$TAG_INPUT_ENABLED} />
+</div>
+
+</fieldset>
+
+</form>
Index: /extensions/PWG_Stuffs/include/class.inc.php
===================================================================
--- /extensions/PWG_Stuffs/include/class.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/include/class.inc.php	(revision 3300)
@@ -0,0 +1,195 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+class stuffs
+{
+  var $user_groups = array();
+  var $modules = array();
+	var $blocks = array();
+	var $pos = 'begin';
+
+  function stuffs()
+  {
+    $this->get_user_groups();
+    $this->get_modules();
+    $this->process_modules();
+  }
+
+  /* Retrieve user groups  */
+  function get_user_groups()
+  {
+    global $user;
+
+    $query = 'SELECT group_id FROM ' . USER_GROUP_TABLE . ' WHERE user_id = ' . $user['id'] . ';';
+    $result = pwg_query($query);
+    while ($row = mysql_fetch_assoc($result))
+    {
+      array_push($this->user_groups, $row['group_id']);
+    }
+  }
+
+  /* Retrieve modules from table */
+  function get_modules()
+  {
+    global $page, $user;
+
+    $query = '
+SELECT id, name, type, datas, groups, show_title, id_line, width
+FROM ' . STUFFS_TABLE . '
+WHERE users LIKE "%' . $user['status'] . '%"
+';
+
+    $script = script_basename();
+    if ($script == 'index')
+    {
+      $query .= isset($page['category']) ?
+        'AND on_cats = "true"' :
+        'AND on_home = "true"' ;
+    }
+    elseif ($script == 'picture')
+    {
+      $query .= 'AND on_picture = "true"';
+    }
+    else return;
+
+    $query .= '
+ORDER BY pos ASC;';
+
+    $result = pwg_query($query);
+
+    while ($row = mysql_fetch_assoc($result))
+    {
+      array_push($this->modules, $row);
+    }
+  }
+
+  /* Process modules */
+  function process_modules()
+  {
+    foreach ($this->modules as $module)
+    {
+      if ($module['type'] == 'MainBlock')
+      {
+    		$this->pos = 'end';
+    		continue;
+    	}
+    	if (!empty($module['groups']))
+      {
+    		$authorized_groups = explode(',', $module['groups']);
+    		if (array_intersect($this->user_groups, $authorized_groups) == array()) continue;
+    	}
+
+    	$datas = (!empty($module['datas']) ? unserialize($module['datas']) : false);
+      $block = array();
+
+    	if ((include(STUFFS_PATH . 'modules/' . $module['type'] . '/main.inc.php')) === false) continue;
+
+      $block['ID'] = $module['id'];
+      if ($module['show_title'] == 'true')
+      {
+        $block['TITLE'] = trigger_event('render_stuffs_name', $module['name']);
+      }
+      if (is_admin())
+      {
+        $block['U_EDIT'] = PHPWG_ROOT_PATH.'admin.php?page=plugin&amp;section='.STUFFS_DIR.'%2Fadmin%2Fadd_module.php&amp;type='.$module['type'].'&amp;edit='.$module['id'];
+      }
+      $block['TEMPLATE'] = realpath($this->get_template($module['type'].'.tpl'));
+    	$this->set_tpl_block($block, $module);
+    }
+  }
+  /* Set template blocks  */
+	function set_tpl_block($block, $module)
+	{
+		if (!empty($module['id_line']))
+    {
+      $block['id_line'] = $module['id_line'];
+      $block['given_width'] = !empty($module['width']) ? $module['width'] : '';
+
+      if (!empty($this->blocks[$this->pos]))
+      {
+        $last = end($this->blocks[$this->pos]);
+        $key = key($this->blocks[$this->pos]);
+        $penul = prev($this->blocks[$this->pos]);
+
+        if (isset($last['id_line']) and $last['id_line'] == $module['id_line'])
+        {
+          if (isset($penul['id_line']) and $penul['id_line'] == $module['id_line'])
+          {
+            $i = 3;
+            !$block['given_width'] or $i--;
+            !$last['given_width'] or $i--;
+            !$penul['given_width'] or $i--;
+
+            !$i or $default_width = intval((100 - $block['given_width'] - $last['given_width'] - $penul['given_width']) / $i);
+
+            $penul['WIDTH'] = $penul['given_width'] ? $penul['given_width'] : $default_width;
+            $block['WIDTH'] = $block['given_width'] ? $block['given_width'] : $default_width;
+
+            $block['CLASS'] = 'right_block';
+            $block['new_line'] = false;
+            $block['end_line'] = false;
+            $last['end_line'] = true;
+            $this->blocks[$this->pos][$key-1] = $penul;
+            $this->blocks[$this->pos][$key] = $block;
+            $this->blocks[$this->pos][] = $last;
+            return;
+          }
+          else
+          {
+            if (empty($block['given_width']) and empty($last['given_width']))
+            {
+              $last['WIDTH'] = 50;
+            }
+            elseif ($block['given_width']>0)
+            {
+              $last['WIDTH'] = 100 - $block['given_width'];
+            }
+            else
+            {
+              $last['WIDTH'] = $last['given_width'];
+            }
+            $block['CLASS'] = 'middle_block';
+            $last['CLASS'] = 'left_block';
+            $block['new_line'] = false;
+            $block['end_line'] = true;
+            $last['end_line'] = false;
+            $this->blocks[$this->pos][$key] = $last;
+            $this->blocks[$this->pos][] = $block;
+            return;
+          }
+        }
+      }
+    }
+
+    $block['new_line'] = true;
+    $block['end_line'] = true;
+    $block['CLASS'] = 'middle_block';
+  	$this->blocks[$this->pos][] = $block;
+	}
+
+  /* Return template for user template/theme*/
+  function get_template($file)
+  {
+    global $user, $template;
+
+    $dir = STUFFS_PATH . 'template/';
+    $theme_file = $dir.$user['template'].'/'.$user['theme'].'/'.$file;
+    $template_file = $dir.$user['template'].'/'.$file;
+
+    if (file_exists($theme_file))
+    {
+      return $theme_file;
+    }
+    elseif (file_exists($template_file))
+    {
+      return $template_file;
+    }
+    else
+    {
+      return $dir.$file;
+    }
+  }
+}
+
+?>
Index: /extensions/PWG_Stuffs/include/functions.inc.php
===================================================================
--- /extensions/PWG_Stuffs/include/functions.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/include/functions.inc.php	(revision 3300)
@@ -0,0 +1,115 @@
+<?php
+
+add_event_handler('render_stuffs_name', 'get_user_language_desc');
+
+if (!function_exists('get_user_language_desc'))
+{
+  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);
+  }
+}
+
+function pwgs_picture_special_sections()
+{
+  global $page, $conf;
+
+  if (preg_match('#&(pwgs_..)=#', $_SERVER['REQUEST_URI'], $matches))
+  {
+    if (isset($_GET['action']))
+    {
+      if (isset($page['category']))
+      {
+        $page['section'] = 'category/'.$page['category']['id'];
+        unset($page['category']);
+      }
+      $page['section'] .= $matches[0] . $_GET[$matches[1]];
+    }
+    else
+    {
+      unset($page['flat']);
+      $page['PWG_Stuffs_section'] = $matches[1];
+      $page['items'] = explode(',', $_GET[$matches[1]]);
+      $page['rank_of'] = array_flip($page['items']);
+      switch ($matches[1])
+      {
+        case 'pwgs_mv': $title = l10n('most_visited_cat'); break;
+        case 'pwgs_br': $title = l10n('best_rated_cat');   break;
+        case 'pwgs_re': $title = l10n('recent_pics_cat');  break;
+        case 'pwgs_ra': $title = l10n('random_cat');       break;
+      }
+      $page['title'] .= $conf['level_separator'] . $title;
+      add_event_handler('loc_end_page_header', 'add_pwgs_url_params');
+    }
+  }
+}
+
+function add_pwgs_url_params()
+{
+  global $page, $template;
+
+  $param = $page['PWG_Stuffs_section'];
+
+  $urls = array(
+    'first.U_IMG',
+    'previous.U_IMG',
+    'next.U_IMG',
+    'last.U_IMG',
+    'slideshow.U_START_PLAY',
+    'slideshow.U_STOP_PLAY',
+    'slideshow.U_START_REPEAT',
+    'slideshow.U_STOP_REPEAT',
+    'slideshow.U_DEC_PERIOD',
+    'slideshow.U_INC_PERIOD',
+    'U_SLIDESHOW_START',
+    'U_SLIDESHOW_STOP',
+    'U_METADATA',
+    'favorite.U_FAVORITE',
+    'U_SET_AS_REPRESENTATIVE',
+    'U_CADDIE',
+    'rating.F_ACTION',
+    'comment_add.F_ACTION',
+    'page_refresh.U_REFRESH',
+  );
+
+  foreach ($urls as $url)
+  {
+    $k = explode('.', $url);
+    if (isset($k[1]) and isset($template->smarty->_tpl_vars[$k[0]][$k[1]]))
+    {
+      $template->smarty->_tpl_vars[$k[0]][$k[1]] = add_url_params($template->smarty->_tpl_vars[$k[0]][$k[1]], array($param => $_GET[$param]));
+    }
+    elseif (!isset($k[1]) and isset($template->smarty->_tpl_vars[$k[0]]))
+    {
+      $template->smarty->_tpl_vars[$k[0]] = add_url_params($template->smarty->_tpl_vars[$k[0]], array($param => $_GET[$param]));
+    }
+  }
+}
+
+?>
Index: /extensions/PWG_Stuffs/include/index.php
===================================================================
--- /extensions/PWG_Stuffs/include/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/include/index.php	(revision 3300)
@@ -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/PWG_Stuffs/include/stuffs.inc.php
===================================================================
--- /extensions/PWG_Stuffs/include/stuffs.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/include/stuffs.inc.php	(revision 3300)
@@ -0,0 +1,41 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $template;
+
+include_once(STUFFS_PATH . 'include/class.inc.php');
+include(STUFFS_PATH . 'include/functions.inc.php');
+
+$stuffs = new stuffs();
+
+$template->set_filename('stuffs', realpath($stuffs->get_template('blocks.tpl')));
+
+if (script_basename() == 'index')
+{
+  $begin = 'PLUGIN_INDEX_CONTENT_BEFORE';
+  $end = 'PLUGIN_INDEX_CONTENT_AFTER';
+  $css_file = 'index.css';
+}
+else
+{
+  $begin = 'PLUGIN_PICTURE_BEFORE';
+  $end = 'PLUGIN_PICTURE_AFTER';
+  $css_file = 'picture.css';
+  pwgs_picture_special_sections();
+}
+
+if (!empty($stuffs->blocks['begin']))
+{
+  $template->assign('blocks', $stuffs->blocks['begin']);
+  $template->concat($begin,	$template->parse('stuffs', true));
+}
+if (!empty($stuffs->blocks['end']))
+{
+  $template->assign('blocks', $stuffs->blocks['end']);
+  $template->concat($end,	$template->parse('stuffs', true));
+}
+
+$template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.$stuffs->get_template($css_file).'">', $smarty, $repeat);
+
+?>
Index: /extensions/PWG_Stuffs/index.php
===================================================================
--- /extensions/PWG_Stuffs/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/index.php	(revision 3300)
@@ -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/PWG_Stuffs/language/en_UK/index.php
===================================================================
--- /extensions/PWG_Stuffs/language/en_UK/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/language/en_UK/index.php	(revision 3300)
@@ -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/PWG_Stuffs/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/PWG_Stuffs/language/en_UK/plugin.lang.php	(revision 3300)
+++ /extensions/PWG_Stuffs/language/en_UK/plugin.lang.php	(revision 3300)
@@ -0,0 +1,147 @@
+<?php
+
+$lang['stuffs_mods_management'] = 'Modules management';
+$lang['stuffs_add_mod'] = 'Add a module';
+$lang['stuffs_edit_mod'] = 'Edit module';
+
+$lang['stuffs_module_title'] = 'Module title';
+$lang['stuffs_desc'] = 'Description';
+$lang['stuffs_only_for_admin'] = '(only for administration pannel)';
+$lang['stuffs_type'] = 'Module type';
+$lang['stuffs_position'] = 'Position';
+$lang['stuffs_id_ligne'] = 'ID line';
+$lang['stuffs_width'] = 'Width';
+$lang['stuffs_action'] = 'Actions';
+$lang['stuffs_edit'] = 'Modify module';
+$lang['stuffs_delete'] = 'Delete module';
+$lang['stuffs_confirm_delete'] = 'Are you sure you want to delete module %s?';
+$lang['stuffs_main_block'] = 'Main block';
+
+$lang['stuffs_add_module'] = 'Add new module';
+$lang['stuffs_module_config'] = 'Module configuration';
+$lang['stuffs_visual_config'] = 'Display configuration';
+$lang['stuffs_module_options'] = 'Module options';
+$lang['stuffs_authorized_group'] = 'Authorized groups';
+$lang['stuffs_authorized_users'] = 'Authorized users';
+$lang['stuffs_public_module'] = '(Keep empty for public module)';
+$lang['stuffs_show_title'] = 'Show module title';
+$lang['stuffs_show_module_on'] = 'Show module :';
+$lang['stuffs_show_on_home'] = 'On main page';
+$lang['stuffs_show_on_cats'] = 'On all categories pages';
+$lang['stuffs_show_on_pictures'] = 'On picture pages';
+$lang['stuffs_no_options'] = 'No options for this module';
+
+//Messages d'infos
+$lang['stuffs_order_saved'] = 'Order successfully saved.';
+
+
+// Messages d'erreurs
+$lang['stuffs_error_no_mod_selected'] = 'You didn\'t select any module.';
+$lang['stuffs_no_name'] = 'You must specify name module';
+
+//------------------------------------------------------------------------------
+//							Module LastComs
+//------------------------------------------------------------------------------
+
+$lang['module_name_LastComs'] = 'Last comments';
+$lang['module_desc_LastComs'] = 'Display last posted comments';
+
+$lang['lastcoms_no_nb_comments'] = 'You must specify numbers of comments.';
+$lang['lastcoms_config'] = 'Configuration';
+$lang['lastcoms_nb_comments'] = 'Number of comments to display';
+$lang['lastcoms_show_buttons'] = 'Show admin buttons';
+$lang['lastcoms_dim'] = 'Thumbnails size';
+$lang['lastcoms_width'] = 'Max width';
+$lang['lastcoms_height'] = 'Max height';
+$lang['lastcoms_nb_cadres'] = 'Numbers of frame by line';
+$lang['lastcoms_taille_cadres'] = 'Frame height';
+
+
+//------------------------------------------------------------------------------
+//							Module Logon
+//------------------------------------------------------------------------------
+
+$lang['module_name_Logon'] = 'Login';
+$lang['module_desc_Logon'] = 'Display login block';
+
+$lang['logon_remove_menubar_block'] = 'Remove "Quick connect" block from menubar';
+
+
+//------------------------------------------------------------------------------
+//							Module Personal
+//------------------------------------------------------------------------------
+
+$lang['module_name_Personal'] = 'Personnal block';
+$lang['module_desc_Personal'] = 'Display personnal block (like an edito)';
+
+$lang['personal_content'] = 'content';
+
+
+//------------------------------------------------------------------------------
+//							Module Tags
+//------------------------------------------------------------------------------
+
+$lang['module_name_Tags'] = 'Tags';
+$lang['module_desc_Tags'] = 'Display gallery tags';
+
+$lang['stuffs_tags_default_display'] = 'Tags display';
+$lang['stuffs_tags_cloud'] = 'Tags cloud';
+$lang['stuffs_tags_letters'] = 'Group by lettters';
+$lang['stuffs_tags_cumulus'] = 'Use cumulus mode (plugin <a href=http://piwigo.org/ext/extension_view.php?eid=263 target="_blank">Cumulus Tags Cloud</a> must be installed)';
+
+
+//------------------------------------------------------------------------------
+//							Module Piclenswall
+//------------------------------------------------------------------------------
+
+$lang['module_name_piclenswall'] = 'Piclens 3DWall';
+$lang['module_desc_piclenswall'] = 'Display piclens 3D wall (plugin <a href="http://piwigo.org/ext/extension_view.php?eid=234" target="_blank">Cooliris/piclens</a> must be installed)';
+
+$lang['piclenswall_height'] = 'Wall height';
+$lang['piclenswall_background_color'] = 'Background color';
+$lang['piclenswall_black'] = 'Black';
+$lang['piclenswall_white'] = 'White';
+$lang['piclenswall_info'] = 'So that the wall is working properly';
+$lang['piclenswall_info_piclens'] = 'You must install and activate <a href="http://piwigo.org/ext/extension_view.php?eid=234">Cooliris/piclens</a> plugin.';
+$lang['piclenswall_info_crossdomain'] = 'You must copy <a href="%s">crossdomain.xml</a> file to the root of your site (or moddify existing file).';
+$lang['piclenswall_info_param'] = '3D Wall Settings must be modified in <b>Cooliris-piclens/b> plugin configuration page.';
+
+//------------------------------------------------------------------------------
+//							Module Most Visited
+//------------------------------------------------------------------------------
+
+$lang['module_name_MostVisited'] = 'Most visited';
+$lang['module_desc_MostVisited'] = 'Display x most visited pictures in the gallery or a category';
+
+$lang['stuffs_mv_nb_images'] = 'Maximum number of pictures to display';
+$lang['stuffs_mv_category_display'] = 'Display on categories pages';
+$lang['stuffs_mv_all_cats'] = 'All categories';
+$lang['stuffs_mv_w_thumb'] = 'Only categories with thumbnails';
+$lang['stuffs_mv_wo_thumb'] = 'Only categories without thumbnails';
+$lang['stuffs_mv_selected_cats'] = 'Only selected categories';
+
+$lang['stuffs_mv_cat_selection'] = 'Categories selection';
+$lang['stuffs_mv_hold_ctrl'] = 'hold CTRL';
+
+//------------------------------------------------------------------------------
+//							Module Best Rated
+//------------------------------------------------------------------------------
+
+$lang['module_name_BestRated'] = 'Best rated';
+$lang['module_desc_BestRated'] = 'Display x best rated pictures in the gallery or a category';
+
+//------------------------------------------------------------------------------
+//							Module Recent
+//------------------------------------------------------------------------------
+
+$lang['module_name_Recent'] = 'Recent pictures';
+$lang['module_desc_Recent'] = 'Display x recent pictures in the gallery or a category (if exist)';
+
+//------------------------------------------------------------------------------
+//							Module Random
+//------------------------------------------------------------------------------
+
+$lang['module_name_Random'] = 'Random pictures';
+$lang['module_desc_Random'] = 'Display x random pictures in the gallery or a category';
+
+?>
Index: /extensions/PWG_Stuffs/language/es_ES/index.php
===================================================================
--- /extensions/PWG_Stuffs/language/es_ES/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/language/es_ES/index.php	(revision 3300)
@@ -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/PWG_Stuffs/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/PWG_Stuffs/language/es_ES/plugin.lang.php	(revision 3300)
+++ /extensions/PWG_Stuffs/language/es_ES/plugin.lang.php	(revision 3300)
@@ -0,0 +1,147 @@
+<?php
+
+$lang['stuffs_mods_management'] = 'Gestión de modula';
+$lang['stuffs_add_mod'] = 'Añadir un nuevo módulo';
+$lang['stuffs_edit_mod'] = 'Edición del módulo';
+
+$lang['stuffs_module_title'] = 'Título del módulo';
+$lang['stuffs_desc'] = 'Descripción';
+$lang['stuffs_only_for_admin'] = '(únicamente para el tablero de administración)';
+$lang['stuffs_type'] = 'Tipo de módulo';
+$lang['stuffs_position'] = 'Position';
+$lang['stuffs_id_ligne'] = 'ID linea';
+$lang['stuffs_width'] = 'Largeur';
+$lang['stuffs_action'] = 'Acciones';
+$lang['stuffs_edit'] = 'Modificar el módulo';
+$lang['stuffs_delete'] = 'Suprimir el módulo';
+$lang['stuffs_confirm_delete'] = 'Usted es sobre querer suprimir el módulo %s?';
+$lang['stuffs_main_block'] = 'Bloque principal';
+
+$lang['stuffs_add_module'] = 'Añadido de un nuevo módulo';
+$lang['stuffs_module_config'] = 'Configuración del módulo';
+$lang['stuffs_visual_config'] = 'Configuración de la fijación';
+$lang['stuffs_module_options'] = 'Opciones del módulo';
+$lang['stuffs_authorized_group'] = 'Grupos autorizados';
+$lang['stuffs_authorized_users'] = 'Utilizadores autorizados';
+$lang['stuffs_public_module'] = '(Dejar vacío para un módulo pública)';
+$lang['stuffs_show_title'] = 'Mostrar título del módulo';
+$lang['stuffs_show_module_on'] = 'Fijar el módulo:';
+$lang['stuffs_show_on_home'] = 'Sobre la página inicial de la sitio';
+$lang['stuffs_show_on_cats'] = 'Sobre todas las páginas de las categorías';
+$lang['stuffs_show_on_pictures'] = 'Sobre las páginas de las imágenes';
+$lang['stuffs_no_options'] = 'Ningunas opciones disponibles para este módulo';
+
+//Messages d'infos
+$lang['stuffs_order_saved'] = 'El odre se salvó.';
+
+
+// Messages d'erreurs
+$lang['stuffs_error_no_mod_selected'] = 'Usted no seleccionó módulo que hay que añadir.';
+$lang['stuffs_no_name'] = 'Usted debe indicar por lo menos un nombre para el módulo';
+
+//------------------------------------------------------------------------------
+//							Module LastComs
+//------------------------------------------------------------------------------
+
+$lang['module_name_LastComs'] = 'Últimos comentarios';
+$lang['module_desc_LastComs'] = 'Fija los últimos comentarios enviados';
+
+$lang['lastcoms_no_nb_comments'] = 'Usted debe informar el campo " Número de comentarios que hay que fijar ".';
+$lang['lastcoms_config'] = 'Configuración';
+$lang['lastcoms_nb_comments'] = 'Número de comentarios que hay que fijar';
+$lang['lastcoms_show_buttons'] = 'Fijar los botones admin';
+$lang['lastcoms_dim'] = 'Dimensión de las miniaturas';
+$lang['lastcoms_width'] = 'Anchura máxima';
+$lang['lastcoms_height'] = 'Altura máxima';
+$lang['lastcoms_nb_cadres'] = 'Número de personal por línea';
+$lang['lastcoms_taille_cadres'] = 'Altura del personal';
+
+
+//------------------------------------------------------------------------------
+//							Module Logon
+//------------------------------------------------------------------------------
+
+$lang['module_name_Logon'] = 'Identificación';
+$lang['module_desc_Logon'] = 'Fija un bloque "Identificación" sobre el índice';
+
+$lang['logon_remove_menubar_block'] = 'Retirar el bloque " identificación rápida " del menubar';
+
+
+//------------------------------------------------------------------------------
+//							Module Personal
+//------------------------------------------------------------------------------
+
+$lang['module_name_Personal'] = 'Bloque personal';
+$lang['module_desc_Personal'] = 'Fija un bloque personal (un editorial por ejemplo)';
+
+$lang['personal_content'] = 'Contenido';
+
+
+//------------------------------------------------------------------------------
+//							Module Tags
+//------------------------------------------------------------------------------
+
+$lang['module_name_Tags'] = 'Tags';
+$lang['module_desc_Tags'] = 'Fija las tags de la galería';
+
+/* TODO */$lang['stuffs_tags_default_display'] = 'Tags display';
+/* TODO */$lang['stuffs_tags_cloud'] = 'Tags cloud';
+/* TODO */$lang['stuffs_tags_letters'] = 'Group by lettters';
+/* TODO */$lang['stuffs_tags_cumulus'] = 'Use cumulus mode (plugin <a href=http://piwigo.org/ext/extension_view.php?eid=263 target="_blank">Cumulus Tags Cloud</a> must be installed)';
+
+
+//------------------------------------------------------------------------------
+//							Module Piclenswall
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_piclenswall'] = 'Piclens 3DWall';
+/* TODO */$lang['module_desc_piclenswall'] = 'Display piclens 3D wall (plugin <a href="http://piwigo.org/ext/extension_view.php?eid=234" target="_blank">Cooliris/piclens</a> must be installed)';
+
+/* TODO */$lang['piclenswall_height'] = 'Wall height';
+/* TODO */$lang['piclenswall_background_color'] = 'Background color';
+/* TODO */$lang['piclenswall_black'] = 'Black';
+/* TODO */$lang['piclenswall_white'] = 'White';
+/* TODO */$lang['piclenswall_info'] = 'So that the wall is working properly';
+/* TODO */$lang['piclenswall_info_piclens'] = 'You must install and activate <a href="http://piwigo.org/ext/extension_view.php?eid=234">Cooliris/piclens</a> plugin.';
+/* TODO */$lang['piclenswall_info_crossdomain'] = 'You must copy <a href="%s">crossdomain.xml</a> file to the root of your site (or moddify existing file).';
+/* TODO */$lang['piclenswall_info_param'] = '3D Wall Settings must be modified in <b>Cooliris-piclens/b> plugin configuration page.';
+
+//------------------------------------------------------------------------------
+//							Module Most Visited
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_MostVisited'] = 'Most visited';
+/* TODO */$lang['module_desc_MostVisited'] = 'Display x most visited pictures in the gallery or a category';
+
+/* TODO */$lang['stuffs_mv_nb_images'] = 'Maximum number of pictures to display';
+/* TODO */$lang['stuffs_mv_category_display'] = 'Display on categories pages';
+/* TODO */$lang['stuffs_mv_all_cats'] = 'All categories';
+/* TODO */$lang['stuffs_mv_w_thumb'] = 'Only categories with thumbnails';
+/* TODO */$lang['stuffs_mv_wo_thumb'] = 'Only categories without thumbnails';
+/* TODO */$lang['stuffs_mv_selected_cats'] = 'Only selected categories';
+
+/* TODO */$lang['stuffs_mv_cat_selection'] = 'Categories selection';
+/* TODO */$lang['stuffs_mv_hold_ctrl'] = 'hold CTRL';
+
+//------------------------------------------------------------------------------
+//							Module Best Rated
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_BestRated'] = 'Best rated';
+/* TODO */$lang['module_desc_BestRated'] = 'Display x best rated pictures in the gallery or a category';
+
+//------------------------------------------------------------------------------
+//							Module Recent
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_Recent'] = 'Recent pictures';
+/* TODO */$lang['module_desc_Recent'] = 'Display x recent pictures in the gallery or a category (if exist)';
+
+//------------------------------------------------------------------------------
+//							Module Random
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_Random'] = 'Random pictures';
+/* TODO */$lang['module_desc_Random'] = 'Display x random pictures in the gallery or a category';
+
+?>
Index: /extensions/PWG_Stuffs/language/fr_FR/index.php
===================================================================
--- /extensions/PWG_Stuffs/language/fr_FR/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/language/fr_FR/index.php	(revision 3300)
@@ -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/PWG_Stuffs/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/PWG_Stuffs/language/fr_FR/plugin.lang.php	(revision 3300)
+++ /extensions/PWG_Stuffs/language/fr_FR/plugin.lang.php	(revision 3300)
@@ -0,0 +1,147 @@
+<?php
+
+$lang['stuffs_mods_management'] = 'Gestion des module';
+$lang['stuffs_add_mod'] = 'Ajouter un nouveau module';
+$lang['stuffs_edit_mod'] = 'Edition du module';
+
+$lang['stuffs_module_title'] = 'Titre du module';
+$lang['stuffs_desc'] = 'Description';
+$lang['stuffs_only_for_admin'] = '(uniquement pour le panneau d\'administration)';
+$lang['stuffs_type'] = 'Type de module';
+$lang['stuffs_position'] = 'Position';
+$lang['stuffs_id_ligne'] = 'ID ligne';
+$lang['stuffs_width'] = 'Largeur';
+$lang['stuffs_action'] = 'Actions';
+$lang['stuffs_edit'] = 'Modifier le module';
+$lang['stuffs_delete'] = 'Supprimer le module';
+$lang['stuffs_confirm_delete'] = 'Etes-vous sur de vouloir supprimer le module %s?';
+$lang['stuffs_main_block'] = 'Bloc principal';
+
+$lang['stuffs_add_module'] = 'Ajout d\'un nouveau module';
+$lang['stuffs_module_config'] = 'Configuration du module';
+$lang['stuffs_visual_config'] = 'Configuration de l\'affichage';
+$lang['stuffs_module_options'] = 'Options du module';
+$lang['stuffs_authorized_group'] = 'Groupes autorisés';
+$lang['stuffs_authorized_users'] = 'Utilisateurs autorisés';
+$lang['stuffs_public_module'] = '(Laisser vide pour un module publique)';
+$lang['stuffs_show_title'] = 'Afficher le titre du module';
+$lang['stuffs_show_module_on'] = 'Afficher le module :';
+$lang['stuffs_show_on_home'] = 'Sur la page d\'accueil du site';
+$lang['stuffs_show_on_cats'] = 'Sur toutes les pages des catégories';
+$lang['stuffs_show_on_pictures'] = 'Sur les pages des images';
+$lang['stuffs_no_options'] = 'Pas d\'options disponibles pour ce module';
+
+//Messages d'infos
+$lang['stuffs_order_saved'] = 'L\'ordre a été sauvegardé.';
+
+
+// Messages d'erreurs
+$lang['stuffs_error_no_mod_selected'] = 'Vous n\'avez pas sélectionné de module à ajouter.';
+$lang['stuffs_no_name'] = 'Vous devez indiquer un nom pour le module';
+
+//------------------------------------------------------------------------------
+//							Module LastComs
+//------------------------------------------------------------------------------
+
+$lang['module_name_LastComs'] = 'Derniers commentaires';
+$lang['module_desc_LastComs'] = 'Affiche les derniers commentaires postés';
+
+$lang['lastcoms_no_nb_comments'] = 'Vous devez renseigner le champ "Nombre de commentaires à afficher".';
+$lang['lastcoms_config'] = 'Configuration';
+$lang['lastcoms_nb_comments'] = 'Nombre de commentaires à afficher';
+$lang['lastcoms_show_buttons'] = 'Afficher les boutons admin';
+$lang['lastcoms_dim'] = 'Dimension des miniatures';
+$lang['lastcoms_width'] = 'largeur maxi';
+$lang['lastcoms_height'] = 'hauteur maxi';
+$lang['lastcoms_nb_cadres'] = 'Nombre de cadres par ligne';
+$lang['lastcoms_taille_cadres'] = 'Hauteur des cadres';
+
+
+//------------------------------------------------------------------------------
+//							Module Logon
+//------------------------------------------------------------------------------
+
+$lang['module_name_Logon'] = 'Identification';
+$lang['module_desc_Logon'] = 'Affiche un bloc "Identification" sur l\'index';
+
+$lang['logon_remove_menubar_block'] = 'Retirer le bloc "identification rapide" du menubar';
+
+
+//------------------------------------------------------------------------------
+//							Module Personal
+//------------------------------------------------------------------------------
+
+$lang['module_name_Personal'] = 'Bloc personnel';
+$lang['module_desc_Personal'] = 'Affiche un bloc personnel (un édito par exemple)';
+
+$lang['personal_content'] = 'contenu';
+
+
+//------------------------------------------------------------------------------
+//							Module Tags
+//------------------------------------------------------------------------------
+
+$lang['module_name_Tags'] = 'Tags';
+$lang['module_desc_Tags'] = 'Affiche les tags de la galerie';
+
+$lang['stuffs_tags_default_display'] = 'Affichage des tags';
+$lang['stuffs_tags_cloud'] = 'Nuage de tags';
+$lang['stuffs_tags_letters'] = 'Regrouper par lettres';
+$lang['stuffs_tags_cumulus'] = 'Utiliser le mode Cumulus (le plugin <a href=http://piwigo.org/ext/extension_view.php?eid=263 target="_blank">Cumulus Tags Cloud</a> doit etre installé)';
+
+
+//------------------------------------------------------------------------------
+//							Module Piclenswall
+//------------------------------------------------------------------------------
+
+$lang['module_name_piclenswall'] = 'Piclens 3DWall';
+$lang['module_desc_piclenswall'] = 'Affiche un mur 3D piclens (le plugin <a href="http://piwigo.org/ext/extension_view.php?eid=234" target="_blank">Cooliris/piclens</a> doit etre installé)';
+
+$lang['piclenswall_height'] = 'Hauteur du mur Cooliris';
+$lang['piclenswall_background_color'] = 'Couleur de l\'arrière plan';
+$lang['piclenswall_black'] = 'Noir';
+$lang['piclenswall_white'] = 'Blanc';
+$lang['piclenswall_info'] = 'Important pour que 3DWall fonctionne';
+$lang['piclenswall_info_piclens'] = 'Vous devez installer et activer le plugin <a href="http://piwigo.org/ext/extension_view.php?eid=234">Cooliris/piclens</a>.';
+$lang['piclenswall_info_crossdomain'] = 'Vous devez copier le fichier <a href="%s">crossdomain.xml</a> à la racine du site (ou modifier le fichier existant).';
+$lang['piclenswall_info_param'] = 'Les paramètres du mur sont à modifier directement dans la page de configuration du plugin <b>Cooliris-piclens</b>';
+
+//------------------------------------------------------------------------------
+//							Module Most Visited
+//------------------------------------------------------------------------------
+
+$lang['module_name_MostVisited'] = 'Plus vues';
+$lang['module_desc_MostVisited'] = 'Affiche les x images les plus vues de la galerie ou de la catégorie';
+
+$lang['stuffs_mv_nb_images'] = 'Nombre maximum d\'images à afficher';
+$lang['stuffs_mv_category_display'] = 'Affichage sur les pages des catégories';
+$lang['stuffs_mv_all_cats'] = 'Toutes les catégories';
+$lang['stuffs_mv_w_thumb'] = 'Catégories avec miniatures uniquement';
+$lang['stuffs_mv_wo_thumb'] = 'Catégories sans miniatures uniquement';
+$lang['stuffs_mv_selected_cats'] = 'Catégories sélectionnées uniquement';
+
+$lang['stuffs_mv_cat_selection'] = 'Sélection des catégories';
+$lang['stuffs_mv_hold_ctrl'] = 'maintenir CTRL appuyé';
+
+//------------------------------------------------------------------------------
+//							Module Best Rated
+//------------------------------------------------------------------------------
+
+$lang['module_name_BestRated'] = 'Mieux notées';
+$lang['module_desc_BestRated'] = 'Affiche les x images les mieux notées de la galerie ou de la catégorie';
+
+//------------------------------------------------------------------------------
+//							Module Recent
+//------------------------------------------------------------------------------
+
+$lang['module_name_Recent'] = 'Images récentes';
+$lang['module_desc_Recent'] = 'Affiche les images récentes de la galerie ou de la catégorie (s\'il y en a)';
+
+//------------------------------------------------------------------------------
+//							Module Random
+//------------------------------------------------------------------------------
+
+$lang['module_name_Random'] = 'Images au hasard';
+$lang['module_desc_Random'] = 'Affiche x images au hasard dans la galerie ou la catégorie';
+
+?>
Index: /extensions/PWG_Stuffs/language/it_IT/index.php
===================================================================
--- /extensions/PWG_Stuffs/language/it_IT/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/language/it_IT/index.php	(revision 3300)
@@ -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/PWG_Stuffs/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/PWG_Stuffs/language/it_IT/plugin.lang.php	(revision 3300)
+++ /extensions/PWG_Stuffs/language/it_IT/plugin.lang.php	(revision 3300)
@@ -0,0 +1,147 @@
+<?php
+
+$lang['stuffs_mods_management'] = 'Gestione dei moduli';
+$lang['stuffs_add_mod'] = 'Aggiungere un nuovo modulo';
+$lang['stuffs_edit_mod'] = 'Editare il modulo';
+
+$lang['stuffs_module_title'] = 'Titolo del modulo';
+$lang['stuffs_desc'] = 'Descriztione';
+$lang['stuffs_only_for_admin'] = '(solo per il pannello d\'amministrazione)';
+$lang['stuffs_type'] = 'Tipo del modulo';
+$lang['stuffs_position'] = 'Posizione';
+$lang['stuffs_id_ligne'] = 'ID linea';
+$lang['stuffs_width'] = 'Larghezza';
+$lang['stuffs_action'] = 'Azioni';
+$lang['stuffs_edit'] = 'Modificare il modulo';
+$lang['stuffs_delete'] = 'Cancellare il modulo';
+$lang['stuffs_confirm_delete'] = 'Siete sicuri di volere cancellare il modulo %s?';
+$lang['stuffs_main_block'] = 'Blocco principale';
+
+$lang['stuffs_add_module'] = 'Aggiunta d\'un nuovo modulo';
+$lang['stuffs_module_config'] = 'Configurazione del modulo';
+$lang['stuffs_visual_config'] = 'Configurazione della disposizione';
+$lang['stuffs_module_options'] = 'Ozioni del modulo';
+$lang['stuffs_authorized_group'] = 'Gruppi autorizzati';
+$lang['stuffs_authorized_users'] = 'Utenti autorizzati';
+$lang['stuffs_public_module'] = '(Lasciare vuoto per un modulo pubblico)';
+$lang['stuffs_show_title'] = 'Mostrare il titolo del modulo';
+$lang['stuffs_show_module_on'] = 'Visualizzare il modulo :';
+$lang['stuffs_show_on_home'] = 'Sulla home page del sito';
+$lang['stuffs_show_on_cats'] = 'Su tutte le pagine delle categorie';
+$lang['stuffs_show_on_pictures'] = 'Sulle pagine delle immagini';
+$lang['stuffs_no_options'] = 'Nessun opzione disponibile per questo modulo';
+
+//Messages d'infos
+$lang['stuffs_order_saved'] = 'L\'ordine è stato registrato.';
+
+
+// Messages d'erreurs
+$lang['stuffs_error_no_mod_selected'] = 'Non avete selezionato un modulo da aggiungere.';
+$lang['stuffs_no_name'] = 'Dovete indicare al meno un nome per il modulo';
+
+//------------------------------------------------------------------------------
+//							Module LastComs
+//------------------------------------------------------------------------------
+
+$lang['module_name_LastComs'] = 'Ultimi commenti';
+$lang['module_desc_LastComs'] = 'Visualizzare gli ultimi commenti aggiunti';
+
+$lang['lastcoms_no_nb_comments'] = 'Dovete inserire un valore nel campo "Numero di commenti da visualizzare".';
+$lang['lastcoms_config'] = 'Configurazione';
+$lang['lastcoms_nb_comments'] = 'Numero di commenti da visualizzare';
+$lang['lastcoms_show_buttons'] = 'Vizualizzare i pulzanti d\'amministrazione';
+$lang['lastcoms_dim'] = 'Dimensioni delle miniature';
+$lang['lastcoms_width'] = 'larghezza massima';
+$lang['lastcoms_height'] = 'altezza massima';
+$lang['lastcoms_nb_cadres'] = 'Numero di quadri per riga';
+$lang['lastcoms_taille_cadres'] = 'Altezza dei quadri';
+
+
+//------------------------------------------------------------------------------
+//							Module Logon
+//------------------------------------------------------------------------------
+
+$lang['module_name_Logon'] = 'Identificazione';
+$lang['module_desc_Logon'] = 'Visualizzare un blocco "Identificazione" sull\'indice';
+
+$lang['logon_remove_menubar_block'] = 'Rimuovere il blocco "identificazione rapida" dalla barra dei menu';
+
+
+//------------------------------------------------------------------------------
+//							Module Personal
+//------------------------------------------------------------------------------
+
+$lang['module_name_Personal'] = 'Blocco personale';
+$lang['module_desc_Personal'] = 'Visualizzare blocco personale (una nota per esempio)';
+
+$lang['personal_content'] = 'Contenuto';
+
+
+//------------------------------------------------------------------------------
+//							Module Tags
+//------------------------------------------------------------------------------
+
+$lang['module_name_Tags'] = 'Tags';
+$lang['module_desc_Tags'] = 'Visualizzare i tags della galleria';
+
+/* TODO */$lang['stuffs_tags_default_display'] = 'Tags display';
+/* TODO */$lang['stuffs_tags_cloud'] = 'Tags cloud';
+/* TODO */$lang['stuffs_tags_letters'] = 'Group by lettters';
+/* TODO */$lang['stuffs_tags_cumulus'] = 'Use cumulus mode (plugin <a href=http://piwigo.org/ext/extension_view.php?eid=263 target="_blank">Cumulus Tags Cloud</a> must be installed)';
+
+
+//------------------------------------------------------------------------------
+//							Module Piclenswall
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_piclenswall'] = 'Piclens 3DWall';
+/* TODO */$lang['module_desc_piclenswall'] = 'Display piclens 3D wall (plugin <a href="http://piwigo.org/ext/extension_view.php?eid=234" target="_blank">Cooliris/piclens</a> must be installed)';
+
+/* TODO */$lang['piclenswall_height'] = 'Wall height';
+/* TODO */$lang['piclenswall_background_color'] = 'Background color';
+/* TODO */$lang['piclenswall_black'] = 'Black';
+/* TODO */$lang['piclenswall_white'] = 'White';
+/* TODO */$lang['piclenswall_info'] = 'So that the wall is working properly';
+/* TODO */$lang['piclenswall_info_piclens'] = 'You must install and activate <a href="http://piwigo.org/ext/extension_view.php?eid=234">Cooliris/piclens</a> plugin.';
+/* TODO */$lang['piclenswall_info_crossdomain'] = 'You must copy <a href="%s">crossdomain.xml</a> file to the root of your site (or moddify existing file).';
+/* TODO */$lang['piclenswall_info_param'] = '3D Wall Settings must be modified in <b>Cooliris-piclens/b> plugin configuration page.';
+
+//------------------------------------------------------------------------------
+//							Module Most Visited
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_MostVisited'] = 'Most visited';
+/* TODO */$lang['module_desc_MostVisited'] = 'Display x most visited pictures in the gallery or a category';
+
+/* TODO */$lang['stuffs_mv_nb_images'] = 'Maximum number of pictures to display';
+/* TODO */$lang['stuffs_mv_category_display'] = 'Display on categories pages';
+/* TODO */$lang['stuffs_mv_all_cats'] = 'All categories';
+/* TODO */$lang['stuffs_mv_w_thumb'] = 'Only categories with thumbnails';
+/* TODO */$lang['stuffs_mv_wo_thumb'] = 'Only categories without thumbnails';
+/* TODO */$lang['stuffs_mv_selected_cats'] = 'Only selected categories';
+
+/* TODO */$lang['stuffs_mv_cat_selection'] = 'Categories selection';
+/* TODO */$lang['stuffs_mv_hold_ctrl'] = 'hold CTRL';
+
+//------------------------------------------------------------------------------
+//							Module Best Rated
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_BestRated'] = 'Best rated';
+/* TODO */$lang['module_desc_BestRated'] = 'Display x best rated pictures in the gallery or a category';
+
+//------------------------------------------------------------------------------
+//							Module Recent
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_Recent'] = 'Recent pictures';
+/* TODO */$lang['module_desc_Recent'] = 'Display x recent pictures in the gallery or a category (if exist)';
+
+//------------------------------------------------------------------------------
+//							Module Random
+//------------------------------------------------------------------------------
+
+/* TODO */$lang['module_name_Random'] = 'Random pictures';
+/* TODO */$lang['module_desc_Random'] = 'Display x random pictures in the gallery or a category';
+
+?>
Index: /extensions/PWG_Stuffs/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/main.inc.php	(revision 3300)
@@ -0,0 +1,46 @@
+<?php
+/*
+Plugin Name: PWG Stuffs
+Version: 2.0.o
+Description: Insert modules on your gallery
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=190
+Author: P@t
+Author URI: http://www.gauchon.com
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+define('STUFFS_DIR' , basename(dirname(__FILE__)));
+define('STUFFS_PATH' , PHPWG_PLUGINS_PATH . STUFFS_DIR . '/');
+define('STUFFS_TABLE' , $prefixeTable . 'stuffs');
+
+function stuffs_admin_menu($menu)
+{
+    array_push($menu, array(
+      'NAME' => 'PWG Stuffs',
+      'URL' => get_admin_plugin_menu_link(STUFFS_PATH . 'admin/admin.php')));
+    return $menu;
+}
+
+function set_stuffs_on_index()
+{
+	global $page;
+
+  if (isset($page['section']) and $page['section'] == 'categories')
+  {
+    include_once(STUFFS_PATH . 'include/stuffs.inc.php');
+	}
+}
+
+function set_stuffs_on_picture()
+{
+	include_once(STUFFS_PATH . 'include/stuffs.inc.php');
+}
+
+add_event_handler('get_admin_plugin_menu_links', 'stuffs_admin_menu');
+add_event_handler('loc_begin_index', 'set_stuffs_on_index');
+add_event_handler('loc_begin_picture', 'set_stuffs_on_picture');
+
+?>
Index: /extensions/PWG_Stuffs/maintain.inc.php
===================================================================
--- /extensions/PWG_Stuffs/maintain.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/maintain.inc.php	(revision 3300)
@@ -0,0 +1,144 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+function plugin_install()
+{
+  global $prefixeTable, $conf;
+
+  $query = 'SHOW TABLES LIKE "' . $prefixeTable . 'stuffs"';
+  $result = pwg_query($query);
+  if (!mysql_fetch_row($result))
+  {
+    $q = 'CREATE TABLE `' . $prefixeTable . 'stuffs` (
+`id` smallint(5) NOT NULL,
+`pos` smallint(5) NOT NULL,
+`name` text NOT NULL,
+`descr` varchar(255) default NULL,
+`type` varchar(255) NOT NULL,
+`datas` longtext default NULL,
+`users` varchar(255) default NULL,
+`groups` varchar(255) default NULL,
+`show_title` enum(\'true\',\'false\') NOT NULL,
+`on_home` enum(\'true\',\'false\') NOT NULL,
+`on_cats` enum(\'true\',\'false\') NOT NULL,
+`on_picture` enum(\'true\',\'false\') NOT NULL,
+`id_line` varchar(1) default NULL,
+`width` smallint(9) default NULL,
+PRIMARY KEY  (`id`),
+KEY `on_home` (`on_home`),
+KEY `on_cats` (`on_cats`),
+KEY `on_picture` (`on_picture`)
+) DEFAULT CHARSET=utf8;';
+    pwg_query($q);
+  
+    $q = "INSERT INTO `" . $prefixeTable . "stuffs` (`id`, `pos`, `name`, `descr`, `type`, `datas`, `users`, `groups`, `show_title`, `on_home`, `on_cats`, `on_picture`, `id_line`, `width`) 
+VALUES (0, 1, 'MainBlock', NULL, 'MainBlock', NULL, 'guest,generic,normal,admin,webmaster', NULL, 'true', 'true', 'true', 'true', NULL, NULL);";
+    pwg_query($q);
+  }
+}
+
+function plugin_activate()
+{
+  global $prefixeTable;
+
+  // Check if upgrade is needed
+  $query = 'SHOW FULL COLUMNS FROM ' . $prefixeTable . 'stuffs;';
+  $result = array_from_query($query, 'Field');
+  if ($result[5] == 'params')
+  {
+    upgrade_stuffs_from_17();
+  }
+}
+
+function plugin_uninstall()
+{
+    global $prefixeTable;
+
+	$q = 'DROP TABLE ' . $prefixeTable . 'stuffs;';
+    pwg_query($q);
+}
+
+function upgrade_stuffs_from_17()
+{
+  global $prefixeTable, $conf;
+
+  $query = 'ALTER TABLE ' . $prefixeTable . 'stuffs
+MODIFY COLUMN name TEXT CHARACTER SET utf8 NOT NULL,
+MODIFY COLUMN descr VARCHAR(255) CHARACTER SET utf8 default NULL,
+MODIFY COLUMN type VARCHAR(255) CHARACTER SET utf8 NOT NULL,
+MODIFY COLUMN params VARCHAR(255) CHARACTER SET utf8 default NULL,
+MODIFY COLUMN datas LONGTEXT CHARACTER SET utf8 default NULL,
+MODIFY COLUMN users VARCHAR(255) CHARACTER SET utf8 default NULL,
+MODIFY COLUMN groups VARCHAR(255) CHARACTER SET utf8 default NULL,
+DEFAULT CHARACTER SET utf8,
+ADD show_title ENUM(\'true\',\'false\') NOT NULL,
+ADD on_home ENUM(\'true\',\'false\') NOT NULL,
+ADD on_cats ENUM(\'true\',\'false\') NOT NULL,
+ADD on_picture ENUM(\'true\',\'false\') NOT NULL,
+ADD id_line VARCHAR(1) default NULL,
+ADD width SMALLINT(9) default NULL,
+ADD INDEX (on_home),
+ADD INDEX (on_cats),
+ADD INDEX (on_picture);';
+
+  pwg_query($query);
+  
+  $query = 'SELECT id, name, type, params, datas FROM ' . $prefixeTable . 'stuffs;';
+  $result = pwg_query($query);
+  
+  $modules = array();
+  while ($row = mysql_fetch_assoc($result))
+  {
+    if ($row['name'] != 'MainBlock')
+    {
+      $array = array();
+      foreach (explode('///', $row['name']) as $name)
+      {
+        $a = explode(':', $name);
+        array_push($array, '[lang='.substr($a[0],0,2).']'.$a[1].'[/lang]');
+      }
+      $new_name = implode("\r\n", $array);
+    }
+    else
+    {
+      $new_name = 'MainBlock';
+    }
+
+    if ($row['type'] == 'LastComs')
+    {
+      $datas = unserialize($row['datas']);
+      $row['datas'] = serialize(array($datas[0], $datas[1], $datas[6], $datas[2], $datas[3]));
+    }
+  
+    $params = explode(',', $row['params']);
+    $params[4] = !empty($params[4]) ? '"'.$params[4].'"' : 'NULL';
+    $params[5] = !empty($params[5]) ? $params[5] : 'NULL';
+
+    $query = 'UPDATE ' . $prefixeTable . 'stuffs
+SET
+  name = "'. $new_name . '",
+  datas = "' . addslashes($row['datas']) . '",
+  show_title = "'. ($params[0] ? 'true' : 'false') .'",
+  on_home = "'. ($params[1] ? 'true' : 'false') .'",
+  on_cats = "'. ($params[2] ? 'true' : 'false') .'",
+  on_picture = "'. ($params[3] ? 'true' : 'false') .'",
+  id_line = '. $params[4] .',
+  width = '. $params[5] .'
+WHERE id = '.$row['id'].';';
+
+    pwg_query($query);
+  }
+
+  $query = 'ALTER TABLE ' . $prefixeTable . 'stuffs DROP params;';
+  pwg_query($query);
+
+  if (isset($conf['Stuffs']))
+  {
+	  $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="Stuffs" LIMIT 1;';
+    pwg_query($q);
+  }
+}
+
+
+?>
Index: /extensions/PWG_Stuffs/modules/BestRated/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/BestRated/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/BestRated/config.inc.php	(revision 3300)
@@ -0,0 +1,37 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!isset($datas))
+{
+  $datas = array(
+    'nb_images'     => 10,
+    'cat_display'   => 'all',
+    'cat_selection' => array(),
+  );
+}
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']) and !is_adviser())
+{
+  $datas = array(
+    'nb_images' => intval($_POST['nb_images']),
+    'cat_display' => $_POST['cat_display'],
+    'cat_selection' => $_POST['cat_selection'],
+    );
+  unset($_POST['on_picture']);
+}
+
+// Parametrage du template
+$query = 'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.';';
+display_select_cat_wrapper($query,array(),'category_selection');
+
+$template->assign(array(
+  'NB_IMAGES' => $datas['nb_images'],
+  'cat_display' => $datas['cat_display'],
+  'category_selected' => $datas['cat_selection']
+));
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/BestRated/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/BestRated/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/BestRated/config.tpl	(revision 3300)
@@ -0,0 +1,88 @@
+{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
+{known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.resizable.packed.js"}
+
+<table>
+	<tr>
+		<td align="right"><br>{'stuffs_mv_nb_images'|@translate} &nbsp;&nbsp;</td>
+		<td><br><input type="text" name="nb_images" size="3" maxlength="2" value="{$NB_IMAGES}"></td>
+	</tr>
+	<tr class="cat_options" style="display: none;">
+		<td align="right"><br>{'stuffs_mv_category_display'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+      <select name="cat_display">
+        <option label="{'stuffs_mv_all_cats'|@translate}" value="all" {if $cat_display == 'all'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_all_cats'|@translate}</option>
+        <option label="{'stuffs_mv_wo_thumb'|@translate}" value="wo_thumb" {if $cat_display == 'wo_thumb'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_wo_thumb'|@translate}</option>
+        <option label="{'stuffs_mv_w_thumb'|@translate}" value="w_thumb" {if $cat_display == 'w_thumb'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_w_thumb'|@translate}</option>
+        <option label="{'stuffs_mv_selected_cats'|@translate}" value="selected_cats" {if $cat_display == 'selected_cats'}selected="selected"{/if} onClick="javascript: show_cat_list();">{'stuffs_mv_selected_cats'|@translate}</option>
+      </select>
+    </td>
+	</tr>
+	<tr class="cat_selection" style="display: none;">
+		<td align="right">
+      <br>{'stuffs_mv_cat_selection'|@translate} &nbsp;&nbsp;
+      <br>({'stuffs_mv_hold_ctrl'|@translate}) &nbsp;&nbsp;</td>
+		<td><br>
+		  <select class="categoryList" name="cat_selection[]" multiple="multiple" size="30">
+        {html_options options=$category_selection selected=$category_selected}
+      </select></td>
+	</tr>
+</table>
+<br>
+
+{literal}
+<script type="text/javascript">
+resize = false;
+function show_cat_list()
+{
+  jQuery('.cat_selection').show();
+  if (!resize)
+  {
+    resize = true;
+    jQuery('.categoryList').resizable({
+      handles: "all",
+      animate: true,
+      animateDuration: "slow",
+      animateEasing: "swing",
+      preventDefault: true,
+      preserveCursor: true,
+      autoHide: true,
+      ghost: true
+    });
+  }
+}
+
+function hide_cat_list()
+{
+  jQuery('.cat_selection').hide();
+}
+
+jQuery().ready( function () {
+  jQuery("input[name='on_cats']").click( function() {
+    if (this.checked)
+    {
+      jQuery('.cat_options').show();
+      if (jQuery("select[name='cat_display']").val() == 'selected_cats')
+        show_cat_list();
+    }
+    else
+    {
+      jQuery('.cat_options').hide();
+      hide_cat_list();
+    }
+  });
+});
+
+if (document.getElementsByName("on_cats")[0].checked)
+{
+  jQuery('.cat_options').show();
+  if (jQuery("select[name='cat_display']").val() == 'selected_cats')
+  {
+    show_cat_list();
+  }
+}
+
+jQuery("table:eq(1) tr:eq(5)").hide();
+</script>
+{/literal}
+
Index: /extensions/PWG_Stuffs/modules/BestRated/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/BestRated/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/BestRated/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/BestRated/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/BestRated/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/BestRated/main.inc.php	(revision 3300)
@@ -0,0 +1,163 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $page, $user, $conf, $template;
+
+if (script_basename() == 'picture'
+  or ($datas['cat_display'] == 'wo_thumb' and !empty($page['items']))
+  or ($datas['cat_display'] == 'w_thumb' and empty($page['items']) and isset($page['category']))
+  or ($datas['cat_display'] == 'selected_cats' and isset($page['category']) and !in_array($page['category']['id'], $datas['cat_selection'])))
+{
+  return false;
+}
+
+$forbidden = get_sql_condition_FandF
+  (
+    array
+      (
+        'forbidden_categories' => 'ic.category_id',
+        'visible_categories' => 'ic.category_id',
+        'visible_images' => 'i.id'
+      ),
+    'AND'
+  );
+
+$query ='
+SELECT DISTINCT(i.id)
+  FROM '.IMAGES_TABLE.' AS i
+    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+    INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id
+  WHERE i.average_rate IS NOT NULL';
+
+if (isset($page['category']))
+{
+  $query .= '
+        AND ( c.uppercats LIKE \''.$page['category']['uppercats'].',%\' OR c.id = '.$page['category']['id'].' )
+  ';
+}
+
+$query .= '
+      '.$forbidden.'
+      ORDER BY i.average_rate DESC, i.id ASC
+    LIMIT 0, '.$datas['nb_images'].'
+  ;';
+
+$pictures = array();
+$selection = array_from_query($query, 'id');
+ 
+if (count($selection) > 0)
+{
+  $rank_of = array_flip($selection);
+
+  $query = '
+SELECT *
+  FROM '.IMAGES_TABLE.'
+  WHERE id IN ('.implode(',', $selection).')
+;';
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_assoc($result))
+  {
+    $row['rank'] = $rank_of[ $row['id'] ];
+
+    array_push($pictures, $row);
+  }
+
+  usort($pictures, 'rank_compare');
+  unset($rank_of);
+}
+
+if (count($pictures) > 0)
+{
+  if ($user['show_nb_comments'])
+  {
+    $query = '
+SELECT image_id, COUNT(*) AS nb_comments
+  FROM '.COMMENTS_TABLE.'
+  WHERE validated = \'true\'
+    AND image_id IN ('.implode(',', $selection).')
+  GROUP BY image_id
+;';
+    $nb_comments_of = simple_hash_from_query($query, 'image_id', 'nb_comments');
+  }
+
+  // template thumbnail initialization
+  $template->set_filenames( array( 'pwgs_best_rated' => 'thumbnails.tpl',));
+
+  trigger_action('loc_begin_index_thumbnails', $pictures);
+  $tpl_thumbnails_var = array();
+
+  foreach ($pictures as $row)
+  {
+    // link on picture.php page
+    $url = duplicate_picture_url(
+          array(
+            'image_id' => $row['id'],
+            'image_file' => $row['file']
+          ),
+          array('start')
+        );
+    $url = add_url_params($url, array('pwgs_br' => implode(',',$selection)));
+
+    $tpl_var =
+      array(
+        'ID'        => $row['id'],
+        'TN_SRC'    => get_thumbnail_url($row),
+        'TN_ALT'    => $row['file'],
+        'TN_TITLE'  => get_thumbnail_title($row),
+        'ICON_TS'   => get_icon($row['date_available']),
+        'URL'       => $url,
+
+     /* Fields for template-extension usage */
+        'FILE_PATH' => $row['path'],
+        'FILE_POSTED' => $row['date_available'],
+        'FILE_CREATED' => $row['date_creation'],
+        'FILE_DESC' => $row['comment'],
+        'FILE_AUTHOR' => $row['author'],
+        'FILE_HIT' => $row['hit'],
+        'FILE_SIZE' => $row['filesize'],
+        'FILE_WIDTH' => $row['width'],
+        'FILE_HEIGHT' => $row['height'],
+        'FILE_METADATE' => $row['date_metadata_update'],
+        'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
+                  true:false, /* lack of include/functions_picture.inc.php */
+      );
+
+    if ($user['show_nb_hits'])
+    {
+      $tpl_var['NB_HITS'] = $row['hit'];
+    }
+
+    if ($conf['show_thumbnail_caption'])
+    {// name of the picture
+      if (isset($row['name']) and $row['name'] != '')
+      {
+        $name = $row['name'];
+      }
+      else
+      {
+        $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
+      }
+
+      $tpl_var['NAME'] = '('.$row['average_rate'].') '.$name;
+    }
+
+    if ( isset($nb_comments_of) )
+    {
+      $tpl_var['NB_COMMENTS'] = (int)@$nb_comments_of[$row['id']];
+    }
+
+    $tpl_thumbnails_var[] = $tpl_var;
+  }
+
+  $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
+  $template->assign('thumbnails', $tpl_thumbnails_var);
+
+  $block['CONTENT'] = $template->parse('pwgs_best_rated', true);
+}
+else
+{
+  return false;
+}
+
+?>
Index: /extensions/PWG_Stuffs/modules/LastComs/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/LastComs/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/LastComs/config.inc.php	(revision 3300)
@@ -0,0 +1,47 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!isset($datas)) $datas = array(5, 'on', 'default', '', '');
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']) and !is_adviser())
+{
+  if (empty($_POST['nb_comments']))
+  {
+    array_push($page['errors'], l10n('lastcoms_no_nb_comments'));
+  }
+  else
+  {
+    if (!isset($_POST['show_admin_buttons']))
+    {
+      $_POST['show_admin_buttons'] = 'off';
+    }
+    $datas = array(
+      $_POST['nb_comments'],
+      $_POST['show_admin_buttons'],
+      $_POST['nb_cadres'],
+      $_POST['width'],
+      $_POST['height']
+      );
+  }
+}
+
+// Parametrage du template
+$template->assign('nb_cadres', array(
+  'OPTIONS' => array('default' => 'default', 1 => 1, 2 => 2, 3 => 3),
+  'SELECTED' => $datas[2]));
+
+$template->assign(array(
+  'NB_COMMENTS' => $datas[0],
+  'WIDTH'       => $datas[3],
+  'HEIGHT'      => $datas[4]
+));
+if ($datas[1] == 'on')
+{
+  $template->assign(array('SHOW_ADMIN_BUTTONS' => 'checked="checked"'));
+}
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/LastComs/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/LastComs/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/LastComs/config.tpl	(revision 3300)
@@ -0,0 +1,29 @@
+<table>
+	<tr>
+		<td align="right"><br>{'lastcoms_nb_comments'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+		<input type="text" size="3" maxlength="2" value="{$NB_COMMENTS}" name="nb_comments"/></td>
+	</tr>
+	<tr>
+		<td align="right"><br>{'lastcoms_show_buttons'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+		<input type="checkbox" name="show_admin_buttons" value="on" {$SHOW_ADMIN_BUTTONS}/></td>
+	</tr>
+  <tr>
+		<td align="right"><br>{'lastcoms_nb_cadres'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+    {html_options name=nb_cadres options=$nb_cadres.OPTIONS selected=$nb_cadres.SELECTED}
+    </td>
+	</tr>
+  <tr>
+		<td align="right"><br>{'lastcoms_dim'|@translate} : &nbsp;&nbsp; {'lastcoms_width'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+		<input type="text" size="3" maxlength="3" value="{$WIDTH}" name="width"/>&nbsp;px</td>
+	</tr>
+	<tr>
+		<td align="right">{'lastcoms_height'|@translate} &nbsp;&nbsp;</td>
+		<td>
+		<input type="text" size="3" maxlength="3" value="{$HEIGHT}" name="height"/>&nbsp;px</td>
+	</tr>
+</table>
+<br>
Index: /extensions/PWG_Stuffs/modules/LastComs/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/LastComs/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/LastComs/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/LastComs/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/LastComs/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/LastComs/main.inc.php	(revision 3300)
@@ -0,0 +1,174 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+// |                         comments management                           |
+// +-----------------------------------------------------------------------+
+// comments deletion
+if (isset($_GET['delete']) and is_numeric($_GET['delete']) and is_admin() and !is_adviser())
+{
+    check_status(ACCESS_ADMINISTRATOR);
+    $query = '
+DELETE FROM ' . COMMENTS_TABLE . '
+  WHERE id=' . $_GET['delete'] . '
+;';
+    pwg_query($query);
+}
+
+// comments validation
+if (isset($_GET['validate']) and is_numeric($_GET['validate']) and is_admin() and !is_adviser())
+{
+    check_status(ACCESS_ADMINISTRATOR);
+    $query = '
+UPDATE ' . COMMENTS_TABLE . '
+  SET validated = \'true\'
+  , validation_date = NOW()
+  WHERE id=' . $_GET['validate'] . '
+;';
+    pwg_query($query);
+}
+
+// +-----------------------------------------------------------------------+
+// |                        last comments display                          |
+// +-----------------------------------------------------------------------+
+$comments = array();
+$element_ids = array();
+$category_ids = array();
+$max_width = 0;
+if (!is_admin())
+{
+  $clauses[] = 'validated="true"';
+}
+$clauses[] = get_sql_condition_FandF (
+    array ('forbidden_categories' => 'category_id',
+        'visible_categories' => 'category_id',
+        'visible_images' => 'ic.image_id'), '', true);
+
+$query = 'SELECT com.id AS comment_id
+   , com.image_id
+   , ic.category_id
+   , com.author
+   , com.date
+   , com.content
+   , com.id AS comment_id
+   , com.validated
+   FROM ' . IMAGE_CATEGORY_TABLE . ' AS ic
+   INNER JOIN ' . COMMENTS_TABLE . ' AS com
+   ON ic.image_id = com.image_id
+   WHERE ' . implode(' AND ', $clauses) . '
+    GROUP BY comment_id
+    ORDER BY date DESC
+    LIMIT 0, ' . $datas[0] . ';';
+
+$result = pwg_query($query);
+while ($row = mysql_fetch_assoc($result))
+{
+  array_push($comments, $row);
+  array_push($element_ids, $row['image_id']);
+  array_push($category_ids, $row['category_id']);
+}
+
+if (count($comments) > 0)
+{
+  $block['TITLE_URL'] = 'comments.php';
+  $block['comments'] = array();
+
+  // retrieving element informations
+  $elements = array();
+  $query = '
+SELECT id, name, file, path, tn_ext
+  FROM '.IMAGES_TABLE.'
+  WHERE id IN ('.implode(',', $element_ids).')
+;';
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_assoc($result))
+  {
+    $elements[$row['id']] = $row;
+  }
+
+  // retrieving category informations
+  $query = '
+SELECT id, name, permalink, uppercats
+  FROM '.CATEGORIES_TABLE.'
+  WHERE id IN ('.implode(',', $category_ids).')
+;';
+  $categories = hash_from_query($query, 'id');
+
+  foreach ($comments as $comment)
+  {
+    if (!empty($elements[$comment['image_id']]['name']))
+    {
+      $name=$elements[$comment['image_id']]['name'];
+    }
+    else
+    {
+      $name=get_name_from_file($elements[$comment['image_id']]['file']);
+    }
+
+    // source of the thumbnail picture
+    $thumbnail_src = get_thumbnail_url( $elements[$comment['image_id']] );
+
+    // link to the full size picture
+    $url = make_picture_url(
+            array(
+              'category' => $categories[ $comment['category_id'] ],
+              'image_id' => $comment['image_id'],
+              'image_file' => $elements[$comment['image_id']]['file'],
+            )
+          );
+
+    $author = $comment['author'];
+    if (empty($comment['author']))
+    {
+      $author = l10n('guest');
+    }
+
+    $tpl_comment =
+      array(
+        'U_PICTURE' => $url,
+        'TN_SRC' => $thumbnail_src,
+        'ALT' => $name,
+        'AUTHOR' => trigger_event('render_comment_author', $author),
+        'DATE' => format_date($comment['date'],'mysql_datetime',true),
+        'CONTENT' => trigger_event('render_comment_content',$comment['content']),
+        'WIDTH' => $datas[3],
+        'HEIGHT' => $datas[4],
+        );
+
+    switch ($datas[2])
+    {
+      case 1 :
+        $tpl_comment['CLASS'] = 'one_comment';
+        break;
+      case 2 :
+        $tpl_comment['CLASS'] = 'two_comment';
+        break;
+      case 3 :
+        $tpl_comment['CLASS'] = 'three_comment';
+        break;
+    }
+
+    if ( is_admin() )
+    {
+      $url = get_root_url().'index.php'.get_query_string_diff(array('delete','validate'));
+      $tpl_comment['U_DELETE'] = add_url_params($url,
+                          array('delete'=>$comment['comment_id'])
+                         );
+
+      if ($comment['validated'] != 'true')
+      {
+        $tpl_comment['U_VALIDATE'] = add_url_params($url,
+                            array('validate'=>$comment['comment_id'])
+                           );
+      }
+    }
+    array_push($block['comments'], $tpl_comment);
+  }
+}
+else
+{
+  return false;
+}
+
+?>
Index: /extensions/PWG_Stuffs/modules/Logon/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Logon/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Logon/config.inc.php	(revision 3300)
@@ -0,0 +1,23 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+unset($template->_tpldata['user_perm.'], $template->_tpldata['group_perm.']);
+$_POST['users'] = array('guest');
+
+if (!isset($datas)) $datas = array('0');
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']) and !is_adviser()) {
+	if (!isset($_POST['remove_menubar_block'])) $_POST['remove_menubar_block']  = '0';
+    $datas = array($_POST['remove_menubar_block']);
+}
+
+// Parametrage du template
+if ($datas[0] == '1') $template->assign(array('REMOVE_MENUBAR_BLOCK' => 'checked="checked"'));
+
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/Logon/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/Logon/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Logon/config.tpl	(revision 3300)
@@ -0,0 +1,1 @@
+<p><input type="checkbox" name="remove_menubar_block" value="1" {$REMOVE_MENUBAR_BLOCK}/>{'logon_remove_menubar_block'|@translate}</p><br>
Index: /extensions/PWG_Stuffs/modules/Logon/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Logon/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Logon/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/Logon/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Logon/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Logon/main.inc.php	(revision 3300)
@@ -0,0 +1,32 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!is_a_guest()) return false;
+
+global $conf;
+
+// template initialization
+$block = array_merge($block, 
+  array(
+    'U_LOST_PASSWORD' => get_root_url().'password.php',
+    'F_LOGIN_ACTION' => get_root_url().'identification.php',
+    'authorize_remembering' => $conf['authorize_remembering'],
+    ));
+
+if ($conf['allow_user_registration'])
+{
+  $block['U_REGISTER'] = get_root_url().'register.php';
+}
+
+// Retirer le bloc identification rapide du menubar
+if ($datas[0] == '1')
+{
+  add_event_handler('blockmanager_apply', 'stuffs_hide_identification');
+  function stuffs_hide_identification($menu_ref_arr)
+  {
+    $menu = & $menu_ref_arr[0];
+    $menu->hide_block('mbIdentification');
+  }
+}
+
+?>
Index: /extensions/PWG_Stuffs/modules/MostVisited/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/MostVisited/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/MostVisited/config.inc.php	(revision 3300)
@@ -0,0 +1,37 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!isset($datas))
+{
+  $datas = array(
+    'nb_images'     => 5,
+    'cat_display'   => 'all',
+    'cat_selection' => array(),
+  );
+}
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']) and !is_adviser())
+{
+  $datas = array(
+    'nb_images' => intval($_POST['nb_images']),
+    'cat_display' => $_POST['cat_display'],
+    'cat_selection' => $_POST['cat_selection'],
+    );
+  unset($_POST['on_picture']);
+}
+
+// Parametrage du template
+$query = 'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.';';
+display_select_cat_wrapper($query,array(),'category_selection');
+
+$template->assign(array(
+  'NB_IMAGES' => $datas['nb_images'],
+  'cat_display' => $datas['cat_display'],
+  'category_selected' => $datas['cat_selection']
+));
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/MostVisited/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/MostVisited/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/MostVisited/config.tpl	(revision 3300)
@@ -0,0 +1,88 @@
+{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
+{known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.resizable.packed.js"}
+
+<table>
+	<tr>
+		<td align="right"><br>{'stuffs_mv_nb_images'|@translate} &nbsp;&nbsp;</td>
+		<td><br><input type="text" name="nb_images" size="3" maxlength="2" value="{$NB_IMAGES}"></td>
+	</tr>
+	<tr class="cat_options" style="display: none;">
+		<td align="right"><br>{'stuffs_mv_category_display'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+      <select name="cat_display">
+        <option label="{'stuffs_mv_all_cats'|@translate}" value="all" {if $cat_display == 'all'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_all_cats'|@translate}</option>
+        <option label="{'stuffs_mv_wo_thumb'|@translate}" value="wo_thumb" {if $cat_display == 'wo_thumb'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_wo_thumb'|@translate}</option>
+        <option label="{'stuffs_mv_w_thumb'|@translate}" value="w_thumb" {if $cat_display == 'w_thumb'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_w_thumb'|@translate}</option>
+        <option label="{'stuffs_mv_selected_cats'|@translate}" value="selected_cats" {if $cat_display == 'selected_cats'}selected="selected"{/if} onClick="javascript: show_cat_list();">{'stuffs_mv_selected_cats'|@translate}</option>
+      </select>
+    </td>
+	</tr>
+	<tr class="cat_selection" style="display: none;">
+		<td align="right">
+      <br>{'stuffs_mv_cat_selection'|@translate} &nbsp;&nbsp;
+      <br>({'stuffs_mv_hold_ctrl'|@translate}) &nbsp;&nbsp;</td>
+		<td><br>
+		  <select class="categoryList" name="cat_selection[]" multiple="multiple" size="30">
+        {html_options options=$category_selection selected=$category_selected}
+      </select></td>
+	</tr>
+</table>
+<br>
+
+{literal}
+<script type="text/javascript">
+resize = false;
+function show_cat_list()
+{
+  jQuery('.cat_selection').show();
+  if (!resize)
+  {
+    resize = true;
+    jQuery('.categoryList').resizable({
+      handles: "all",
+      animate: true,
+      animateDuration: "slow",
+      animateEasing: "swing",
+      preventDefault: true,
+      preserveCursor: true,
+      autoHide: true,
+      ghost: true
+    });
+  }
+}
+
+function hide_cat_list()
+{
+  jQuery('.cat_selection').hide();
+}
+
+jQuery().ready( function () {
+  jQuery("input[name='on_cats']").click( function() {
+    if (this.checked)
+    {
+      jQuery('.cat_options').show();
+      if (jQuery("select[name='cat_display']").val() == 'selected_cats')
+        show_cat_list();
+    }
+    else
+    {
+      jQuery('.cat_options').hide();
+      hide_cat_list();
+    }
+  });
+});
+
+if (document.getElementsByName("on_cats")[0].checked)
+{
+  jQuery('.cat_options').show();
+  if (jQuery("select[name='cat_display']").val() == 'selected_cats')
+  {
+    show_cat_list();
+  }
+}
+
+jQuery("table:eq(1) tr:eq(5)").hide();
+</script>
+{/literal}
+
Index: /extensions/PWG_Stuffs/modules/MostVisited/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/MostVisited/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/MostVisited/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/MostVisited/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/MostVisited/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/MostVisited/main.inc.php	(revision 3300)
@@ -0,0 +1,168 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $page, $user, $conf, $template, $pwg_event_handlers, $yop;
+
+if (script_basename() == 'picture'
+  or ($datas['cat_display'] == 'wo_thumb' and !empty($page['items']))
+  or ($datas['cat_display'] == 'w_thumb' and empty($page['items']) and isset($page['category']))
+  or ($datas['cat_display'] == 'selected_cats' and isset($page['category']) and !in_array($page['category']['id'], $datas['cat_selection'])))
+{
+  return false;
+}
+
+$forbidden = get_sql_condition_FandF
+  (
+    array
+      (
+        'forbidden_categories' => 'ic.category_id',
+        'visible_categories' => 'ic.category_id',
+        'visible_images' => 'i.id'
+      ),
+    'AND'
+  );
+
+$query = '
+  SELECT DISTINCT (i.id)
+    FROM '.IMAGES_TABLE.' as i
+      INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+      INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id
+    WHERE i.hit > 0';
+
+if (isset($page['category']))
+{
+  $query .= '
+        AND ( c.uppercats LIKE \''.$page['category']['uppercats'].',%\' OR c.id = '.$page['category']['id'].' )
+  ';
+}
+
+$query .= '
+      '.$forbidden.'
+      ORDER BY i.hit DESC, i.file ASC
+    LIMIT 0, '.$datas['nb_images'].'
+  ;';
+
+$pictures = array();
+$selection = array_from_query($query, 'id');
+ 
+if (count($selection) > 0)
+{
+  $rank_of = array_flip($selection);
+
+  $query = '
+SELECT *
+  FROM '.IMAGES_TABLE.'
+  WHERE id IN ('.implode(',', $selection).')
+;';
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_assoc($result))
+  {
+    $row['rank'] = $rank_of[ $row['id'] ];
+
+    array_push($pictures, $row);
+  }
+
+  usort($pictures, 'rank_compare');
+  unset($rank_of);
+}
+
+if (count($pictures) > 0)
+{
+  if ($user['show_nb_comments'])
+  {
+    $query = '
+SELECT image_id, COUNT(*) AS nb_comments
+  FROM '.COMMENTS_TABLE.'
+  WHERE validated = \'true\'
+    AND image_id IN ('.implode(',', $selection).')
+  GROUP BY image_id
+;';
+    $nb_comments_of = simple_hash_from_query($query, 'image_id', 'nb_comments');
+  }
+
+  // template thumbnail initialization
+  $template->set_filenames( array( 'pwgs_most_visited' => 'thumbnails.tpl',));
+
+  trigger_action('loc_begin_index_thumbnails', $pictures);
+  $tpl_thumbnails_var = array();
+
+  foreach ($pictures as $row)
+  {
+    // link on picture.php page
+    $url = duplicate_picture_url(
+          array(
+            'image_id' => $row['id'],
+            'image_file' => $row['file']
+          ),
+          array('start')
+        );
+    $url = add_url_params($url, array('pwgs_mv' => implode(',',$selection)));
+
+    $tpl_var =
+      array(
+        'ID'        => $row['id'],
+        'TN_SRC'    => get_thumbnail_url($row),
+        'TN_ALT'    => $row['file'],
+        'TN_TITLE'  => get_thumbnail_title($row),
+        'ICON_TS'   => get_icon($row['date_available']),
+        'URL'       => $url,
+
+     /* Fields for template-extension usage */
+        'FILE_PATH' => $row['path'],
+        'FILE_POSTED' => $row['date_available'],
+        'FILE_CREATED' => $row['date_creation'],
+        'FILE_DESC' => $row['comment'],
+        'FILE_AUTHOR' => $row['author'],
+        'FILE_HIT' => $row['hit'],
+        'FILE_SIZE' => $row['filesize'],
+        'FILE_WIDTH' => $row['width'],
+        'FILE_HEIGHT' => $row['height'],
+        'FILE_METADATE' => $row['date_metadata_update'],
+        'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
+                  true:false, /* lack of include/functions_picture.inc.php */
+      );
+
+    if ($user['show_nb_hits'])
+    {
+      $tpl_var['NB_HITS'] = $row['hit'];
+    }
+
+    if ($conf['show_thumbnail_caption'])
+    {// name of the picture
+      if (isset($row['name']) and $row['name'] != '')
+      {
+        $name = $row['name'];
+      }
+      else
+      {
+        $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
+      }
+
+      if ( !$user['show_nb_hits'])
+      {
+        $name = '('.$row['hit'].') '.$name;
+      }
+
+      $tpl_var['NAME'] = $name;
+    }
+
+    if ( isset($nb_comments_of) )
+    {
+      $tpl_var['NB_COMMENTS'] = (int)@$nb_comments_of[$row['id']];
+    }
+
+    $tpl_thumbnails_var[] = $tpl_var;
+  }
+
+  $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
+  $template->assign('thumbnails', $tpl_thumbnails_var);
+
+  $block['CONTENT'] = $template->parse('pwgs_most_visited', true);
+}
+else
+{
+  return false;
+}
+
+?>
Index: /extensions/PWG_Stuffs/modules/Personal/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Personal/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Personal/config.inc.php	(revision 3300)
@@ -0,0 +1,22 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+if (!isset($datas)) $datas = array('');
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']) and !is_adviser()) {
+	$datas = array(stripslashes($_POST['personal_content']));
+}
+
+// Parametrage du template
+$template->assign('cat_style', array());
+$template->assign(array('PERSONAL_CONTENT' => $datas[0]));
+
+// TinyMCE
+trigger_action('tinymce', 'pwgstuffs');
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/Personal/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/Personal/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Personal/config.tpl	(revision 3300)
@@ -0,0 +1,7 @@
+<div style="text-align:center;">
+<br>
+<b>{'personal_content'|@translate}</b>
+<br>
+<textarea name="personal_content" id ="textarea" rows="10" cols="50" style="width:90%;">{$PERSONAL_CONTENT}</textarea>
+</div>
+<br>
Index: /extensions/PWG_Stuffs/modules/Personal/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Personal/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Personal/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/Personal/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Personal/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Personal/main.inc.php	(revision 3300)
@@ -0,0 +1,17 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+$block['CONTENT'] = $datas[0];
+
+// Extended description
+if (function_exists('get_extended_desc'))
+{
+  $block['CONTENT'] = get_extended_desc($block['CONTENT']);
+}
+else
+{
+  $block['CONTENT'] = get_user_language_desc($block['CONTENT']);
+}
+
+?>
Index: /extensions/PWG_Stuffs/modules/Random/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Random/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Random/config.inc.php	(revision 3300)
@@ -0,0 +1,37 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!isset($datas))
+{
+  $datas = array(
+    'nb_images'     => 10,
+    'cat_display'   => 'all',
+    'cat_selection' => array(),
+  );
+}
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']) and !is_adviser())
+{
+  $datas = array(
+    'nb_images' => intval($_POST['nb_images']),
+    'cat_display' => $_POST['cat_display'],
+    'cat_selection' => $_POST['cat_selection'],
+    );
+  unset($_POST['on_picture']);
+}
+
+// Parametrage du template
+$query = 'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.';';
+display_select_cat_wrapper($query,array(),'category_selection');
+
+$template->assign(array(
+  'NB_IMAGES' => $datas['nb_images'],
+  'cat_display' => $datas['cat_display'],
+  'category_selected' => $datas['cat_selection']
+));
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/Random/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/Random/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Random/config.tpl	(revision 3300)
@@ -0,0 +1,88 @@
+{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
+{known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.resizable.packed.js"}
+
+<table>
+	<tr>
+		<td align="right"><br>{'stuffs_mv_nb_images'|@translate} &nbsp;&nbsp;</td>
+		<td><br><input type="text" name="nb_images" size="3" maxlength="2" value="{$NB_IMAGES}"></td>
+	</tr>
+	<tr class="cat_options" style="display: none;">
+		<td align="right"><br>{'stuffs_mv_category_display'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+      <select name="cat_display">
+        <option label="{'stuffs_mv_all_cats'|@translate}" value="all" {if $cat_display == 'all'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_all_cats'|@translate}</option>
+        <option label="{'stuffs_mv_wo_thumb'|@translate}" value="wo_thumb" {if $cat_display == 'wo_thumb'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_wo_thumb'|@translate}</option>
+        <option label="{'stuffs_mv_w_thumb'|@translate}" value="w_thumb" {if $cat_display == 'w_thumb'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_w_thumb'|@translate}</option>
+        <option label="{'stuffs_mv_selected_cats'|@translate}" value="selected_cats" {if $cat_display == 'selected_cats'}selected="selected"{/if} onClick="javascript: show_cat_list();">{'stuffs_mv_selected_cats'|@translate}</option>
+      </select>
+    </td>
+	</tr>
+	<tr class="cat_selection" style="display: none;">
+		<td align="right">
+      <br>{'stuffs_mv_cat_selection'|@translate} &nbsp;&nbsp;
+      <br>({'stuffs_mv_hold_ctrl'|@translate}) &nbsp;&nbsp;</td>
+		<td><br>
+		  <select class="categoryList" name="cat_selection[]" multiple="multiple" size="30">
+        {html_options options=$category_selection selected=$category_selected}
+      </select></td>
+	</tr>
+</table>
+<br>
+
+{literal}
+<script type="text/javascript">
+resize = false;
+function show_cat_list()
+{
+  jQuery('.cat_selection').show();
+  if (!resize)
+  {
+    resize = true;
+    jQuery('.categoryList').resizable({
+      handles: "all",
+      animate: true,
+      animateDuration: "slow",
+      animateEasing: "swing",
+      preventDefault: true,
+      preserveCursor: true,
+      autoHide: true,
+      ghost: true
+    });
+  }
+}
+
+function hide_cat_list()
+{
+  jQuery('.cat_selection').hide();
+}
+
+jQuery().ready( function () {
+  jQuery("input[name='on_cats']").click( function() {
+    if (this.checked)
+    {
+      jQuery('.cat_options').show();
+      if (jQuery("select[name='cat_display']").val() == 'selected_cats')
+        show_cat_list();
+    }
+    else
+    {
+      jQuery('.cat_options').hide();
+      hide_cat_list();
+    }
+  });
+});
+
+if (document.getElementsByName("on_cats")[0].checked)
+{
+  jQuery('.cat_options').show();
+  if (jQuery("select[name='cat_display']").val() == 'selected_cats')
+  {
+    show_cat_list();
+  }
+}
+
+jQuery("table:eq(1) tr:eq(5)").hide();
+</script>
+{/literal}
+
Index: /extensions/PWG_Stuffs/modules/Random/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Random/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Random/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/Random/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Random/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Random/main.inc.php	(revision 3300)
@@ -0,0 +1,162 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $page, $user, $conf, $template;
+
+if (script_basename() == 'picture'
+  or ($datas['cat_display'] == 'wo_thumb' and !empty($page['items']))
+  or ($datas['cat_display'] == 'w_thumb' and empty($page['items']) and isset($page['category']))
+  or ($datas['cat_display'] == 'selected_cats' and isset($page['category']) and !in_array($page['category']['id'], $datas['cat_selection'])))
+{
+  return false;
+}
+
+$forbidden = get_sql_condition_FandF
+  (
+    array
+      (
+        'forbidden_categories' => 'ic.category_id',
+        'visible_categories' => 'ic.category_id',
+        'visible_images' => 'i.id'
+      ),
+    'WHERE'
+  );
+
+$query ='
+SELECT DISTINCT(i.id)
+  FROM '.IMAGES_TABLE.' AS i
+    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+    INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id
+    '.$forbidden;
+
+if (isset($page['category']))
+{
+  $query .= '
+        AND ( c.uppercats LIKE \''.$page['category']['uppercats'].',%\' OR c.id = '.$page['category']['id'].' )
+  ';
+}
+
+$query .= '
+    ORDER BY RAND(NOW())
+    LIMIT 0, '.$datas['nb_images'].'
+  ;';
+
+$pictures = array();
+$selection = array_from_query($query, 'id');
+ 
+if (count($selection) > 0)
+{
+  $rank_of = array_flip($selection);
+
+  $query = '
+SELECT *
+  FROM '.IMAGES_TABLE.'
+  WHERE id IN ('.implode(',', $selection).')
+;';
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_assoc($result))
+  {
+    $row['rank'] = $rank_of[ $row['id'] ];
+
+    array_push($pictures, $row);
+  }
+
+  usort($pictures, 'rank_compare');
+  unset($rank_of);
+}
+
+if (count($pictures) > 0)
+{
+  if ($user['show_nb_comments'])
+  {
+    $query = '
+SELECT image_id, COUNT(*) AS nb_comments
+  FROM '.COMMENTS_TABLE.'
+  WHERE validated = \'true\'
+    AND image_id IN ('.implode(',', $selection).')
+  GROUP BY image_id
+;';
+    $nb_comments_of = simple_hash_from_query($query, 'image_id', 'nb_comments');
+  }
+
+  // template thumbnail initialization
+  $template->set_filenames( array( 'pwgs_random' => 'thumbnails.tpl',));
+
+  trigger_action('loc_begin_index_thumbnails', $pictures);
+  $tpl_thumbnails_var = array();
+
+  foreach ($pictures as $row)
+  {
+    // link on picture.php page
+    $url = duplicate_picture_url(
+          array(
+            'image_id' => $row['id'],
+            'image_file' => $row['file']
+          ),
+          array('start')
+        );
+    $url = add_url_params($url, array('pwgs_ra' => implode(',',$selection)));
+
+    $tpl_var =
+      array(
+        'ID'        => $row['id'],
+        'TN_SRC'    => get_thumbnail_url($row),
+        'TN_ALT'    => $row['file'],
+        'TN_TITLE'  => get_thumbnail_title($row),
+        'ICON_TS'   => get_icon($row['date_available']),
+        'URL'       => $url,
+
+     /* Fields for template-extension usage */
+        'FILE_PATH' => $row['path'],
+        'FILE_POSTED' => $row['date_available'],
+        'FILE_CREATED' => $row['date_creation'],
+        'FILE_DESC' => $row['comment'],
+        'FILE_AUTHOR' => $row['author'],
+        'FILE_HIT' => $row['hit'],
+        'FILE_SIZE' => $row['filesize'],
+        'FILE_WIDTH' => $row['width'],
+        'FILE_HEIGHT' => $row['height'],
+        'FILE_METADATE' => $row['date_metadata_update'],
+        'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
+                  true:false, /* lack of include/functions_picture.inc.php */
+      );
+
+    if ($user['show_nb_hits'])
+    {
+      $tpl_var['NB_HITS'] = $row['hit'];
+    }
+
+    if ($conf['show_thumbnail_caption'])
+    {// name of the picture
+      if (isset($row['name']) and $row['name'] != '')
+      {
+        $name = $row['name'];
+      }
+      else
+      {
+        $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
+      }
+
+      $tpl_var['NAME'] = $name;
+    }
+
+    if ( isset($nb_comments_of) )
+    {
+      $tpl_var['NB_COMMENTS'] = (int)@$nb_comments_of[$row['id']];
+    }
+
+    $tpl_thumbnails_var[] = $tpl_var;
+  }
+
+  $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
+  $template->assign('thumbnails', $tpl_thumbnails_var);
+
+  $block['CONTENT'] = $template->parse('pwgs_random', true);
+}
+else
+{
+  return false;
+}
+
+?>
Index: /extensions/PWG_Stuffs/modules/Recent/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Recent/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Recent/config.inc.php	(revision 3300)
@@ -0,0 +1,37 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!isset($datas))
+{
+  $datas = array(
+    'nb_images'     => 10,
+    'cat_display'   => 'all',
+    'cat_selection' => array(),
+  );
+}
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']) and !is_adviser())
+{
+  $datas = array(
+    'nb_images' => intval($_POST['nb_images']),
+    'cat_display' => $_POST['cat_display'],
+    'cat_selection' => $_POST['cat_selection'],
+    );
+  unset($_POST['on_picture']);
+}
+
+// Parametrage du template
+$query = 'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.';';
+display_select_cat_wrapper($query,array(),'category_selection');
+
+$template->assign(array(
+  'NB_IMAGES' => $datas['nb_images'],
+  'cat_display' => $datas['cat_display'],
+  'category_selected' => $datas['cat_selection']
+));
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/Recent/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/Recent/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Recent/config.tpl	(revision 3300)
@@ -0,0 +1,88 @@
+{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
+{known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.resizable.packed.js"}
+
+<table>
+	<tr>
+		<td align="right"><br>{'stuffs_mv_nb_images'|@translate} &nbsp;&nbsp;</td>
+		<td><br><input type="text" name="nb_images" size="3" maxlength="2" value="{$NB_IMAGES}"></td>
+	</tr>
+	<tr class="cat_options" style="display: none;">
+		<td align="right"><br>{'stuffs_mv_category_display'|@translate} &nbsp;&nbsp;</td>
+		<td><br>
+      <select name="cat_display">
+        <option label="{'stuffs_mv_all_cats'|@translate}" value="all" {if $cat_display == 'all'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_all_cats'|@translate}</option>
+        <option label="{'stuffs_mv_wo_thumb'|@translate}" value="wo_thumb" {if $cat_display == 'wo_thumb'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_wo_thumb'|@translate}</option>
+        <option label="{'stuffs_mv_w_thumb'|@translate}" value="w_thumb" {if $cat_display == 'w_thumb'}selected="selected"{/if} onClick="javascript: hide_cat_list();">{'stuffs_mv_w_thumb'|@translate}</option>
+        <option label="{'stuffs_mv_selected_cats'|@translate}" value="selected_cats" {if $cat_display == 'selected_cats'}selected="selected"{/if} onClick="javascript: show_cat_list();">{'stuffs_mv_selected_cats'|@translate}</option>
+      </select>
+    </td>
+	</tr>
+	<tr class="cat_selection" style="display: none;">
+		<td align="right">
+      <br>{'stuffs_mv_cat_selection'|@translate} &nbsp;&nbsp;
+      <br>({'stuffs_mv_hold_ctrl'|@translate}) &nbsp;&nbsp;</td>
+		<td><br>
+		  <select class="categoryList" name="cat_selection[]" multiple="multiple" size="30">
+        {html_options options=$category_selection selected=$category_selected}
+      </select></td>
+	</tr>
+</table>
+<br>
+
+{literal}
+<script type="text/javascript">
+resize = false;
+function show_cat_list()
+{
+  jQuery('.cat_selection').show();
+  if (!resize)
+  {
+    resize = true;
+    jQuery('.categoryList').resizable({
+      handles: "all",
+      animate: true,
+      animateDuration: "slow",
+      animateEasing: "swing",
+      preventDefault: true,
+      preserveCursor: true,
+      autoHide: true,
+      ghost: true
+    });
+  }
+}
+
+function hide_cat_list()
+{
+  jQuery('.cat_selection').hide();
+}
+
+jQuery().ready( function () {
+  jQuery("input[name='on_cats']").click( function() {
+    if (this.checked)
+    {
+      jQuery('.cat_options').show();
+      if (jQuery("select[name='cat_display']").val() == 'selected_cats')
+        show_cat_list();
+    }
+    else
+    {
+      jQuery('.cat_options').hide();
+      hide_cat_list();
+    }
+  });
+});
+
+if (document.getElementsByName("on_cats")[0].checked)
+{
+  jQuery('.cat_options').show();
+  if (jQuery("select[name='cat_display']").val() == 'selected_cats')
+  {
+    show_cat_list();
+  }
+}
+
+jQuery("table:eq(1) tr:eq(5)").hide();
+</script>
+{/literal}
+
Index: /extensions/PWG_Stuffs/modules/Recent/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Recent/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Recent/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/Recent/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Recent/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Recent/main.inc.php	(revision 3300)
@@ -0,0 +1,164 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $page, $user, $conf, $template;
+
+if (script_basename() == 'picture'
+  or ($datas['cat_display'] == 'wo_thumb' and !empty($page['items']))
+  or ($datas['cat_display'] == 'w_thumb' and empty($page['items']) and isset($page['category']))
+  or ($datas['cat_display'] == 'selected_cats' and isset($page['category']) and !in_array($page['category']['id'], $datas['cat_selection'])))
+{
+  return false;
+}
+
+$forbidden = get_sql_condition_FandF
+  (
+    array
+      (
+        'forbidden_categories' => 'ic.category_id',
+        'visible_categories' => 'ic.category_id',
+        'visible_images' => 'i.id'
+      ),
+    'AND'
+  );
+
+$query ='
+SELECT DISTINCT(i.id)
+  FROM '.IMAGES_TABLE.' AS i
+    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+    INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id
+  WHERE i.date_available >= SUBDATE(
+      CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)';
+
+if (isset($page['category']))
+{
+  $query .= '
+        AND ( c.uppercats LIKE \''.$page['category']['uppercats'].',%\' OR c.id = '.$page['category']['id'].' )
+  ';
+}
+
+$query .= '
+    '.$forbidden.'
+    '. str_replace('ORDER BY ', 'ORDER BY date_available DESC, ', $conf['order_by']).'
+    LIMIT 0, '.$datas['nb_images'].'
+  ;';
+
+$pictures = array();
+$selection = array_from_query($query, 'id');
+ 
+if (count($selection) > 0)
+{
+  $rank_of = array_flip($selection);
+
+  $query = '
+SELECT *
+  FROM '.IMAGES_TABLE.'
+  WHERE id IN ('.implode(',', $selection).')
+;';
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_assoc($result))
+  {
+    $row['rank'] = $rank_of[ $row['id'] ];
+
+    array_push($pictures, $row);
+  }
+
+  usort($pictures, 'rank_compare');
+  unset($rank_of);
+}
+
+if (count($pictures) > 0)
+{
+  if ($user['show_nb_comments'])
+  {
+    $query = '
+SELECT image_id, COUNT(*) AS nb_comments
+  FROM '.COMMENTS_TABLE.'
+  WHERE validated = \'true\'
+    AND image_id IN ('.implode(',', $selection).')
+  GROUP BY image_id
+;';
+    $nb_comments_of = simple_hash_from_query($query, 'image_id', 'nb_comments');
+  }
+
+  // template thumbnail initialization
+  $template->set_filenames( array( 'pwgs_recent' => 'thumbnails.tpl',));
+
+  trigger_action('loc_begin_index_thumbnails', $pictures);
+  $tpl_thumbnails_var = array();
+
+  foreach ($pictures as $row)
+  {
+    // link on picture.php page
+    $url = duplicate_picture_url(
+          array(
+            'image_id' => $row['id'],
+            'image_file' => $row['file']
+          ),
+          array('start')
+        );
+    $url = add_url_params($url, array('pwgs_re' => implode(',',$selection)));
+
+    $tpl_var =
+      array(
+        'ID'        => $row['id'],
+        'TN_SRC'    => get_thumbnail_url($row),
+        'TN_ALT'    => $row['file'],
+        'TN_TITLE'  => get_thumbnail_title($row),
+        'ICON_TS'   => get_icon($row['date_available']),
+        'URL'       => $url,
+
+     /* Fields for template-extension usage */
+        'FILE_PATH' => $row['path'],
+        'FILE_POSTED' => $row['date_available'],
+        'FILE_CREATED' => $row['date_creation'],
+        'FILE_DESC' => $row['comment'],
+        'FILE_AUTHOR' => $row['author'],
+        'FILE_HIT' => $row['hit'],
+        'FILE_SIZE' => $row['filesize'],
+        'FILE_WIDTH' => $row['width'],
+        'FILE_HEIGHT' => $row['height'],
+        'FILE_METADATE' => $row['date_metadata_update'],
+        'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
+                  true:false, /* lack of include/functions_picture.inc.php */
+      );
+
+    if ($user['show_nb_hits'])
+    {
+      $tpl_var['NB_HITS'] = $row['hit'];
+    }
+
+    if ($conf['show_thumbnail_caption'])
+    {// name of the picture
+      if (isset($row['name']) and $row['name'] != '')
+      {
+        $name = $row['name'];
+      }
+      else
+      {
+        $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
+      }
+
+      $tpl_var['NAME'] = $name;
+    }
+
+    if ( isset($nb_comments_of) )
+    {
+      $tpl_var['NB_COMMENTS'] = (int)@$nb_comments_of[$row['id']];
+    }
+
+    $tpl_thumbnails_var[] = $tpl_var;
+  }
+
+  $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
+  $template->assign('thumbnails', $tpl_thumbnails_var);
+
+  $block['CONTENT'] = $template->parse('pwgs_recent', true);
+}
+else
+{
+  return false;
+}
+
+?>
Index: /extensions/PWG_Stuffs/modules/Tags/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Tags/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Tags/config.inc.php	(revision 3300)
@@ -0,0 +1,17 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (empty($datas)) $datas = array('cloud');
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']) and !is_adviser())
+{
+  $datas = array($_POST['tag_display']);
+}
+
+$template->assign($datas[0].'_CHECKED', 'checked="checked"');
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/Tags/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/Tags/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Tags/config.tpl	(revision 3300)
@@ -0,0 +1,13 @@
+<table>
+  <tr>
+    <td>{'stuffs_tags_default_display'|@translate} :</td>
+    <td>&nbsp;&nbsp;<input type="radio" name="tag_display" value="cloud" {$cloud_CHECKED}>&nbsp;&nbsp;<i>{'stuffs_tags_cloud'|@translate}</i></td>
+  </tr>
+  <tr><td></td>
+    <td>&nbsp;&nbsp;<input type="radio" name="tag_display" value="letters" {$letters_CHECKED}>&nbsp;&nbsp;<i>{'stuffs_tags_letters'|@translate}</i></td>
+  </tr>
+  <tr><td></td>
+    <td>&nbsp;&nbsp;<input type="radio" name="tag_display" value="cumulus" {$cumulus_CHECKED}>&nbsp;&nbsp;<i>{'stuffs_tags_cumulus'|@translate}</i></td>
+  </tr>
+  <tr><td colspan="2"><br></td></tr>
+</table>
Index: /extensions/PWG_Stuffs/modules/Tags/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Tags/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Tags/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/Tags/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/Tags/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/Tags/main.inc.php	(revision 3300)
@@ -0,0 +1,150 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $conf, $template;
+
+function counter_compare($a, $b)
+{
+  if ($a['counter'] == $b['counter'])
+  {
+    return id_compare($a, $b);
+  }
+
+  return ($a['counter'] < $b['counter']) ? +1 : -1;
+}
+
+function id_compare($a, $b)
+{
+  return ($a['id'] < $b['id']) ? -1 : 1;
+}
+
+$pwgCumulus_installed = get_db_plugins('active','pwgCumulus');
+
+$block['TITLE_URL'] = 'tags.php';
+
+$tags = get_available_tags();
+
+if ((!$pwgCumulus_installed and $datas[0] == 'cumulus') or empty($datas[0]))
+{
+  $datas[0] = 'cloud';
+}
+
+if ($datas[0] == 'letters')
+{
+  // we want tags diplayed in alphabetic order
+  usort($tags, 'tag_alpha_compare');
+
+  $current_letter = null;
+  $nb_tags = count($tags);
+  $current_column = 1;
+  $current_tag_idx = 0;
+
+  $letter = array(
+    'tags' => array()
+    );
+
+  foreach ($tags as $tag)
+  {
+    $tag_letter = strtoupper(substr($tag['url_name'], 0, 1));
+
+    if ($current_tag_idx==0) {
+      $current_letter = $tag_letter;
+      $letter['TITLE'] = $tag_letter;
+    }
+
+    //lettre precedente differente de la lettre suivante
+    if ($tag_letter !== $current_letter)
+    {
+      if ($current_column<$conf['tag_letters_column_number']
+          and $current_tag_idx > $current_column*$nb_tags/$conf['tag_letters_column_number'] )
+      {
+        $letter['CHANGE_COLUMN'] = true;
+        $current_column++;
+      }
+
+      $letter['TITLE'] = $current_letter;
+
+      $template->append(
+        'letters',
+        $letter
+        );
+
+      $current_letter = $tag_letter;
+      $letter = array(
+        'tags' => array()
+        );
+    }
+
+    array_push(
+      $letter['tags'],
+      array_merge(
+        $tag,
+        array(
+          'URL' => make_index_url(
+            array(
+              'tags' => array($tag),
+              )
+            ),
+          )
+        )
+      );
+
+    $current_tag_idx++;
+  }
+
+  // flush last letter
+  if (count($letter['tags']) > 0)
+  {
+    unset($letter['CHANGE_COLUMN']);
+    $letter['TITLE'] = $current_letter;
+    $template->append(
+      'letters',
+      $letter
+      );
+  }
+}
+else
+{
+  usort($tags, 'counter_compare');
+  $tags = array_slice($tags, 0, $conf['full_tag_cloud_items_number']);
+
+  // depending on its counter and the other tags counter, each tag has a level
+  $tags = add_level_to_tags($tags);
+
+  // we want tags diplayed in alphabetic order
+  usort($tags, 'tag_alpha_compare');
+
+  // display sorted tags
+  foreach ($tags as $tag)
+  {
+    $template->append(
+      'tags',
+      array_merge(
+        $tag,
+        array(
+          'URL' => make_index_url(
+            array(
+              'tags' => array($tag),
+              )
+            ),
+          )
+        )
+      );
+  }
+  if ($datas[0] == 'cumulus')
+  {
+    include_once PWG_CUMULUS_PLUGIN_ROOT . "/include/pwgCumulusContent.class.php";
+    $cumulus = new pwgCumulusContent(get_plugin_data('pwgCumulus'));
+    $cumulus->loc_begin_page_header();
+  }
+}
+
+$template->assign('display_mode', $datas[0]);
+
+if (get_db_plugins('active','typetags'))
+{
+  include(typetags_PATH . 'typetags.php');
+}
+
+?>
Index: /extensions/PWG_Stuffs/modules/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/piclenswall/config.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/piclenswall/config.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/piclenswall/config.inc.php	(revision 3300)
@@ -0,0 +1,15 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Parametrage du template
+$template->assign(array(
+  'piclens_installed' => get_db_plugins('active','piclens'),
+  'crossdomain_file' => file_exists($_SERVER['DOCUMENT_ROOT'].'/crossdomain.xml'),
+  'crossdomain_url' => PHPWG_PLUGINS_PATH.'piclens/crossdomain.xml',
+));
+
+$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
+$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
+
+?>
Index: /extensions/PWG_Stuffs/modules/piclenswall/config.tpl
===================================================================
--- /extensions/PWG_Stuffs/modules/piclenswall/config.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/piclenswall/config.tpl	(revision 3300)
@@ -0,0 +1,17 @@
+{if !$piclens_installed or !$crossdomain_file}
+<p style="text-align: left;"><i><b>{'piclenswall_info'|@translate} :</b>
+{if !$piclens_installed}
+  {'piclenswall_info_piclens'|@translate}
+{elseif !$crossdomain_file}
+  {'piclenswall_info_crossdomain'|@translate|@sprintf:$crossdomain_url}
+{/if}
+</i></p>
+<p>&nbsp;</p>
+{else}
+<p>{'piclenswall_info_param'|@translate}</p>
+<p>&nbsp;</p>
+{/if}
+
+<script type="text/javascript">
+jQuery("table:eq(1) tr:eq(5)").hide();
+</script>
Index: /extensions/PWG_Stuffs/modules/piclenswall/index.php
===================================================================
--- /extensions/PWG_Stuffs/modules/piclenswall/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/piclenswall/index.php	(revision 3300)
@@ -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/PWG_Stuffs/modules/piclenswall/main.inc.php
===================================================================
--- /extensions/PWG_Stuffs/modules/piclenswall/main.inc.php	(revision 3300)
+++ /extensions/PWG_Stuffs/modules/piclenswall/main.inc.php	(revision 3300)
@@ -0,0 +1,50 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $page;
+
+// RSS Feed only available in category or index gallery
+if (get_db_plugins('active','piclens') and isset($page['section']) and $page['section'] == 'categories')
+{
+  include_once PHPWG_ROOT_PATH.'plugins/piclens/include/Piclens.class.php';
+
+  $obj = new Piclens();
+  $obj->load_config();
+
+  $rssfeed = '';
+
+  if( empty($page['category']))
+  {
+    $rssfeed = get_root_url().PICLENS_PATH.'piclenswall-rss.php?/categories';
+  }
+  else
+  {
+	// remplacement naviagation ne doit pas etre active et mis en place sur la page...
+		if (!@$obj->my_config['piclens_wall_nav'] or !@in_array($page['category']['id'], $obj->my_config['piclens_wall_cat_nav_replace']))
+		{				
+			if (@$obj->my_config['piclens_wall_specif'] == 'common') // pas de specificites 3DWall : utilisation des parametres piclens
+      {
+				$rssfeed = get_root_url().PICLENS_PATH.'piclens-rss.php?/category/'.(empty($page['category']['permalink']) ? $page['category']['id'] : $page['category']['permalink']);
+      }
+			elseif (@in_array($page['category']['id'], $obj->my_config['piclens_wall_categories']))
+			{
+				//  categorie pour laquelle le mur est parametre.
+				$rssfeed = get_root_url().PICLENS_PATH.'piclenswall-rss.php?/category/'.(empty($page['category']['permalink']) ? $page['category']['id'] : $page['category']['permalink']);
+			}
+		}
+  }
+  $block['RSSFEED'] = $rssfeed;
+  $block['PIC_HEIGHT']  = @$obj->my_config['piclens_wall_height']; //$datas[0];
+  $block['COLOR']  = @$obj->my_config['piclens_wall_color']; //$datas[1];
+  $block['SHOWFULLSCREEN'] = (@$obj->my_config['piclens_wall_showfullscreen'] ? "true" : "false");
+  $block['SHOWEMBED'] = (@$obj->my_config['piclens_wall_showembed'] ? "true" : "false");
+  $block['SHOWSEARCH'] = (@$obj->my_config['piclens_wall_showsearch'] ? "true" : "false");
+  $block['TRANSPARENT'] = @$obj->my_config['piclens_wall_transparent'];
+}
+else
+{
+  return false;
+}
+	
+?>
Index: /extensions/PWG_Stuffs/template/BestRated.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/BestRated.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/BestRated.tpl	(revision 3300)
@@ -0,0 +1,1 @@
+{$block.CONTENT}
Index: /extensions/PWG_Stuffs/template/LastComs.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/LastComs.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/LastComs.tpl	(revision 3300)
@@ -0,0 +1,43 @@
+<div id="comments">
+<ul class="thumbnailCategories">
+{foreach from=$block.comments item=comment}
+<li {if isset($comment.CLASS)}class="{$comment.CLASS}"{/if}>
+	<div class="thumbnailCategory">
+    {if isset($comment.TN_SRC)}
+    <div class="illustration">
+      <a href="{$comment.U_PICTURE}">
+        <img src="{$comment.TN_SRC}" alt="{$comment.ALT}"
+          style="{if !empty($comment.WIDTH)}max-width: {$comment.WIDTH}px; {/if}{if !empty($comment.HEIGHT)}max-height: {$comment.HEIGHT}px; {/if}"/>
+      </a>
+    </div>
+    {/if}
+    <div class="description">
+      {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) }
+      <ul class="actions" style="float:right">
+        {if !empty($comment.U_DELETE)}
+        <li>
+          <a href="{$comment.U_DELETE}" title="{'delete this comment'|@translate}">
+            <img src="{$ROOT_URL}{$themeconf.icon_dir}/delete.png" class="button" alt="[delete]" />
+          </a>
+        </li>
+        {/if}
+        {if !empty($comment.U_VALIDATE)}
+        <li>
+          <a href="{$comment.U_VALIDATE}" title="validate this comment">
+            <img src="{$ROOT_URL}{$themeconf.icon_dir}/validate_s.png" class="button" alt="[validate]" />
+          </a>
+        </li>
+        {/if}
+      </ul>
+      {/if}
+      <span class="author">{$comment.AUTHOR}</span> - <span class="date">{$comment.DATE}</span>
+      <blockquote>{$comment.CONTENT}</blockquote>
+    </div>
+  </div>
+</li>
+{if isset($comment_separator)}
+<hr/>
+{/if}
+{/foreach}
+</ul>
+</div>
Index: /extensions/PWG_Stuffs/template/Logon.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/Logon.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/Logon.tpl	(revision 3300)
@@ -0,0 +1,42 @@
+<div class="logon_block">
+<form action="{$block.F_LOGIN_ACTION}" method="post" name="login_form" class="properties">
+  <fieldset>
+    <legend>{'Connection settings'|@translate}</legend>
+
+    <ul>
+      <li>
+        <span class="property">
+          <label for="username">{'Username'|@translate}</label>
+        </span>
+        <input tabindex="1" class="login" type="text" name="username" id="username" size="25" maxlength="40" />
+      </li>
+
+      <li>
+        <span class="property">
+          <label for="password">{'Password'|@translate}</label>
+        </span>
+        <input tabindex="2" class="login" type="password" name="password" id="password" size="25" maxlength="25" />
+      </li>
+
+      {if $block.authorize_remembering }
+      <li>
+        <span class="property">
+          <label for="remember_me">{'remember_me'|@translate}</label>
+        </span>
+        <input tabindex="3" type="checkbox" name="remember_me" id="remember_me" value="1">
+      </li>
+      {/if}
+    </ul>
+  </fieldset>
+
+  <p><input class="submit" tabindex="4" type="submit" name="login" value="{'Submit'|@translate}"></p>
+
+  <p>
+    {if isset($block.U_REGISTER) }
+    <a href="{$block.U_REGISTER}" title="{'Create a new account'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/register.png" class="button" alt="{'Register'|@translate}"> {'Register'|@translate}</a>
+    {/if}
+    <a href="{$block.U_LOST_PASSWORD}" title="{'Forgot your password?'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/lost_password.png" class="button" alt="{'Forgot your password?'|@translate}"> {'Forgot your password?'|@translate}</a>
+  </p>
+
+</form>
+</div>
Index: /extensions/PWG_Stuffs/template/MostVisited.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/MostVisited.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/MostVisited.tpl	(revision 3300)
@@ -0,0 +1,1 @@
+{$block.CONTENT}
Index: /extensions/PWG_Stuffs/template/Personal.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/Personal.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/Personal.tpl	(revision 3300)
@@ -0,0 +1,3 @@
+<div class="personal_block">
+{$block.CONTENT}
+</div>
Index: /extensions/PWG_Stuffs/template/Random.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/Random.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/Random.tpl	(revision 3300)
@@ -0,0 +1,1 @@
+{$block.CONTENT}
Index: /extensions/PWG_Stuffs/template/Recent.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/Recent.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/Recent.tpl	(revision 3300)
@@ -0,0 +1,1 @@
+{$block.CONTENT}
Index: /extensions/PWG_Stuffs/template/Tags.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/Tags.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/Tags.tpl	(revision 3300)
@@ -0,0 +1,49 @@
+{if $display_mode == 'cloud'}
+<div id="fullTagCloud">
+	{foreach from=$tags item=tag}
+	<span><a href="{$tag.URL}" class="tagLevel{$tag.level}" title="{$tag.counter}">{$tag.name}</a></span>
+	{/foreach}
+</div>
+
+{elseif $display_mode == 'letters'}
+<table>
+  <tr>
+    <td valign="top">
+  {foreach from=$letters item=letter}
+<fieldset class="tagLetter">
+  <legend class="tagLetterLegend">{$letter.TITLE}</legend>
+  <table class="tagLetterContent">
+    {foreach from=$letter.tags item=tag}
+    <tr class="tagLine">
+      <td><a href="{$tag.URL}">{$tag.name}</a></td>
+      <td class="nbEntries">{$pwg->l10n_dec('%d element', '%d elements', $tag.counter)}</td>
+    </tr>
+    {/foreach}
+  </table>
+</fieldset>
+    {if isset($letter.CHANGE_COLUMN) }
+    </td>
+    <td valign="top">
+    {/if}
+  {/foreach}
+    </td>
+  </tr>
+</table>
+
+{elseif $display_mode == 'cumulus'}
+<div id="flashcontent">This will be shown to users with no Flash or Javascript.</div>
+
+  <script type="text/javascript">
+    var so = new SWFObject("{$PWG_CUMULUS_SWF}/tagcloud.swf", "tagcloud", "100%", "{$PWG_CUMULUS_HEIGHT}", "7", "#FFFFFF");
+    so.addParam("wmode", "transparent");
+    so.addVariable("tcolor", "{$PWG_CUMULUS_COLOR1}");
+    so.addVariable("tcolor2", "{$PWG_CUMULUS_COLOR2}");
+    so.addVariable("hicolor", "{$PWG_CUMULUS_HICOLOR}");
+    so.addVariable("mode", "tags");
+    so.addVariable("distr", "true");
+    so.addVariable("tspeed", "100");
+    so.addVariable("tagcloud", 
+    "<tags>{foreach from=$tags item=tag}<a href='{$tag.URL}' style='{$tag.size}pt'>{$tag.display_name}</a>{/foreach}</tags>");
+    so.write("flashcontent");
+  </script>
+{/if}
Index: /extensions/PWG_Stuffs/template/blocks.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/blocks.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/blocks.tpl	(revision 3300)
@@ -0,0 +1,27 @@
+<div class="content stuffs_block">
+{foreach from=$blocks item=block key=key}
+  {if $block.new_line}
+  <div class="content stuffs_block stuffs">
+  {/if}
+    <div id="stuffs_block_{$block.ID}" class="content {$block.CLASS}" {if !empty($block.WIDTH)}style="width: {$block.WIDTH}%;"{/if}>
+    {if isset($block.TITLE)}
+      <div class="titrePage">
+        {if !empty($block.U_EDIT)}
+        <ul class="categoryActions">
+          <li><a href="{$block.U_EDIT}" title="{'edit'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"/></a></li>
+        </ul>
+        {/if}
+      {if isset($block.TITLE_URL)}
+      <h2><a href="{$block.TITLE_URL}">{$block.TITLE}</a></h2>
+      {else}
+      <h2>{$block.TITLE}</h2>
+      {/if}
+      </div>
+    {/if}
+    {include file=$block.TEMPLATE}
+    </div>
+  {if $block.end_line}
+  </div>
+  {/if}
+{/foreach}
+</div>
Index: /extensions/PWG_Stuffs/template/index.css
===================================================================
--- /extensions/PWG_Stuffs/template/index.css	(revision 3300)
+++ /extensions/PWG_Stuffs/template/index.css	(revision 3300)
@@ -0,0 +1,59 @@
+.content {
+  min-height: 0;
+}
+
+.stuffs_block {
+  background-color: transparent;
+  background-image: none;
+  border: none;
+  margin-top: 0;
+  margin-bottom: 0;
+}
+
+.stuffs {
+  margin: 1em 0;
+  overflow: hidden;
+}
+
+.right_block {
+  float: right;
+  margin: 0 0 0 1em;
+}
+
+.left_block {
+  float: left;
+  margin: 0 1em 0 0;
+}
+
+.middle_block {
+  overflow: hidden;
+  margin: auto;
+}
+
+.personal_block {
+  padding: 15px;
+}
+
+.one_comment {
+  width: 99% !important;
+}
+
+.two_comment {
+  width: 49.5% !important;
+}
+
+.three_comment {
+  width: 33% !important;
+}
+
+#comments div.thumbnailCategory div.illustration {
+  width: auto !important;
+  padding-right: 15px;
+}
+
+#comments div.thumbnailCategory blockquote {
+  margin-left: 10px;
+}
+
+/* Hack IE6 */
+* html  .stuffs, * html .middle_block { overflow-y: visible; }
Index: /extensions/PWG_Stuffs/template/index.php
===================================================================
--- /extensions/PWG_Stuffs/template/index.php	(revision 3300)
+++ /extensions/PWG_Stuffs/template/index.php	(revision 3300)
@@ -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/PWG_Stuffs/template/piclenswall.tpl
===================================================================
--- /extensions/PWG_Stuffs/template/piclenswall.tpl	(revision 3300)
+++ /extensions/PWG_Stuffs/template/piclenswall.tpl	(revision 3300)
@@ -0,0 +1,13 @@
+{if !empty($block.RSSFEED)}
+<object id="o" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="{$block.PIC_HEIGHT}">
+		<param name="movie" value="http://apps.cooliris.com/embed/cooliris.swf?feed={$block.RSSFEED}&amp;style={$block.COLOR}&amp;showEmbed={$block.SHOWEMBED}&amp;showFullScreen={$block.SHOWFULLSCREEN}&amp;showSearch={$block.SHOWSEARCH}" />
+		<param name="allowFullScreen" value="{$block.SHOWFULLSCREEN}" />
+		<param name="showEmbed" value="{$block.SHOWEMBED}" />
+		<param name="showSearch" value="{$block.SHOWSEARCH}" />
+		<param name="allowScriptAccess" value="always" />
+		{if $block.TRANSPARENT}
+		<param name="wmode" value="transparent" />
+    {/if}
+		<embed {if $block.TRANSPARENT}WMODE="transparent" {/if}type="application/x-shockwave-flash" src="http://apps.cooliris.com/embed/cooliris.swf?feed={$block.RSSFEED}&amp;style={$block.COLOR}&amp;showEmbed={$block.SHOWEMBED}&amp;showFullScreen={$block.SHOWFULLSCREEN}&amp;showSearch={$block.SHOWSEARCH}" width="100%" height="{$block.PIC_HEIGHT}" showEmbed="{$block.SHOWEMBED}" showSearch="{$block.SHOWSEARCH}" allowFullScreen="{$block.SHOWFULLSCREEN}" allowScriptAccess="always" />
+</object>
+{/if}
Index: /extensions/PWG_Stuffs/template/picture.css
===================================================================
--- /extensions/PWG_Stuffs/template/picture.css	(revision 3300)
+++ /extensions/PWG_Stuffs/template/picture.css	(revision 3300)
@@ -0,0 +1,58 @@
+.content {
+  min-height: 0;
+}
+
+.stuffs_block {
+  background-color: transparent;
+  background-image: none;
+  border: none;
+  margin: 0;
+}
+
+.stuffs {
+  margin: 1em 0;
+  overflow: hidden;
+}
+
+.right_block {
+  float: right;
+  margin: 0 0 0 1em;
+}
+
+.left_block {
+  float: left;
+  margin: 0 1em 0 0;
+}
+
+.middle_block {
+  overflow: hidden;
+  margin: auto;
+}
+
+.personal_block {
+  padding: 15px;
+}
+
+.one_comment {
+  width: 99% !important;
+}
+
+.two_comment {
+  width: 49.5% !important;
+}
+
+.three_comment {
+  width: 33% !important;
+}
+
+#comments div.thumbnailCategory div.illustration {
+  width: auto !important;
+  padding-right: 15px;
+}
+
+#comments div.thumbnailCategory blockquote {
+  margin-left: 10px;
+}
+
+/* Hack IE6 */
+* html  .stuffs, * html .middle_block { overflow-y: visible; }
