<?php
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*\
<< ******************************************************************** >>
<< * ---------------------------------------------------------------- * >>
<< * Copyright ©2011-2012 Ozzy47                                      * >>
<< * All Rights Reserved. 											  * >>
<< * This file may not be redistributed in whole or significant part. * >>
<< * ---------------------------------------------------------------- * >>
<< * You are not allowed to use this on your server unless the files  * >>
<< * you downloaded were done so with permission.					  * >>
<< * ---------------------------------------------------------------- * >>
<< ******************************************************************** >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

//Table for auto reply
	self::$db->query_write("
		CREATE TABLE IF NOT EXISTS " . TABLE_PREFIX . "dbtech_vbsuper_pm_auto_pm 
		(
		    userid INT(10) NOT NULL,
			start_date INT(10) unsigned NOT NULL DEFAULT '0',
			end_date INT(10) unsigned NOT NULL DEFAULT '0',
			pm_message TEXT NOT NULL,
			active tinyint(1) DEFAULT '0',
			savecopy tinyint(1) DEFAULT '0',
			PRIMARY KEY userid (userid)
		)
	");
	self::report('Created Table', 'dbtech_vbsuper_pm_auto_pm');

//PM users Warning Table
	self::$db->query_write("
		CREATE TABLE IF NOT EXISTS " . TABLE_PREFIX . "dbtech_vbsuper_pm_warning 
		(
		    userid INT(10) NOT NULL,
			warning text NOT NULL,
			warning_active tinyint(1) NOT NULL DEFAULT '0',
			PRIMARY KEY userid (userid)
		)
	");
	self::report('Created Table', 'dbtech_vbsuper_pm_warning');
	
//PM users last warning, Warning Table
	self::$db->query_write("
		CREATE TABLE IF NOT EXISTS " . TABLE_PREFIX . "dbtech_vbsuper_pm_last_warning 
		(
		    userid INT(10) NOT NULL,
			recipientid INT(10) NOT NULL,
			lasttime int(10) NOT NULL,
			PRIMARY KEY (userid,recipientid),
  			KEY recipientid (recipientid)
		)
	");
	self::report('Created Table', 'dbtech_vbsuper_pm_last_warning');	

//Records for PM Blocker	
	if (self::$db_alter->fetch_table_info('userfield'))
	{
	 self::$db_alter->add_field(array(
	  'name'       => 'dbtech_vbsuper_pm_blocked_active',
	  'type'       => 'tinyint',
	  'length'     => '1',
	  'attributes' => 'unsigned',
	  'null'       => false, // True = NULL, false = NOT NULL
	  'default'    => '0'
	 ));
	 self::$db_alter->add_field(array(
	  'name'       => 'dbtech_vbsuper_pm_blocked',
	  'type'       => 'mediumtext',
	  'null'       => true, // True = NULL, false = NOT NULL
	  'default'    => NULL
	 ));
	 self::$db_alter->add_field(array(
	  'name'       => 'dbtech_vbsuper_pm_notif_active',
	  'type'       => 'tinyint',
	  'length'     => '1',
	  'attributes' => 'unsigned',
	  'null'       => false, // True = NULL, false = NOT NULL
	  'default'    => '1'
	 ));
	 self::$db_alter->add_field(array(
	  'name'       => 'dbtech_vbsuper_pm_quote_post_active',
	  'type'       => 'tinyint',
	  'length'     => '1',
	  'attributes' => 'unsigned',
	  'null'       => false, // True = NULL, false = NOT NULL
	  'default'    => '1'
	 ));
	 self::$db_alter->add_field(array(
	  'name'       => 'dbtech_vbsuper_pm_auto_quote_pm_active',
	  'type'       => 'tinyint',
	  'length'     => '1',
	  'attributes' => 'unsigned',
	  'null'       => false, // True = NULL, false = NOT NULL
	  'default'    => '0'
	 ));	 
	 self::report('Altered Table', 'userfield');
	}

/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*\
<< ********************************************************************* >>
<< * Created: 09:30, Fri June 8th 2012                                 * >>
<< * VER: 1.0.0                                                        * >>
<< ********************************************************************* >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
?>