CREATE TABLE `autoresponder_config` (
  `id` int(11) NOT NULL auto_increment,
  `field` varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',
  `campaign_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
)  AUTO_INCREMENT=1 ;
CREATE TABLE `banlist` (
  `id` int(11) NOT NULL auto_increment,
  `member_id` int(11) NOT NULL default '0',
  `name` varchar(50) NOT NULL default '',
  `email` varchar(50) NOT NULL default '',
  `campaign` int(11) NOT NULL default '0',
  `date_added` datetime NOT NULL default '0000-00-00 00:00:00',
  `ban` smallint(6) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `member_id` (`member_id`)
)  AUTO_INCREMENT=1 ;
CREATE TABLE `campaigns` (
  `id` int(11) NOT NULL auto_increment,
  `member_id` int(11) NOT NULL default '0',
  `name` varchar(128) NOT NULL default '',
  `website_name` varchar(128) NOT NULL default '',
  `number_of_friends` tinyint(2) NOT NULL default '0',
  `mandatory_number_of_friends` tinyint(2) NOT NULL default '0',
  `use_reward_email_just_taf` tinyint(1) NOT NULL default '0',
  `number_of_friends_to_qualify_bonus1` tinyint(3) NOT NULL default '0',
  `warn_members_if_no_qualify1` tinyint(4) NOT NULL default '0',
  `gift_email_subject_line1` varchar(255) NOT NULL default '',
  `gift_email_body1` text NOT NULL,
  `number_of_friends_to_qualify_bonus2` int(3) NOT NULL default '0',
  `use_joined_bonus` tinyint(1) NOT NULL default '0',
  `gift_email_subject_line2` varchar(255) NOT NULL default '',
  `gift_email_body2` text NOT NULL,
  `link` text NOT NULL,
  `enable_link_tracking` tinyint(4) NOT NULL default '0',
  `invitation_email_subject` varchar(255) NOT NULL default '',
  `invitation_email_body` text NOT NULL,
  `include_do_not_email_me_again_link` tinyint(4) NOT NULL default '0',
  `allow_members_to_edit_emails` tinyint(4) NOT NULL default '0',
  `allow_members_to_enter_preciding_note` tinyint(4) NOT NULL default '0',
  `landing_page` text NOT NULL,
  `send_confirmation_to_sender` tinyint(4) NOT NULL default '0',
  `ty_email_subject` varchar(255) NOT NULL default '',
  `ty_email_body` text NOT NULL,
  `send_click_notification` tinyint(4) NOT NULL default '0',
  `click_email_subject` varchar(255) NOT NULL default '',
  `click_email_body` text NOT NULL,
  `send_join_notification` tinyint(4) NOT NULL default '0',
  `join_email_subject` varchar(255) NOT NULL default '',
  `join_email_body` varchar(255) NOT NULL default '',
  `subscribe_to_my_arp` tinyint(4) NOT NULL default '0',
  `use_aff_link` tinyint(4) NOT NULL default '0',
  `arp_type` tinyint(4) NOT NULL default '0',
  `arp_email` varchar(255) NOT NULL default '',
  `arp_message_subject` varchar(255) NOT NULL default '',
  `arp_message_body` varchar(255) NOT NULL default '',
  `submit_name` varchar(255) NOT NULL default '',
  `gift_url` varchar(255) NOT NULL default '',
  `gift_url2` varchar(255) NOT NULL default '',
  `bypass_link` tinyint(4) NOT NULL default '0',
  `bypass_link_text` varchar(255) NOT NULL default '',
  `color_bg_main` varchar(10) NOT NULL default '',
  `color_bg_table` varchar(10) NOT NULL default '',
  `color_border_table` varchar(10) NOT NULL default '',
  `border_table` int(10) NOT NULL default '0',
  `font` varchar(255) NOT NULL default '',
  `size` int(11) NOT NULL default '0',
  `font_color` varchar(10) NOT NULL default '',
  `style` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `member_id` (`member_id`)
)  AUTO_INCREMENT=1 ;
CREATE TABLE `members` (
  `id` int(10) NOT NULL auto_increment,
  `aff_url` varchar(255) NOT NULL default '',
  `password` varchar(64) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `email` (`aff_url`)
)  AUTO_INCREMENT=1 ;
CREATE TABLE `settings` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(64) NOT NULL default '',
  `value` text NOT NULL,
  `box_type` enum('textbox','input','checkbox','hidden','select') NOT NULL default 'textbox',
  `description` text NOT NULL,
  `cat` enum('General Site Settings') NOT NULL default 'General Site Settings',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `cat` (`cat`)
)  AUTO_INCREMENT=1 ;
INSERT INTO `settings` VALUES (19, 'site_full_url', '', 'hidden', 'The full URL to your site including folder if necessary(Example: <b>http://www.minigolf.com/</b> or <b>http://www.minigolf.com/ball/</b>)', 'General Site Settings');
INSERT INTO `settings` VALUES (5, 'lostpass_email_subject', 'Your password for Viral Friend Generator!', 'hidden', '', 'General Site Settings');
INSERT INTO `settings` VALUES (6, 'lostpass_email_body', 'Your new password for Viral Friend Generator: [password].', 'hidden', '', 'General Site Settings');
INSERT INTO `settings` VALUES (8, 'emailing_from_name', '', 'input', 'The Name that will appear in the From: field of the emails sent for your lost password emails.', 'General Site Settings');
INSERT INTO `settings` VALUES (9, 'emailing_from_email', '', 'input', 'The email address that will appear in the From: field of the emails sent for your lost password emails.', 'General Site Settings');
CREATE TABLE `track` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `crypted_email` varchar(255) NOT NULL default '',
  `mails_sent` int(11) NOT NULL default '0',
  `nr_joined` int(11) NOT NULL default '0',
  `camp_id` int(11) NOT NULL default '0',
  `date_click` datetime NOT NULL default '0000-00-00 00:00:00',
  `ip` varchar(20) NOT NULL default '',
  `not_mail` tinyint(4) NOT NULL default '0',
  `aff` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
)  AUTO_INCREMENT=1 ;
INSERT INTO `track` VALUES (1, '', '', '', 0, 0, 0, '0000-00-00 00:00:00', '', 0, 0);
ALTER TABLE `campaigns` ADD `captcha` TINYINT NOT NULL ;
ALTER TABLE `campaigns` ADD `html_text` TINYINT NOT NULL ;
CREATE TABLE `custom_ban` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`ban_word` varchar( 255 ) NOT NULL default '',
`campaign_id` int( 11 ) NOT NULL default '0',
`ban` tinyint( 4 ) NOT NULL default '0',
PRIMARY KEY ( `id` )
)  AUTO_INCREMENT=1 ;
CREATE TABLE `sent_ip` (  `id` int(11) NOT NULL auto_increment,  `ip` varchar(15) NOT NULL default '',  `count` tinyint(4) NOT NULL default '0',PRIMARY KEY  (`id`),  KEY `ip` (`ip`))  AUTO_INCREMENT=1 ;
ALTER TABLE `campaigns` ADD `enable_ip_ban` TINYINT( 4 ) NOT NULL ,ADD `nr_tries` INT( 3 ) NOT NULL ;