Index: extensions/PWG_Stuffs/admin/add_module.php
===================================================================
--- extensions/PWG_Stuffs/admin/add_module.php	(revision 9042)
+++ extensions/PWG_Stuffs/admin/add_module.php	(revision 9369)
@@ -3,26 +3,20 @@
 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']))
+if ($page['tab'] == 'add_module')
 {
-  die('Wrong parameters...');
-}
-else
-{
-  $type = $_GET['type'];
+  if (!isset($_GET['path']) or !isset($modules[$_GET['path']]))
+  {
+    die('Wrong module path.');
+  }
+  else
+  {
+    $module_path = $_GET['path'];
+  }
 }
 
-// Cas particulier des News
-if ($type == 'News') include(STUFFS_PATH . 'modules/News/config.inc.php');
-
-// Enregistrement du module
+// Save module
 if (isset($_POST['submit']) and !is_adviser())
 {
-  include(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
+  include($module_path.'config.inc.php');
   if (empty($page['errors']))
   {
@@ -34,7 +28,7 @@
     {
       $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');
+      $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"';
@@ -42,16 +36,15 @@
       $on_picture = isset($_POST['on_picture'])  ? '"true"' : '"false"';
 
-			$sav_datas = (!empty($datas) ? '"' . addslashes(serialize($datas)) . '"' : 'NULL');
+      $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 . ',
+    descr=' . $desc . ',
+    datas=' . $sav_datas . ',
+    users=' . $users . ',
+    groups=' . $groups . ',
     show_title=' . $show_title .',
     on_home=' . $on_home .',
@@ -59,4 +52,8 @@
     on_picture='. $on_picture . '
 WHERE id = ' . $_GET['edit'] . ';');
+        if (isset($_GET['redirect']))
+        {
+          redirect(urldecode($_GET['redirect']));
+        }
       }
       else
@@ -69,13 +66,14 @@
 
         $query = '
-INSERT INTO ' . STUFFS_TABLE . ' ( id, pos, name, descr, type, datas, users, groups, show_title, on_home, on_cats, on_picture, id_line, width )
+INSERT INTO ' . STUFFS_TABLE . ' ( id, pos, name, descr, path, parent, 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 . ',
+  ' . $pos . ',
+  "' . $module_name . '",
+  ' . $desc . ',
+  "' . $module_path . '",
+  ' . (isset($modules[$module_path]['parent']) ? '"'.$modules[$module_path]['parent'].'"' : 'NULL') .',
+  ' . $sav_datas . ',
+  ' . $users . ',
+  ' . $groups . ',
   ' . $show_title . ',
   ' . $on_home . ',
@@ -86,5 +84,4 @@
         pwg_query($query);
       }
-
       redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php');
     }
@@ -92,25 +89,6 @@
 }
 
-// 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
+// Default module data
+if ($page['tab'] == 'add_module')
 {
   $module['users'] = array('guest', 'generic', 'normal', 'admin', 'webmaster');
@@ -118,10 +96,10 @@
   $template->assign(array(
     'STUFFS_TITLE' => l10n('stuffs_add_mod'),
-    'MODULE_NAME' => l10n('module_name_' . strtolower($type)),
+    'MODULE_NAME' => $modules[$module_path]['name'],
     'show_title_CHECKED' => 'checked="checked"',
     'on_home_CHECKED' => 'checked="checked"'));
 }
 
-// Selection des utilisateurs
+// Users perm
 $template->assign('user_perm', array(
   'GUEST' => (in_array('guest', $module['users']) ? 'checked="checked"' : ''),
@@ -131,5 +109,5 @@
   'WEBMASTER' => (in_array('webmaster', $module['users']) ? 'checked="checked"' : '')));
 
-// Selection des groupes
+// Groups perm
 $groups = get_all_groups();
 if (!empty($groups))
@@ -138,6 +116,6 @@
 }
 
-// Configuration du module
-include_once(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
+// Module configuration
+include_once($module_path.'config.inc.php');
 
 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/add_module.tpl'));
Index: extensions/PWG_Stuffs/admin/admin.php
===================================================================
--- extensions/PWG_Stuffs/admin/admin.php	(revision 9042)
+++ extensions/PWG_Stuffs/admin/admin.php	(revision 9369)
@@ -14,41 +14,39 @@
 // |                            Tabsheet
 // +-----------------------------------------------------------------------+
-if (!isset($_GET['tab']))
-    $page['tab'] = 'manage';
-else
-    $page['tab'] = $_GET['tab'];
+$page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : 'manage';
 
 $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->add('manage', l10n('stuffs_mods_management'), $my_base_url.'&amp;tab=manage');
+if ($page['tab'] == 'add_module')
+{
+  $tabsheet->add('add_module', l10n('stuffs_add_mod'), $my_base_url.'&amp;tab=add_module&amp;path='.$_GET['path']);
+}
+else
+{
+  $tabsheet->add('new', l10n('stuffs_add_mod'), $my_base_url.'&amp;tab=new');
+}
+if ($page['tab'] == 'edit_module')
+{
+  $tabsheet->add('edit_module', l10n('stuffs_edit_mod'), $my_base_url.'&amp;tab=edit_module');
+}
 $tabsheet->select($page['tab']);
 $tabsheet->assign();
 
-//Ajout d'un module
-if (isset($_POST['addModule']) and !is_adviser())
+//Récupération des modules disponibles
+add_event_handler('get_stuffs_modules', 'get_default_stuffs_modules');
+$disp_modules = trigger_event('get_stuffs_modules', array());
+uasort($disp_modules, 'name_compare');
+
+$modules = array();
+foreach($disp_modules as $module)
 {
-	if (!isset($_POST['module']))
+  $module['path'] = PHPWG_ROOT_PATH.trim($module['path'], './').'/';
+
+  if (preg_match('#^'.preg_quote(PHPWG_PLUGINS_PATH).'([^/]*?)/#', $module['path'], $match) and $match[1] != 'PWG_Stuffs')
   {
-		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']);
-	}
+   $module['parent'] = $match[1];
+  }
+  $modules[$module['path']] = $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
Index: extensions/PWG_Stuffs/admin/edit_module.php
===================================================================
--- extensions/PWG_Stuffs/admin/edit_module.php	(revision 9369)
+++ extensions/PWG_Stuffs/admin/edit_module.php	(revision 9369)
@@ -0,0 +1,29 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Retrieve module data
+$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"' : ''),
+  )
+);
+
+$module_path = $module['path'];
+
+include('add_module.php');
+
+?>
Index: extensions/PWG_Stuffs/admin/functions.inc.php
===================================================================
--- extensions/PWG_Stuffs/admin/functions.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/admin/functions.inc.php	(revision 9369)
@@ -1,20 +1,25 @@
 <?php
 
-function get_stuffs_modules()
+function get_default_stuffs_modules($modules)
 {
-	$dir = opendir(STUFFS_PATH . 'modules/');
-    while ($file = readdir($dir)) {
-        if ($file != '.' and $file != '..' and $file != '.svn') {
-            $path = STUFFS_PATH . 'modules/' . $file;
-            if (is_dir($path) and !is_link($path)) {
-                $modules[$file] = array('type' => $file,
-                    'name' => l10n('module_name_' . strtolower($file)),
-                    'description' => l10n('module_desc_' . strtolower($file)));
-            }
-        }
+  $dir = opendir(STUFFS_PATH . 'modules/');
+  while ($file = readdir($dir))
+  {
+    if ($file != '.' and $file != '..' and $file != '.svn')
+    {
+      $path = STUFFS_PATH . 'modules/' . $file;
+      if (is_dir($path) and !is_link($path))
+      {
+        array_push($modules, array(
+          'path' => $path,
+          'name' => l10n('module_name_' . strtolower($file)),
+          'description' => l10n('module_desc_' . strtolower($file)),
+          )
+        );
+      }
     }
-    closedir($dir);
-    uasort($modules, 'name_compare');
-    return $modules;
+  }
+  closedir($dir);
+  return $modules;
 }
 
Index: extensions/PWG_Stuffs/admin/manage.php
===================================================================
--- extensions/PWG_Stuffs/admin/manage.php	(revision 9042)
+++ extensions/PWG_Stuffs/admin/manage.php	(revision 9369)
@@ -3,5 +3,14 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-// Enregistrement de l'ordre
+global $pwg_loaded_plugins;
+
+// Delete 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');
+}
+
+// Save order
 if (isset($_POST['submitOrder']) and !is_adviser())
 {
@@ -27,6 +36,6 @@
 }
 
-// Affichage des modules et de leur position
-$q = 'SELECT id, name, descr, type, id_line, width, datas
+// Display
+$q = 'SELECT id, name, descr, path, parent, id_line, width, datas
 FROM ' . STUFFS_TABLE . '
 ORDER BY pos ASC;';
@@ -34,5 +43,4 @@
 $num = 0;
 $pos = 1;
-$cat_mod = array('name' => l10n('Categories'), 'type' => '-', 'description' => '');
 $id_line_options = array(
     '' => '-',
@@ -50,5 +58,5 @@
 while ($module = mysql_fetch_assoc($result))
 {
-	$module['name'] = $module['type'] != 'MainBlock' ? $module['name'] : l10n('stuffs_main_block');
+  $module['name'] = !empty($module['path']) ? $module['name'] : l10n('stuffs_main_block');
 
   $template->append('modules', array(
@@ -56,16 +64,18 @@
     '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'] : ''),
+    'PATH' => $module['path'],
+    'TYPE_NAME' => (isset($modules[$module['path']]['name']) ? $modules[$module['path']]['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'],
+    'WIDTH' => $module['width'],
+    'ID' => $module['id'],
+    'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&amp;tab=edit_module&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'] : '',
-  ));
+    'MISSING' => (isset($module['parent']) and !isset($pwg_loaded_plugins[$module['parent']])),
+    )
+  );
 
-  if ($module['type'] == 'MainBlock' and !empty($module['datas']))
+  if (empty($module['path']) and !empty($module['datas']))
   {
     $datas = unserialize($module['datas']);
Index: extensions/PWG_Stuffs/admin/new.php
===================================================================
--- extensions/PWG_Stuffs/admin/new.php	(revision 9042)
+++ extensions/PWG_Stuffs/admin/new.php	(revision 9369)
@@ -3,11 +3,26 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
+//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%2Fadmin.php&tab=add_module&path=' . urlencode($_POST['module']));
+  }
+}
+
 // Affichages des modules à ajouter
 foreach($modules as $module)
 {
-	$template->append('add_module', array(
-    'MODULE' => $module['type'],
+  $template->append('add_module', array(
+    'MODULE_PATH' => $module['path'],
     'NAME' => $module['name'],
-		'DESC' => $module['description']));
+    'DESC' => $module['description'],
+    )
+  );
 }
 
Index: extensions/PWG_Stuffs/admin/template/manage.tpl
===================================================================
--- extensions/PWG_Stuffs/admin/template/manage.tpl	(revision 9042)
+++ extensions/PWG_Stuffs/admin/template/manage.tpl	(revision 9369)
@@ -51,5 +51,5 @@
 
     <li class="categoryLi virtual_cat" id="module_{$module.ID}">
-      {if $module.TYPE != 'MainBlock'}
+      {if !empty($module.PATH)}
       <ul class="categoryActions">
         <li class="stuffs_line">
@@ -63,5 +63,7 @@
           <input type="text" size="2" maxlength="2" value="{$module.WIDTH}" name="width[{$module.ID}]" > %
         </li>
+        {if !$module.MISSING}
         <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}
         {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>
@@ -72,11 +74,13 @@
       <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}
+      <strong>{if empty($module.PATH)}<span class="MainBlock">{$module.NAME}</span>{else}<a href="{$module.U_EDIT}">{$module.NAME}</a>{/if}</strong>
+      {if !empty($module.TYPE_NAME)}&nbsp;-  &nbsp;{$module.TYPE_NAME}{/if}
       </p>
 
-      {if !empty($module.DESC)}
+      {if $module.MISSING}
+        <p style="margin-left: 30px;">{'stuffs_parent_plugin_is_missing'|@translate}</p> 
+      {elseif !empty($module.DESC)}
         <p style="margin-left: 30px;"><i>{$module.DESC}</i></p>
-      {elseif $module.TYPE == 'MainBlock'}
+      {elseif empty($module.PATH)}
         <p style="margin-left: 30px;"><input name="hidemb" type="checkbox" {if $HIDEMB}checked="checked"{/if}> &nbsp;{'Hide on home page'|@translate}</p>
       {/if}
Index: extensions/PWG_Stuffs/admin/template/new.tpl
===================================================================
--- extensions/PWG_Stuffs/admin/template/new.tpl	(revision 9042)
+++ extensions/PWG_Stuffs/admin/template/new.tpl	(revision 9369)
@@ -11,5 +11,5 @@
 	{foreach from=$add_module item=module}
 	<tr>
-		<td><input type="radio" value="{$module.MODULE}" name="module"/>
+		<td><input type="radio" value="{$module.MODULE_PATH}" name="module"/>
 			<b>{$module.NAME}</b> : {$module.DESC}</td>
 	</tr>
Index: extensions/PWG_Stuffs/admin/upgrade.inc.php
===================================================================
--- extensions/PWG_Stuffs/admin/upgrade.inc.php	(revision 9369)
+++ extensions/PWG_Stuffs/admin/upgrade.inc.php	(revision 9369)
@@ -0,0 +1,117 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable, $conf;
+
+$query = 'SHOW FULL COLUMNS FROM ' . $prefixeTable . 'stuffs;';
+$result = array_from_query($query, 'Field');
+if ($result[5] == 'params')
+{
+  $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);
+  }
+}
+
+$query = 'SHOW FULL COLUMNS FROM ' . $prefixeTable . 'stuffs;';
+$result = array_from_query($query, 'Field');
+if ($result[4] != 'path')
+{
+  $query = 'ALTER TABLE ' . $prefixeTable . 'stuffs
+CHANGE `type` `path` VARCHAR( 255 ) NULL DEFAULT NULL,
+ADD `parent` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `path`
+;';
+  pwg_query($query);
+
+  $query = 'UPDATE ' . $prefixeTable . 'stuffs
+SET path = CONCAT("'.PHPWG_ROOT_PATH.'", "plugins/PWG_Stuffs/", path, "/")
+WHERE path <> "MainBlock"
+;';
+  pwg_query($query);
+
+  $query = 'UPDATE ' . $prefixeTable . 'stuffs
+SET path = NULL
+WHERE path = "MainBlock"
+;';
+  pwg_query($query);
+}
+
+$query = '
+UPDATE ' . PLUGINS_TABLE . '
+SET version=\''.STUFFS_VERSION.'\'
+WHERE id=\'PWG_Stuffs\'';
+pwg_query($query);
+
+?>
Index: extensions/PWG_Stuffs/include/class.inc.php
===================================================================
--- extensions/PWG_Stuffs/include/class.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/include/class.inc.php	(revision 9369)
@@ -7,6 +7,6 @@
   var $user_groups = array();
   var $modules = array();
-	var $blocks = array();
-	var $pos = 'begin';
+  var $blocks = array();
+  var $pos = 'begin';
 
   function stuffs()
@@ -36,5 +36,5 @@
 
     $query = '
-SELECT id, name, type, datas, groups, show_title, id_line, width
+SELECT id, name, path, parent, datas, groups, show_title, id_line, width
 FROM ' . STUFFS_TABLE . '
 WHERE users LIKE "%' . $user['status'] . '%"
@@ -68,9 +68,11 @@
   function process_modules()
   {
+    global $pwg_loaded_plugins;
+
     foreach ($this->modules as $module)
     {
-      if ($module['type'] == 'MainBlock')
-      {
-    		$this->pos = 'end';
+      if ($module['name'] == 'MainBlock')
+      {
+        $this->pos = 'end';
         if (!empty($module['datas'])
           and $datas = unserialize($module['datas'])
@@ -79,34 +81,40 @@
           add_event_handler('loc_end_index', 'hide_main_block');
         }
-    		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);
+        continue;
+      }
+      if (isset($module['parent']) and !isset($pwg_loaded_plugins[$module['parent']]))
+      {
+        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'] = 'stuffs_'.strtolower($module['type']).'.tpl';
-    	$this->set_tpl_block($block, $module);
+      include($module['path'].'main.inc.php');
+
+      if (!empty($block['TEMPLATE']))
+      {
+        $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%2Fadmin.php&amp;tab=edit_module&amp;edit='.$module['id'].'&amp;redirect='.urlencode(urlencode($_SERVER['REQUEST_URI']));
+        }
+        $this->set_tpl_block($block, $module);
+      }
     }
   }
   /* Set template blocks  */
-	function set_tpl_block($block, $module)
-	{
-		if (!empty($module['id_line']))
+  function set_tpl_block($block, $module)
+  {
+    if (!empty($module['id_line']))
     {
       $block['id_line'] = $module['id_line'];
@@ -172,6 +180,6 @@
     $block['end_line'] = true;
     $block['CLASS'] = 'middle_block';
-  	$this->blocks[$this->pos][] = $block;
-	}
+    $this->blocks[$this->pos][] = $block;
+  }
 
   static function prefilter_index_css($source, &$smarty)
Index: extensions/PWG_Stuffs/include/functions.inc.php
===================================================================
--- extensions/PWG_Stuffs/include/functions.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/include/functions.inc.php	(revision 9369)
@@ -7,15 +7,15 @@
   function get_user_language_desc($desc)
   {
-  	global $user;
+    global $user;
     
-  	$user_lang = substr($user['language'], 0, 2);
+    $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 . ']'))
+    {
+      $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';
Index: extensions/PWG_Stuffs/include/stuffs.inc.php
===================================================================
--- extensions/PWG_Stuffs/include/stuffs.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/include/stuffs.inc.php	(revision 9369)
@@ -30,10 +30,10 @@
 {
   $template->assign('blocks', $stuffs->blocks['begin']);
-  $template->concat($begin,	$template->parse('stuffs', true));
+  $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->concat($end,  $template->parse('stuffs', true));
 }
 
Index: extensions/PWG_Stuffs/language/ar_SA/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/ar_SA/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/ar_SA/plugin.lang.php	(revision 9369)
@@ -40,4 +40,5 @@
 $lang['stuffs_error_no_mod_selected'] = 'لم تختر اية موديول';
 $lang['stuffs_no_name'] = 'يجب ان تحدد اسم الموديول';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
Index: extensions/PWG_Stuffs/language/cs_CZ/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/cs_CZ/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/cs_CZ/plugin.lang.php	(revision 9369)
@@ -40,4 +40,5 @@
 $lang['stuffs_error_no_mod_selected'] = 'Nevybrali jste žádný modul.';
 $lang['stuffs_no_name'] = 'Musíte zadat název modulu';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
Index: extensions/PWG_Stuffs/language/de_DE/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/de_DE/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/de_DE/plugin.lang.php	(revision 9369)
@@ -40,7 +40,8 @@
 $lang['stuffs_error_no_mod_selected'] = 'Sie haben kein Modul ausgewählt.';
 $lang['stuffs_no_name'] = 'Sie müssen dem Modul einen Titel geben';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -60,5 +61,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -70,5 +71,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -80,5 +81,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -93,5 +94,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -109,5 +110,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -126,5 +127,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -133,5 +134,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -140,5 +141,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -147,5 +148,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -156,5 +157,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/en_UK/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/en_UK/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/en_UK/plugin.lang.php	(revision 9369)
@@ -40,7 +40,8 @@
 $lang['stuffs_error_no_mod_selected'] = 'You didn\'t select any module.';
 $lang['stuffs_no_name'] = 'You must specify name module';
+$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -60,5 +61,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -70,5 +71,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -80,5 +81,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -93,5 +94,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -109,5 +110,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -126,5 +127,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -133,5 +134,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -140,5 +141,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -147,5 +148,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -156,5 +157,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/es_ES/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/es_ES/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/es_ES/plugin.lang.php	(revision 9369)
@@ -40,7 +40,8 @@
 $lang['stuffs_error_no_mod_selected'] = 'Usted no seleccionó ningun módulo a añadir.';
 $lang['stuffs_no_name'] = 'Usted debe indicar por lo menos un nombre para el módulo';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -60,5 +61,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -70,5 +71,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -80,5 +81,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -92,5 +93,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -108,5 +109,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -125,5 +126,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -132,5 +133,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -139,5 +140,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -146,5 +147,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -155,5 +156,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/fr_FR/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/fr_FR/plugin.lang.php	(revision 9369)
@@ -40,7 +40,8 @@
 $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';
+$lang['stuffs_parent_plugin_is_missing'] = 'LE PLUGIN PARENT N\'EST PLUS ACTIVÉ. Veuillez supprimer ce module ou réactiver le plugin parent.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -60,5 +61,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -70,5 +71,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -80,5 +81,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -93,5 +94,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -109,5 +110,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -126,5 +127,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -133,5 +134,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -140,5 +141,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -147,5 +148,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -156,5 +157,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/hr_HR/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/hr_HR/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/hr_HR/plugin.lang.php	(revision 9369)
@@ -40,4 +40,5 @@
 $lang['stuffs_error_no_mod_selected'] = 'Niste odabrali niti jedan modul.';
 $lang['stuffs_no_name'] = 'Morate navesti naziv modula';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
Index: extensions/PWG_Stuffs/language/hu_HU/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/hu_HU/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/hu_HU/plugin.lang.php	(revision 9369)
@@ -40,7 +40,8 @@
 $lang['stuffs_error_no_mod_selected'] = 'Nincs modul kiválasztva.';
 $lang['stuffs_no_name'] = 'Meg kell adni a modul címét';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -60,5 +61,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -70,5 +71,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -80,5 +81,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -93,5 +94,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -109,5 +110,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -126,5 +127,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -133,5 +134,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -140,5 +141,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -147,5 +148,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -156,5 +157,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/it_IT/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/it_IT/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/it_IT/plugin.lang.php	(revision 9369)
@@ -40,7 +40,8 @@
 $lang['stuffs_error_no_mod_selected'] = 'Non avete selezionato un modulo da aggiungere.';
 $lang['stuffs_no_name'] = 'E\' necessario specificare il nome del modulo';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -60,5 +61,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -70,5 +71,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -80,5 +81,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -93,5 +94,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -109,5 +110,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -126,5 +127,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -133,5 +134,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -140,5 +141,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -147,5 +148,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -156,5 +157,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/ja_JP/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/ja_JP/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/ja_JP/plugin.lang.php	(revision 9369)
@@ -40,7 +40,8 @@
 $lang['stuffs_error_no_mod_selected'] = 'あなたは、モジュールを選択していません。';
 $lang['stuffs_no_name'] = 'あなたは、モジュール名を指定する必要があります。';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -60,5 +61,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -70,5 +71,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -80,5 +81,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -93,5 +94,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -109,5 +110,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -126,5 +127,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -133,5 +134,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -140,5 +141,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -147,5 +148,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -156,5 +157,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/pl_PL/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/pl_PL/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/pl_PL/plugin.lang.php	(revision 9369)
@@ -40,4 +40,5 @@
 $lang['stuffs_error_no_mod_selected'] = 'Nie został wybrany żaden moduł.';
 $lang['stuffs_no_name'] = 'Musisz podać nazwę modułu';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
Index: extensions/PWG_Stuffs/language/pt_PT/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/pt_PT/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/pt_PT/plugin.lang.php	(revision 9369)
@@ -40,4 +40,5 @@
 $lang['stuffs_error_no_mod_selected'] = 'Não seleccionou um módulo.';
 $lang['stuffs_no_name'] = 'Deverá especificar um nome para o módulo';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
Index: extensions/PWG_Stuffs/language/ru_RU/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/ru_RU/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/ru_RU/plugin.lang.php	(revision 9369)
@@ -41,7 +41,8 @@
 $lang['stuffs_error_no_mod_selected'] = 'Вы не выбрали модуль для добавления.';
 $lang['stuffs_no_name'] = 'Пожалуйста, введите хотя бы одно имя для модуля.';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -66,5 +67,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -76,5 +77,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -86,5 +87,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -99,5 +100,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -115,5 +116,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -132,5 +133,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -139,5 +140,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -146,5 +147,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -153,5 +154,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -162,5 +163,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/sk_SK/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/sk_SK/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/sk_SK/plugin.lang.php	(revision 9369)
@@ -40,4 +40,5 @@
 $lang['stuffs_error_no_mod_selected'] = 'Neoznačili ste žiaden modul.';
 $lang['stuffs_no_name'] = 'Musíte určiť názov modulu';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
Index: extensions/PWG_Stuffs/language/sv_SE/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/sv_SE/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/sv_SE/plugin.lang.php	(revision 9369)
@@ -40,7 +40,8 @@
 $lang['stuffs_error_no_mod_selected'] = 'Ingen kategori markerad.';
 $lang['stuffs_no_name'] = 'Specifiera namn på enheten';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
-//							Module LastComs
+//              Module LastComs
 //------------------------------------------------------------------------------
 
@@ -60,5 +61,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Logon
+//              Module Logon
 //------------------------------------------------------------------------------
 
@@ -70,5 +71,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Personal
+//              Module Personal
 //------------------------------------------------------------------------------
 
@@ -80,5 +81,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Tags
+//              Module Tags
 //------------------------------------------------------------------------------
 
@@ -93,5 +94,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Piclenswall
+//              Module Piclenswall
 //------------------------------------------------------------------------------
 
@@ -109,5 +110,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Most Visited
+//              Module Most Visited
 //------------------------------------------------------------------------------
 
@@ -126,5 +127,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Best Rated
+//              Module Best Rated
 //------------------------------------------------------------------------------
 
@@ -133,5 +134,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Recent
+//              Module Recent
 //------------------------------------------------------------------------------
 
@@ -140,5 +141,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Random
+//              Module Random
 //------------------------------------------------------------------------------
 
@@ -147,5 +148,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Citation
+//              Module Citation
 //------------------------------------------------------------------------------
 
@@ -156,5 +157,5 @@
 
 //------------------------------------------------------------------------------
-//							Module Featured Photos
+//              Module Featured Photos
 //------------------------------------------------------------------------------
 
Index: extensions/PWG_Stuffs/language/tr_TR/plugin.lang.php
===================================================================
--- extensions/PWG_Stuffs/language/tr_TR/plugin.lang.php	(revision 9042)
+++ extensions/PWG_Stuffs/language/tr_TR/plugin.lang.php	(revision 9369)
@@ -40,4 +40,5 @@
 $lang['stuffs_error_no_mod_selected'] = 'Bir modül seçmediniz.';
 $lang['stuffs_no_name'] = 'Modül için bir isim belirtmelisiniz';
+/*TODO*/$lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.';
 
 //------------------------------------------------------------------------------
Index: extensions/PWG_Stuffs/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/main.inc.php	(revision 9369)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: PWG Stuffs
-Version: 2.0.q
+Version: auto
 Description: Insert modules on your gallery
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=190
@@ -8,4 +8,6 @@
 Author URI: http://www.gauchon.com
 */
+
+define('STUFFS_VERSION', '2.1.m');
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
@@ -16,4 +18,8 @@
 define('STUFFS_PATH' , PHPWG_PLUGINS_PATH . STUFFS_DIR . '/');
 define('STUFFS_TABLE' , $prefixeTable . 'stuffs');
+
+// Need upgrade?
+if ($plugin['version'] != STUFFS_VERSION)
+  include('admin/upgrade.inc.php');
 
 function stuffs_admin_menu($menu)
@@ -27,15 +33,15 @@
 function set_stuffs_on_index()
 {
-	global $page;
+  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');
+  include_once(STUFFS_PATH . 'include/stuffs.inc.php');
 }
 
Index: extensions/PWG_Stuffs/maintain.inc.php
===================================================================
--- extensions/PWG_Stuffs/maintain.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/maintain.inc.php	(revision 9369)
@@ -17,4 +17,5 @@
 `descr` varchar(255) default NULL,
 `type` varchar(255) NOT NULL,
+`path` varchar(255) default NULL,
 `datas` longtext default NULL,
 `users` varchar(255) default NULL,
@@ -33,20 +34,19 @@
     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);";
+    $q = "INSERT INTO `" . $prefixeTable . "stuffs` (`id`, `pos`, `name`, `descr`, `type`, `path`, `datas`, `users`, `groups`, `show_title`, `on_home`, `on_cats`, `on_picture`, `id_line`, `width`) 
+VALUES (0, 1, 'MainBlock', NULL, 'MainBlock', NULL, NULL, 'guest,generic,normal,admin,webmaster', NULL, 'true', 'true', 'true', 'true', NULL, NULL);";
     pwg_query($q);
   }
 }
 
-function plugin_activate()
+function plugin_activate($id, $version)
 {
-  global $prefixeTable;
+  global $plugins, $prefixeTable;
 
   // Check if upgrade is needed
-  $query = 'SHOW FULL COLUMNS FROM ' . $prefixeTable . 'stuffs;';
-  $result = array_from_query($query, 'Field');
-  if ($result[5] == 'params')
+  if ($version != $plugins->fs_plugins[$id]['version'])
   {
-    upgrade_stuffs_from_17();
+    define('STUFFS_VERSION', $plugins->fs_plugins[$id]['version']);
+    include('admin/upgrade.inc.php');
   }
 }
@@ -56,89 +56,7 @@
     global $prefixeTable;
 
-	$q = 'DROP TABLE ' . $prefixeTable . 'stuffs;';
+  $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/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/BestRated/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/BestRated/main.inc.php	(revision 9369)
@@ -155,4 +155,5 @@
 
   $block['CONTENT'] = $template->parse('pwgs_best_rated', true);
+  $block['TEMPLATE'] = 'stuffs_bestrated.tpl';
 }
 else
Index: extensions/PWG_Stuffs/modules/Citation/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/Citation/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/Citation/main.inc.php	(revision 9369)
@@ -1,11 +1,12 @@
 <?php
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
 global $user;
 
 if ((isset($datas['quote_lang'][$user['language']])) and
-    ("" != $datas['quote_lang'][$user['language']])) {
+  ("" != $datas['quote_lang'][$user['language']]))
+{
   $block['CONTENT'] = $datas['quote_lang'][$user['language']];
-} else {
-  return false;
+  $block['TEMPLATE'] = 'stuffs_citation.tpl';
 }
 ?>
Index: extensions/PWG_Stuffs/modules/FeaturedPhotos/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/FeaturedPhotos/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/FeaturedPhotos/main.inc.php	(revision 9369)
@@ -136,8 +136,5 @@
 
   $block['CONTENT'] = $template->parse('pwgs_feat', true);
-}
-else
-{
-  return false;
+  $block['TEMPLATE'] = 'stuffs_featuredphotos.tpl';
 }
 
Index: extensions/PWG_Stuffs/modules/LastComs/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/LastComs/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/LastComs/main.inc.php	(revision 9369)
@@ -179,8 +179,5 @@
     array_push($block['comments'], $tpl_comment);
   }
-}
-else
-{
-  return false;
+  $block['TEMPLATE'] = 'stuffs_lastcoms.tpl';
 }
 
Index: extensions/PWG_Stuffs/modules/Logon/config.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/Logon/config.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/Logon/config.inc.php	(revision 9369)
@@ -10,5 +10,5 @@
 // Enregistrement de la configuration
 if (isset($_POST['submit']) and !is_adviser()) {
-	if (!isset($_POST['remove_menubar_block'])) $_POST['remove_menubar_block']  = '0';
+  if (!isset($_POST['remove_menubar_block'])) $_POST['remove_menubar_block']  = '0';
     $datas = array($_POST['remove_menubar_block']);
 }
Index: extensions/PWG_Stuffs/modules/Logon/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/Logon/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/Logon/main.inc.php	(revision 9369)
@@ -2,5 +2,6 @@
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-if (!is_a_guest()) return false;
+
+if (!is_a_guest()) return;
 
 global $conf;
@@ -30,3 +31,5 @@
 }
 
+$block['TEMPLATE'] = 'stuffs_logon.tpl';
+
 ?>
Index: extensions/PWG_Stuffs/modules/MostVisited/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/MostVisited/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/MostVisited/main.inc.php	(revision 9369)
@@ -160,8 +160,5 @@
 
   $block['CONTENT'] = $template->parse('pwgs_most_visited', true);
-}
-else
-{
-  return false;
+  $block['TEMPLATE'] = 'stuffs_mostvisited.tpl';
 }
 
Index: extensions/PWG_Stuffs/modules/Personal/config.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/Personal/config.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/Personal/config.inc.php	(revision 9369)
@@ -7,5 +7,5 @@
 // Enregistrement de la configuration
 if (isset($_POST['submit']) and !is_adviser()) {
-	$datas = array(stripslashes($_POST['personal_content']));
+  $datas = array(stripslashes($_POST['personal_content']));
 }
 
Index: extensions/PWG_Stuffs/modules/Personal/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/Personal/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/Personal/main.inc.php	(revision 9369)
@@ -15,3 +15,5 @@
 }
 
+$block['TEMPLATE'] = 'stuffs_personal.tpl';
+
 ?>
Index: extensions/PWG_Stuffs/modules/Random/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/Random/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/Random/main.inc.php	(revision 9369)
@@ -154,8 +154,5 @@
 
   $block['CONTENT'] = $template->parse('pwgs_random', true);
-}
-else
-{
-  return false;
+  $block['TEMPLATE'] = 'stuffs_random.tpl';
 }
 
Index: extensions/PWG_Stuffs/modules/Recent/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/Recent/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/Recent/main.inc.php	(revision 9369)
@@ -150,8 +150,5 @@
 
   $block['CONTENT'] = $template->parse('pwgs_recent', true);
-}
-else
-{
-  return false;
+  $block['TEMPLATE'] = 'stuffs_recent.tpl';
 }
 
Index: extensions/PWG_Stuffs/modules/Tags/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/Tags/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/Tags/main.inc.php	(revision 9369)
@@ -148,3 +148,5 @@
 }
 
+$block['TEMPLATE'] = 'stuffs_tags.tpl';
+
 ?>
Index: extensions/PWG_Stuffs/modules/piclenswall/main.inc.php
===================================================================
--- extensions/PWG_Stuffs/modules/piclenswall/main.inc.php	(revision 9042)
+++ extensions/PWG_Stuffs/modules/piclenswall/main.inc.php	(revision 9369)
@@ -21,17 +21,17 @@
   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
+  // 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 = $obj->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/'.(empty($page['category']['permalink']) ? $page['category']['id'] : $page['category']['permalink']);
+        $rssfeed = $obj->root_site_piclens.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 = $obj->root_site_piclens.PICLENS_PATH.'piclenswall-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 = $obj->root_site_piclens.PICLENS_PATH.'piclenswall-rss.php?/category/'.(empty($page['category']['permalink']) ? $page['category']['id'] : $page['category']['permalink']);
+      }
+    }
   }
   $block['RSSFEED'] = $rssfeed;
@@ -77,8 +77,8 @@
 
     if (isset($obj->my_config['piclens_wall_tutorial']) and !empty($obj->my_config['piclens_wall_tutorial']))
-        $block['tutorial'] = (empty($obj->my_config['piclens_wall_tutorialtime']) ? "4500" : @$obj->my_config['piclens_wall_tutorialtime']).','.@$obj->my_config['piclens_wall_tutorial'];		
+        $block['tutorial'] = (empty($obj->my_config['piclens_wall_tutorialtime']) ? "4500" : @$obj->my_config['piclens_wall_tutorialtime']).','.@$obj->my_config['piclens_wall_tutorial'];    
 
 
-	if (isset($obj->my_config['piclens_wall_customButtonURL']) and !empty($obj->my_config['piclens_wall_customButtonURL']))
+  if (isset($obj->my_config['piclens_wall_customButtonURL']) and !empty($obj->my_config['piclens_wall_customButtonURL']))
         $block['customButton'] = @$obj->my_config['piclens_wall_customButtonURL'].(empty($obj->my_config['piclens_wall_customButtonTARGET']) ? ','.PICLENS_PATH : ','.@$obj->my_config['piclens_wall_customButtonTARGET']); 
 
@@ -86,12 +86,8 @@
         $block['icons'] = @$obj->my_config['piclens_wall_icons']; 
     if (isset($obj->my_config['piclens_wall_linkCSS']) and !empty($obj->my_config['piclens_wall_linkCSS']))
-        $block['icons'] = @$obj->my_config['piclens_wall_linkCSS']; 
+        $block['icons'] = @$obj->my_config['piclens_wall_linkCSS'];
 
-  
+  $block['TEMPLATE'] = 'stuffs_piclenswall.tpl';
 }
-else
-{
-  return false;
-}
-	
+
 ?>
