<?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.					  * >>
<< * ---------------------------------------------------------------- * >>
<< ******************************************************************** >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

		self::$db->hide_errors();
/*        self::$db->query_write("
	ALTER TABLE " . TABLE_PREFIX . "navigation (
        ADD extranavid INT(10) UNSIGNED NOT NULL DEFAULT '0',
        ADD allowedusergroup varchar(250) DEFAULT NULL,
        ADD blockedusergroup varchar(250) DEFAULT NULL,
        ADD tabtarget varchar(100) DEFAULT NULL,
        ADD tabimage MEDIUMTEXT NULL,
        ADD tabnofollow tinyint(4) NOT NULL DEFAULT '0',
        ADD tabtitle varchar(100) NOT NULL,
        ADD tabnotes varchar(300) NOT NULL,
        ADD tabstyles varchar(100) DEFAULT NULL,
        ADD tabcolor text
	)
");*/

if (self::$db_alter->fetch_table_info('navigation'))
{
	self::$db_alter->add_field(array(
		'name'       => 'extranavid',
		'type'       => 'INT',
		'length'     => '10',
		'attributes' => 'unsigned',
		'null'       => false,	// True = NULL, false = NOT NULL
		'default'    => '0'
	));
	self::$db_alter->add_field(array(
		'name'       => 'allowedusergroup',
		'type'       => 'varchar',
		'length'     => '250',
		'null'       => true	// True = NULL, false = NOT NULL
	));
	self::$db_alter->add_field(array(
		'name'       => 'blockedusergroup',
		'type'       => 'varchar',
		'length'     => '250',
		'null'       => true	// True = NULL, false = NOT NULL
	));	
	self::$db_alter->add_field(array(
		'name'       => 'tabtarget',
		'type'       => 'varchar',
		'length'     => '100',
		'null'       => true	// True = NULL, false = NOT NULL
	));	
	self::$db_alter->add_field(array(
		'name'       => 'tabimage',
		'type'       => 'mediumtext',
		'null'       => true,	// True = NULL, false = NOT NULL
		'default'    => NULL
	));
	self::$db_alter->add_field(array(
		'name'       => 'tabnofollow',
		'type'       => 'tinyint',
		'length'     => '4',
		'null'       => false,	// True = NULL, false = NOT NULL
		'default'    => '0'
	));
	self::$db_alter->add_field(array(
		'name'       => 'tabtitle',
		'type'       => 'varchar',
		'length'     => '100',
		'null'       => false	// True = NULL, false = NOT NULL
	));
	self::$db_alter->add_field(array(
		'name'       => 'tabnotes',
		'type'       => 'varchar',
		'length'     => '500',
		'null'       => false	// True = NULL, false = NOT NULL
	));
	self::$db_alter->add_field(array(
		'name'       => 'tabstyles',
		'type'       => 'varchar',
		'length'     => '100',
		'null'       => true	// True = NULL, false = NOT NULL
	));
	self::$db_alter->add_field(array(
		'name'       => 'tabcolor',
		'type'       => 'text'
	));
	self::$db_alter->add_field(array(
  		'name' => 'tabdrop',
  		'type' => 'VARCHAR',
  		'length' => '30',
  		'null' => true,
  		'default' => NULL
	));			
}
	self::report('Start Altering Table', 'Navigation');
	self::report('Adding Field 1 of 11', 'extranavid');
	self::report('Adding Field 2 of 11', 'allowedusergroup');
	self::report('Adding Field 3 of 11', 'blockedusergroup');
	self::report('Adding Field 4 of 11', 'tabtarget');
	self::report('Adding Field 5 of 11', 'tabimage');
	self::report('Adding Field 6 of 11', 'tabnofollow');
	self::report('Adding Field 7 of 11', 'tabtitle');
	self::report('Adding Field 8 of 11', 'tabnotes');
	self::report('Adding Field 9 of 11', 'tabstyles');
	self::report('Adding Field 10 of 11', 'tabcolor');
	self::report('Adding Field 11 of 11', 'tabdrop');
	self::report('End Altering Table', 'Navigation');
  
if (self::$db_alter->fetch_table_info('navigation'))
{ 
	self::$db->query_write("
		ALTER TABLE " . TABLE_PREFIX . "navigation
		CHANGE scripts scripts VARCHAR( 250 ) NULL DEFAULT NULL
	"); 			
	self::$db->query_write("
		UPDATE " . TABLE_PREFIX . "navigation
		SET scripts = 'index.private.faq.calendar.group.album.profile.memberlist.subscription.showgroups.online.showthread.showpost.forumdisplay.newthread.newreply.editpost.member'
		WHERE `navid` =11
	"); 
}
	self::report('Altering Column', 'scripts'); 
	self::report('Setting Scripts', 'vbtab_forum'); 	
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*\
<< ********************************************************************* >>
<< * Created: 19:30, Fri Nov 25th 2011                                 * >>
<< * VER: 1.0.0                                                        * >>
<< ********************************************************************* >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

?>