   `widget` varchar(255) NOT NULL DEFAULT '',
   `widgetparams` text,
   `position` int(3) NOT NULL DEFAULT '0',
-  `visible` int(1) NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `tbl_transaction`
---
-
-CREATE TABLE IF NOT EXISTS `tbl_transaction` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `visible` int(1) NOT NULL DEFAULT '0'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Dump dei dati per la tabella `tbl_profiles_fields`
+--
+
+INSERT INTO `tbl_profiles_fields` (`id`, `varname`, `title`, `field_type`, `field_size`, `field_size_min`, `required`, `match`, `range`, `error_message`, `other_validator`, `default`, `widget`, `widgetparams`, `position`, `visible`) VALUES
+(1, 'first_name', 'First Name', 'VARCHAR', 255, 3, 2, '', '', 'Incorrect First Name (length between 3 and 50 characters).', '', '', '', '', 1, 1),
+(2, 'last_name', 'Last Name', 'VARCHAR', 255, 3, 2, '', '', 'Incorrect Last Name (length between 3 and 50 characters).', '', '', '', '', 2, 1),
+(3, 'school', 'School', 'VARCHAR', 255, 0, 2, '', '', '', '', '', '', '', 3, 1),
+(4, 'terms', 'Terms and conditions acceptance', 'TEXT', 0, 0, 0, '', '', '', '', '', '', '', 0, 0),
+(5, 'usercode', 'User code', 'VARCHAR', 255, 0, 0, '', '', '', '', '', '', '', 0, 0),
+(6, 'language', 'Language', 'VARCHAR', 7, 0, 0, '', '', '', '', '', '', '', 0, 0),
+(7, 'allowed_firms', 'Allowed firms', 'INTEGER', 10, 0, 0, '', '', '', '', '10', '', '', 0, 0),
+(8, 'email_notices', 'Email notices', 'INTEGER', 1, 0, 0, '', '', '', '', '', '', '', 4, 0),
+(9, 'is_blogger', 'Is this user a blogger?', 'INTEGER', 1, 0, 0, '', '', '', NULL, '0', '', NULL, 0, 0);
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `tbl_template`
+--
+
+CREATE TABLE `tbl_template` (
+  `id` int(11) NOT NULL,
+  `firm_id` int(11) NOT NULL,
+  `automatic` tinyint(1) NOT NULL DEFAULT '0',
+  `description` varchar(255) NOT NULL,
+  `info` text NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `tbl_transaction`
+--
+
+CREATE TABLE `tbl_transaction` (
+  `id` int(11) NOT NULL,
   `exercise_id` int(11) NOT NULL,
+  `rank` int(11) NOT NULL DEFAULT '10',
   `event_date` date NOT NULL,
   `description` text NOT NULL,
   `hint` text,
   `points` int(11) NOT NULL DEFAULT '10',
   `penalties` int(11) NOT NULL DEFAULT '5',
-  PRIMARY KEY (`id`),
-  KEY `exercise_id` (`exercise_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
-
--- --------------------------------------------------------
-
---
--- Table structure for table `tbl_template`
---
-
-CREATE TABLE IF NOT EXISTS `tbl_template` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `firm_id` int(11) NOT NULL,
-  `automatic` tinyint(1) NOT NULL DEFAULT '0',
-  `description` varchar(255) NOT NULL,
-  `info` text NOT NULL,
-  PRIMARY KEY (`id`),
-  KEY `firm_id` (`firm_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=269 ;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `tbl_users`
---
-
-CREATE TABLE IF NOT EXISTS `tbl_users` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `entries` int(11) NOT NULL DEFAULT '1'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `tbl_users`
+--
+
+CREATE TABLE `tbl_users` (
+  `id` int(11) NOT NULL,
   `username` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT '',
   `password` varchar(128) CHARACTER SET utf8 NOT NULL DEFAULT '',
   `email` varchar(128) CHARACTER SET utf8 NOT NULL DEFAULT '',

  `language` varchar(7) COLLATE utf8_bin NOT NULL DEFAULT '',
  `allowed_firms` int(11) NOT NULL DEFAULT '10',
  `email_notices` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`user_id`),
  KEY `email_notices` (`email_notices`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=433 ;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_profiles_fields`
--

CREATE TABLE IF NOT EXISTS `tbl_profiles_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `varname` varchar(50) NOT NULL DEFAULT '',
  `title` varchar(255) NOT NULL DEFAULT '',
  `field_type` varchar(50) NOT NULL DEFAULT '',

  `rate` int(3) NOT NULL DEFAULT '0',
  `transaction_id` int(11) DEFAULT NULL,
  `hints` varchar(255) DEFAULT NULL,
  `shown` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Struttura della tabella `tbl_event`
--

CREATE TABLE `tbl_event` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `firm_id` int(11) DEFAULT NULL,
  `action` int(11) NOT NULL,
  `happened_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `content` text,
  `referer` varchar(255) DEFAULT NULL,
  `address` varchar(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Struttura della tabella `tbl_exercise`
--

CREATE TABLE `tbl_exercise` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `firm_id` int(11) NOT NULL,
  `slug` varchar(32) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `introduction` text,
  `method` int(11) NOT NULL DEFAULT '61' COMMENT 'default value'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Struttura della tabella `tbl_firm`
--

CREATE TABLE `tbl_firm` (
  `id` int(11) NOT NULL,
  `name` varchar(128) CHARACTER SET utf8 NOT NULL,
  `slug` varchar(32) CHARACTER SET utf8 NOT NULL,
  `firmtype` tinyint(1) NOT NULL DEFAULT '1',
