Index: /extensions/GuestBook/admin/config.php
===================================================================
--- /extensions/GuestBook/admin/config.php	(revision 28840)
+++ /extensions/GuestBook/admin/config.php	(revision 28841)
@@ -14,5 +14,5 @@
     );
     
-  conf_update_param('guestbook', serialize($conf['guestbook']));
+  conf_update_param('guestbook', $conf['guestbook']);
   $page['infos'][] = l10n('Information data registered in database');
 }
Index: /extensions/GuestBook/main.inc.php
===================================================================
--- /extensions/GuestBook/main.inc.php	(revision 28840)
+++ /extensions/GuestBook/main.inc.php	(revision 28841)
@@ -14,5 +14,4 @@
 global $prefixeTable;
 
-
 define('GUESTBOOK_ID',      basename(dirname(__FILE__)));
 define('GUESTBOOK_PATH' ,   PHPWG_PLUGINS_PATH . GUESTBOOK_ID . '/');
@@ -20,8 +19,7 @@
 define('GUESTBOOK_ADMIN',   get_root_url().'admin.php?page=plugin-' . GUESTBOOK_ID);
 define('GUESTBOOK_URL',     get_absolute_root_url() . make_index_url(array('section' => 'guestbook')));
-define('GUESTBOOK_VERSION', 'auto');
-
 
 include_once(GUESTBOOK_PATH . 'include/events.inc.php');
+
 
 add_event_handler('init', 'guestbook_init');
@@ -41,11 +39,6 @@
 {
   global $conf;
-  
-  include_once(GUESTBOOK_PATH . 'maintain.inc.php');
-  $maintain = new GuestBook_maintain(GUESTBOOK_ID);
-  $maintain->autoUpdate(GUESTBOOK_VERSION, 'install');
+  $conf['guestbook'] = safe_unserialize($conf['guestbook']);
   
   load_language('plugin.lang', GUESTBOOK_PATH);
-  
-  $conf['guestbook'] = unserialize($conf['guestbook']);
 }
Index: /extensions/GuestBook/maintain.class.php
===================================================================
--- /extensions/GuestBook/maintain.class.php	(revision 28841)
+++ /extensions/GuestBook/maintain.class.php	(revision 28841)
@@ -0,0 +1,76 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+class GuestBook_maintain extends PluginMaintain
+{
+  private $table;
+  
+  private $default_conf = array(
+    'comments_validation' => false,
+    'email_admin_on_comment' => false,
+    'email_admin_on_comment_validation' => true,
+    'nb_comment_page' => 15,
+    'activate_rating' => true,
+    'guest_can_view' => true,
+    'guest_can_add' => true,
+    );
+  
+  function __construct($id)
+  {
+    global $prefixeTable;
+    
+    parent::__construct($id);
+    $this->table = $prefixeTable.'guestbook';
+  }
+
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf;
+  
+    if (empty($conf['guestbook']))
+    {
+      conf_update_param('guestbook', $this->default_conf, true);
+    }
+    else
+    {
+      $old_conf = safe_unserialize($conf['guestbook']);
+      
+      if (!isset($old_conf['guest_can_view']))
+      {
+        $old_conf['guest_can_view'] = true;
+        $old_conf['guest_can_add'] = true;
+      }
+      
+      conf_update_param('guestbook', $old_conf, true);
+    }
+  
+    pwg_query('
+CREATE TABLE IF NOT EXISTS `' . $this->table . '` (
+  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+  `date` datetime NOT NULL DEFAULT "0000-00-00 00:00:00",
+  `author` varchar(255) NOT NULL,
+  `author_id` smallint(5) DEFAULT NULL,
+  `anonymous_id` varchar(45) NOT NULL,
+  `email` varchar(255) DEFAULT NULL,
+  `website` varchar(255) DEFAULT NULL,
+  `content` longtext NOT NULL,
+  `rate` float(5,2) unsigned DEFAULT NULL,
+  `validated` enum("true","false") NOT NULL DEFAULT "false",
+  `validation_date` datetime DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+;');
+  }
+  
+  function update($old_version, $new_version, &$errors=array())
+  {
+    $this->install($new_version, $errors);
+  }
+
+  function uninstall()
+  {
+    pwg_query('DROP TABLE `' . $this->table . '`;');
+
+    conf_delete_param('guestbook');
+  }
+}
Index: tensions/GuestBook/maintain.inc.php
===================================================================
--- /extensions/GuestBook/maintain.inc.php	(revision 28840)
+++ 	(revision )
@@ -1,81 +1,0 @@
-<?php
-defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
-
-class GuestBook_maintain extends PluginMaintain
-{
-  private $installed = false;
-  
-  private $default_conf = array(
-    'comments_validation' => false,
-    'email_admin_on_comment' => false,
-    'email_admin_on_comment_validation' => true,
-    'nb_comment_page' => 15,
-    'activate_rating' => true,
-    'guest_can_view' => true,
-    'guest_can_add' => true,
-    );
-
-  function install($plugin_version, &$errors=array())
-  {
-    global $conf, $prefixeTable;
-  
-    if (empty($conf['guestbook']))
-    {
-      $conf['guestbook'] = serialize($this->default_conf);
-      conf_update_param('guestbook', $conf['guestbook']);
-    }
-    else
-    {
-      $old_conf = is_string($conf['guestbook']) ? unserialize($conf['guestbook']) : $conf['guestbook'];
-      
-      if (!isset($old_conf['guest_can_view']))
-      {
-        $old_conf['guest_can_view'] = true;
-        $old_conf['guest_can_add'] = true;
-      }
-      
-      $conf['guestbook'] = serialize($old_conf);
-      conf_update_param('guestbook', $conf['guestbook']);
-    }
-  
-    pwg_query('
-CREATE TABLE IF NOT EXISTS `' . $prefixeTable . 'guestbook` (
-  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
-  `date` datetime NOT NULL DEFAULT "0000-00-00 00:00:00",
-  `author` varchar(255) NOT NULL,
-  `author_id` smallint(5) DEFAULT NULL,
-  `anonymous_id` varchar(45) NOT NULL,
-  `email` varchar(255) DEFAULT NULL,
-  `website` varchar(255) DEFAULT NULL,
-  `content` longtext NOT NULL,
-  `rate` float(5,2) unsigned DEFAULT NULL,
-  `validated` enum("true","false") NOT NULL DEFAULT "false",
-  `validation_date` datetime DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8
-;');
-
-    $this->installed = true;
-  }
-
-  function activate($plugin_version, &$errors=array())
-  {
-    if (!$this->installed)
-    {
-      $this->install($plugin_version, $errors);
-    }
-  }
-
-  function deactivate()
-  {
-  }
-
-  function uninstall()
-  {
-    global $prefixeTable;
-  
-    pwg_query('DROP TABLE `' . $prefixeTable . 'guestbook`;');
-
-    conf_delete_param('guestbook');
-  }
-}
