Location: PHPKode > projects > SiteX > setup/setup.php
<?PHP
/*
ini_set("display_errors","1");
error_reporting( E_NOTICE );
*/

$sxSetupPage = true;
$restart = false;

include("../includes/globals.php.inc");
include("../includes/functions.php");

// Check for prior installation
$Link = @mysql_connect($HOST, $USER, $PASS);
if(@mysql_select_db($DATABASE, $Link))
{
	$query = "SELECT * FROM ".$DB_PREFIX."_Setup WHERE setup_key='SetupComplete'";
	$result = @mysql_query($query, $Link);
	$ROW = @mysql_fetch_object($result);
	if($ROW->setup_value == 0)
	{	
		$query = "SELECT * FROM ".$DB_PREFIX."_Setup WHERE setup_key='SetupStep'";
		$result = @mysql_query($query, $Link);
		$ROW = @mysql_fetch_object($result);
		$step = $ROW->setup_value;
		if((intval($step) > 0)AND(!isset($_POST['sxLanguage'])))
			$restart = true;
	}
	else
	{
		header("Location:../index.php");
		die();
	}
}

if(isset($_POST['SaveLang']))
{
	if($step < 1)
		$step = 1;
	include("../lang/$sxLanguage.php");
}

if(isset($_POST['CheckDB']))
{
	include("../lang/$sxLanguage.php");
	
	$Link = @mysql_connect($HOST, $USER, $PASS) or $error = mysql_error();
	
	if(!$error)
		@mysql_select_db($DATABASE, $Link) or $error = mysql_error();
	else
		$step = 1;
	
	$query = "SELECT * FROM ".$DB_PREFIX."_Setup";
	
	if(@mysql_query($query, $Link))
	{
		header("Location:$PHP_SELF?step=2");
		die();
	}
	
	if(!$error)
	{		
		$query = "CREATE TABLE `".$DB_PREFIX."_Comments` (
		  `id` bigint(10) NOT NULL auto_increment,
		  `name` varchar(80) NOT NULL default '',
		  `email` varchar(80) NOT NULL default '',
		  `comments` mediumtext NOT NULL,
		  `timestamp` bigint(15) NOT NULL default '0',
		  `rowid` bigint(15) NOT NULL default '0',
		  `sectionid` int(5) NOT NULL default '0',
		  `approved` tinyint(1) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Comments_Section` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=4";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Comments_Section` VALUES (1, '".$sxLang['SetupComponentJournal']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Comments_Section` VALUES (2, '".$sxLang['SetupComponentPictures']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Comments_Section` VALUES (3, '".$sxLang['SetupComponentCollections']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Components` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `active` tinyint(1) NOT NULL default '0',
		  `page_url` varchar(255) NOT NULL default '',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=9";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (1, '".$sxLang['SetupComponentJournal']."', 1, 'journal.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (2, '".$sxLang['SetupComponentPictures']."', 1, 'pictures.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (3, '".$sxLang['SetupComponentGuestbook']."', 1, 'guestbook.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (4, '".$sxLang['SetupComponentPolls']."', 1, 'polls.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (5, '".$sxLang['SetupComponentLinks']."', 1, 'links.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (6, '".$sxLang['SetupComponentForums']."', 1, 'forums.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (7, '".$sxLang['SetupComponentContact']."', 1, 'contact.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (8, '".$sxLang['SetupComponentCalendar']."', 1, 'calendar.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components` VALUES (9, '".$sxLang['SetupComponentFilelist']."', 1, 'files.php')";
		$result = mysql_query($query, $Link) or die(mysql_error());		
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Components_Rename` (
		  `id` int(5) NOT NULL auto_increment,
		  `compid` int(5) NOT NULL default '0',
		  `new_name` varchar(255) NOT NULL default '',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=9";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (1, 1, '".$sxLang['SetupComponentRenameJournal']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (2, 2, '".$sxLang['SetupComponentRenamePictures']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (3, 3, '".$sxLang['SetupComponentGuestbook']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (4, 4, '".$sxLang['SetupComponentPolls']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (5, 5, '".$sxLang['SetupComponentLinks']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (6, 6, '".$sxLang['SetupComponentForums']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (7, 7, '".$sxLang['SetupComponentContact']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (8, 8, '".$sxLang['SetupComponentCalendar']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Components_Rename` VALUES (9, 9, '".$sxLang['SetupComponentFilelist']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());		
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Events` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `longname` varchar(255) NOT NULL default '',
		  `shortname` varchar(15) NOT NULL default '',
		  `userid` bigint(10) NOT NULL default '0',
		  `start_timestamp` bigint(15) NOT NULL default '0',
		  `end_timestamp` bigint(15) NOT NULL default '0',
		  `description` mediumtext NOT NULL,
		  `allday` tinyint(1) NOT NULL default '0',
		  `active` tinyint(1) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Events_Private` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `eventid` bigint(15) NOT NULL default '0',
		  `typeid` bigint(15) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Files` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `filename` varchar(255) NOT NULL default '',
		  `size` varchar(100) NOT NULL default '',
		  `timestamp` bigint(15) NOT NULL default '0',
		  `userid` int(5) NOT NULL default '0',
		  `hits` bigint(10) NOT NULL default '0',
		  `folderid` int(5) NOT NULL default '0',
		  `hide` tinyint(4) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Files_Folders` (
			`id` int(10) NOT NULL auto_increment ,
			`name` varchar(255) NOT NULL default '',
			`hide` tinyint(4) NOT NULL default '0',
			PRIMARY KEY (`id`) 
		) TYPE = MYISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Forums` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `description` mediumtext NOT NULL,
		  `position` int(5) NOT NULL default '0',
		  `groupid` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=2";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Forums` VALUES (1, '".$sxLang['SetupTestForumName']."', '".$sxLang['SetupTestForumDescription']."', 1, 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Forums_Groups` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `position` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=2";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Forums_Groups` VALUES (1, '".$sxLang['SetupTestForumGroup']."', 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Forums_Notify` (
			`id` BIGINT(10) NOT NULL auto_increment ,
			`userid` BIGINT(10) NOT NULL default '0',
			`notified` TINYINT(1) NOT NULL default '0',
			`id_type` ENUM('forum', 'topic') NOT NULL default 'topic',
			`id_num` BIGINT(10) NOT NULL default '0',
			PRIMARY KEY (`id`) 
			) TYPE = MYISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Forums_Posts` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `topic` varchar(255) NOT NULL default '',
		  `content` longtext NOT NULL,
		  `timestamp` bigint(15) NOT NULL default '0',
		  `updated` bigint(15) NOT NULL default '0',
		  `lastedit` bigint(15) NOT NULL default '0',
		  `userid` int(5) NOT NULL default '0',
		  `forumid` int(5) NOT NULL default '0',
		  `replyto` bigint(15) NOT NULL default '0',
		  `views` bigint(15) NOT NULL default '0',
		  `locked` tinyint(1) NOT NULL default '0',
		  `censored` tinyint(1) NOT NULL default '0',
		  `sticky` tinyint(1) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Forums_Private` (
		  `id` int(5) NOT NULL auto_increment,
		  `forumid` int(5) NOT NULL default '0',
		  `typeid` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Forums_Unread` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `userid` int(5) NOT NULL default '0',
		  `postid` bigint(15) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Guestbook` (
		  `id` bigint(10) NOT NULL auto_increment,
		  `name` varchar(80) NOT NULL default '',
		  `email` varchar(80) NOT NULL default '',
		  `website` varchar(255) NOT NULL default '',
		  `message` mediumtext NOT NULL,
		  `timestamp` bigint(15) NOT NULL default '0',
		  `approved` tinyint(1) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Hit_Counters` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `page` varchar(255) NOT NULL default '',
		  `hits` bigint(15) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Journal` (
		  `id` int(5) NOT NULL auto_increment,
		  `title` varchar(255) NOT NULL default '',
		  `entry` longtext NOT NULL,
		  `userid` bigint(10) NOT NULL default '0',
		  `timestamp` bigint(15) NOT NULL default '0',
		  `year` int(4) NOT NULL default '0',
		  `month` tinyint(2) NOT NULL default '0',
		  `day` tinyint(2) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Links` (
		  `id` bigint(10) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `url` varchar(255) NOT NULL default '',
		  `groupid` int(5) NOT NULL default '0',
		  `hits` bigint(10) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=2";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Links` VALUES (6, '".$sxLang['SetupSiteXLink']."', 'http://sitex.bjsintay.com', 1, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Links_Groups` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `position` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=2";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Links_Groups` VALUES (1, '".$sxLang['SetupDevSites']."', 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Navigation` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `url` varchar(255) NOT NULL default '',
		  `target` varchar(255) NOT NULL default '_self',
		  `position` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=10";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (1, '".$sxLang['SetupNavHome']."', 'index.php', '_self' ,1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (2, '".$sxLang['SetupSamplePageName']."', 'page.php?pageid=1', '_self', 2)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (3, '".$sxLang['SetupNavJournal']."', 'journal.php', '_self', 3)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (4, '".$sxLang['SetupNavGallery']."', 'pictures.php', '_self', 4)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (5, '".$sxLang['SetupNavGuestbook']."', 'guestbook.php', '_self', 5)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (6, '".$sxLang['SetupNavPolls']."', 'polls.php', '_self', 6)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (7, '".$sxLang['SetupNavLinks']."', 'links.php', '_self', 7)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (8, '".$sxLang['SetupNavForums']."', 'forums.php', '_self', 8)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (9, '".$sxLang['SetupNavCalendar']."', 'calendar.php', '_self', 9)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (10, '".$sxLang['SetupNavContact']."', 'contact.php', '_self', 10)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Navigation` VALUES (11, '".$sxLang['SetupNavFilelist']."', 'files.php', '_self', 11)";
		$result = mysql_query($query, $Link) or die(mysql_error());		
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Pages` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `content` longtext NOT NULL,
		  `lastupdated` bigint(15) NOT NULL default '0',
		  `formatted` tinyint(1) NOT NULL default '0',
		  `meta_description` text NOT NULL,
		  `meta_keywords` text NOT NULL,
		  `meta_title_ext` text NOT NULL,
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=2";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Pages` VALUES (1, '".$sxLang['SetupSamplePageName']."', '".$sxLang['SetupSamplePageContent']."', 1094686109, 1, '', '', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Pages_Private` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `pageid` int(5) NOT NULL default '0',
		  `typeid` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Photos` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `filename` varchar(255) NOT NULL default '',
		  `photographer` varchar(100) NOT NULL default '',
		  `filesize` bigint(15) NOT NULL default '0',
		  `width` bigint(15) NOT NULL default '0',
		  `height` bigint(15) NOT NULL default '0',
		  `description` mediumtext NOT NULL,
		  `timestamp` bigint(15) NOT NULL default '0',
		  `fullsize` tinyint(1) NOT NULL default '0',
		  `views` bigint(15) NOT NULL default '0',
		  `userid` int(5) NOT NULL default '0',
		  `watermark` tinyint(1) NOT NULL default '0',
		  `hide_random` tinyint(1) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Photos_Albums` (
		  `id` bigint(10) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `description` mediumtext NOT NULL,
		  `picture` varchar(255) NOT NULL default '',
		  `timestamp` bigint(15) NOT NULL default '0',
		  `private` tinyint(1) NOT NULL default '0',
		  `position` bigint(10) NOT NULL default '0',
		  `userid` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Photos_Assoc` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `photoid` bigint(15) NOT NULL default '0',
		  `albumid` bigint(10) NOT NULL default '0',
		  `position` bigint(10) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Photos_Albums_Private` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `albumid` int(5) NOT NULL default '0',
		  `typeid` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Photos_Keywords` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `photoid` bigint(15) NOT NULL default '0',
		  `keyword` varchar(100) NOT NULL default '',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Polls` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `currentpoll` tinyint(1) NOT NULL default '0',
		  `active` tinyint(1) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Polls_Values` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `value` varchar(255) NOT NULL default '',
		  `pollid` bigint(10) NOT NULL default '0',
		  `votes` bigint(10) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Security_Image` (
		  `id` bigint(10) NOT NULL auto_increment,
		  `code` varchar(50) NOT NULL default '',
		  `filename` varchar(50) NOT NULL,
		  `timestamp` bigint(15) NOT NULL,
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Setup` (
		  `id` int(5) NOT NULL auto_increment,
		  `setup_key` varchar(255) NOT NULL default '',
		  `setup_value` mediumtext NOT NULL,
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=88";
		$result = mysql_query($query, $Link) or die(mysql_error());
				
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (1, 'SiteName', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (2, 'Url', '" . 'http://' . $_SERVER["HTTP_HOST"] . str_replace('/setup/setup.php','',$_SERVER["PHP_SELF"]) . "')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (3, 'TextWelcome', '".$sxLang['SetupTextWelcome']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (4, 'TextHeader', '".$sxLang['SetupTextHeader']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (5, 'AlbumsPerPage', '6')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (6, 'PicsPerPage', '20')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (7, 'JournalsPerPage', '10')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (8, 'SearchResultsPerPage', '21')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (9, 'ForumTopicsPerPage', '25')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (10, 'ForumPostsPerPage', '25')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (11, 'LinkTruncation', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (12, 'SetupComplete', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (13, 'Version', '0.8.0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (14, 'SetupStep', '2')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (15, 'MetaDescription', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (16, 'MetaKeywords', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (17, 'MetaSitewide', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (19, 'ShowSearch', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (20, 'ContentWriteable', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (21, 'AllowSignup', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (22, 'AdminEmail', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (23, 'ShowLogin', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (24, 'DateFormat', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (25, 'ImagingMode', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (26, 'PhotoPurchase', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (27, 'CommentsApproval', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (28, 'GuestbookApproval', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (29, 'ContactFormEmail', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (30, 'CommentsEnabled', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (31, 'CommentsAuth', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (32, 'ForumAnonymous', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (33, 'ForumHidePrivate', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (34, 'ForumWidth', '600')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (35, 'ForumEditTimeout', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (36, 'ForumEditTimeoutSeconds', '900')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (37, 'LinkTruncationLength', '10')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (38, 'Maintenance', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (39, 'UserCleaner', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (40, 'UserCleanerWarn', '8')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (41, 'UserCleanerDelete', '12')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (42, 'UserAvatar', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (43, 'UserAvatarMaxWidth', '125')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (44, 'UserAvatarMaxHeight', '150')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (45, 'UserSignature', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (46, 'ServerTimezone', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (47, 'UserApproval', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (48, 'UserValidation', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (49, 'Language', 'English')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (50, 'GalleryShowPhotoCount', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (51, 'GalleryShowDescription', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (52, 'GalleryDescriptionTrunc', '100')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (53, 'AlbumShowPhotoDescription', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (54, 'AlbumPhotoDescriptionTrunc', '100')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (55, 'GalleryShowCreated', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (56, 'AlbumShowPhotoCreated', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (57, 'AlbumShowNumPhotos', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (58, 'GalleryNumColumns', '2')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (59, 'AlbumNumColumns', '3')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (60, 'GalleryMaxDimensionThumb', '150')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (61, 'GalleryMaxDimensionPhoto', '600')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (62, 'GalleryCompressionThumb', '90')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (63, 'GalleryCompressionPhoto', '90')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (64, 'GalleryStoreFullsize', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (65, 'GalleryUseKeywords', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (66, 'GallerySelectSize', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (67, 'GalleryWatermarking', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (68, 'GalleryWatermarkingType', 'txt')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (69, 'GalleryWatermarkingPosition', 'lowright')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (70, 'GalleryWatermarkingText', 'Copyright http://".$_SERVER["HTTP_HOST"]."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (71, 'GalleryWatermarkingTextSize', '2')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (72, 'GalleryWatermarkingTextColor', '#FFFFFF')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (73, 'GalleryWatermarkingTextTrans', '30')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (74, 'HomepageRandomPhotos', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (75, 'HomepageRandomPhotosVert', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (76, 'HomepageRandomPhotosHoriz', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (77, 'HomepageRandomPhotosNum', '8')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (78, 'HomepageRandomPhotosPerLine', '4')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (79, 'AlbumShowPhotoName', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (80, 'GalleryWatermarkingImage', '0')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (81, 'FormSecurity', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (82, 'WYSIWYG', 'fck')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (83, 'HomepageRecentComments', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (84, 'HomepageRecentTopics', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (85, 'HomepageUpcomingEvents', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (86, 'HomepageCurrentPoll', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (87, 'HomepageMiniCalendar', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (88, 'ContactFormInfo', '<p><b>My name</b></p>\r\n<p>My address<br />\r\nMy town<br />\r\nMy county<br />\r\nMy zipcode<br />\r\nMy Country</p>\r\n<p>Tel:<br />\r\nFax:<br />\r\nEmail: </p>')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (89, 'GoogleAnalytics', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (90, 'AlbumUseLightbox', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (91, 'UserSkype', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (92, 'UserMSN', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (93, 'UserBio', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (94, 'Sitemap', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (95, 'HTMLEmail', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (96, 'JournalHomeCount', '4')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (97, 'JournalRSSCount', '10')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (98, 'MemberFiles', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (99, 'FirstDayOfWeek', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (100, 'EditorRightsAlbumsAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (101, 'EditorRightsAlbumsManage', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (102, 'EditorRightsCommentsManager', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (103, 'EditorRightsContactManage', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (104, 'EditorRightsVisitorStats', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (105, 'EditorRightsEventsAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (106, 'EditorRightsEventsManage', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (107, 'EditorRightsFilesManage', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (108, 'EditorRightsForumsOptions', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (109, 'EditorRightsForumsManage', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (110, 'EditorRightsForumsAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (111, 'EditorRightsGuestbookEdit', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (112, 'EditorRightsHomepageOptions', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (113, 'EditorRightsJournalAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (114, 'EditorRightsJournalEdit', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (115, 'EditorRightsJournalManage', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (116, 'EditorRightsLinksAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (117, 'EditorRightsLinksEdit', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (118, 'EditorRightsNavigation', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (119, 'EditorRightsOnline', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (120, 'EditorRightsPagesAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (121, 'EditorRightsPagesEdit', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (122, 'EditorRightsPagesDelete', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (123, 'EditorRightsPhotoAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (124, 'EditorRightsPhotoBatchAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());		
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (125, 'EditorRightsPhotoEdit', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (126, 'EditorRightsPollsEdit', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());		
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (127, 'EditorRightsUsersAdd', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (128, 'EditorRightsUsersEdit', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (129, 'EditorRightsUsersEmail', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (130, 'EditorRightsUserOptions', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());	
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (131, 'EditorRightsUserTypes', '1')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Setup` VALUES (132, 'METATitleExt', '')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Themes` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `folder` varchar(255) NOT NULL default '',
		  `creator` varchar(255) NOT NULL default '',
		  `sitex_username` varchar(255) NOT NULL default '',
		  `sitex_version` varchar(10) NOT NULL default '',
		  `scheme_management` tinyint(1) NOT NULL default '0',
		  `title_width` int(5) NOT NULL default '0',
		  `title_height` int(5) NOT NULL default '0',
		  `notes` text NOT NULL,
		  `selected` tinyint(1) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=6";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Themes` VALUES (1, 'Structure', 'Structure', 'BJ Sintay', 'bjsintay', '0.7.3', 1, 250, 189, '<li>Forum options > Forum width: <b>500px</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Gallery): <b>2</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Album): <b>2</b>\n<li>Photo options > Gallery Appearance > Albums Per Page: <b>6</b>\n<li>Photo options > Gallery Appearance > Pictures Per Page: <b>8</b>\n<li>Photo options > Image Processing > Max Scaled Photo Dimension: <b>500</b>\n<li>Photo options > Random Photos > Total Photos: <b>4</b>\n<li>Photo options > Random Photos > Photos Per Line: <b>1</b>\n<li>User Options > maximum avatar height and width: <b>80</b>\n<li><b>Theme description:</b></br>\nStructure is the SiteX default theme. It features a vertical main menu in the banner area, making it best suited to simple sites with fewer menu items. Structure is the most compact theme, optimised for 800x600 screen resolution. Like an experienced marathon runner this theme is really lasting the distance! For additional configuration options, open themes/Structure/config.php.inc', 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes` VALUES (2, 'Streamline', 'Streamline', 'BJ Sintay', 'bjsintay', '0.7.3', 1, 250, 35, '<li>Forum options > Forum width: <b>650px</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Gallery): <b>3</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Album): <b>3</b>\n<li>Photo options > Gallery Appearance > Albums Per Page: <b>9</b>\n<li>Photo options > Gallery Appearance > Pictures Per Page: <b>12</b>\n<li>Photo options > Image Processing > Max Scaled Photo Dimension: <b>650</b>\n<li>Photo options > Random Photos > Total Photos: <b>4</b>\n<li>Photo options > Random Photos > Photos Per Line: <b>1</b>\n<li>User Options > maximum avatar height and width: <b>120</b>\n<li><b>Theme description:</b></br>\nStreamline is one of the earliest SiteX themes, its also one of the simplest and that makes it an ideal place to start if you want to customise a theme. Streamline stretches to fit the full size of your browser window. For additional configuration options, open themes/Streamline/config.php.inc', 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes` VALUES (3, 'Fusion', 'Fusion', 'Phil Mills', 'pmills', '0.7.3', 1, 760, 125, '<li>Forum options > Forum width: <b>650px</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Gallery): <b>2</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Album): <b>3</b>\n<li>Photo options > Gallery Appearance > Albums Per Page: <b>6</b>\n<li>Photo options > Gallery Appearance > Pictures Per Page: <b>20</b>\n<li>Photo options > Image Processing > Max Scaled Photo Dimension: <b>650</b>\n<li>Photo options > Random Photos > Total Photos: <b>5</b>\n<li>Photo options > Random Photos > Photos Per Line: <b>5</b>\n<li>User Options > maximum avatar height and width: <b>120</b>\n<li><b>Theme description:</b></br>\nFusion is a minimalist theme which provides a good foundation for many types of sites. It features menu hover text, horizontal login arrangement outside the site border, homepage RSS feed link and overprinted sitename. Fully featured without feeling cluttered! For additional configuration options, open themes/Fusion/config.php.inc', 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes` VALUES (4, 'Corporate', 'Corporate', 'Phil Mills', 'pmills', '0.7.3', 1, 760, 100, '<li>Forum options > Forum width: <b>650px</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Gallery): <b>2</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Album): <b>2</b>\n<li>Photo options > Gallery Appearance > Albums Per Page: <b>6</b>\n<li>Photo options > Gallery Appearance > Pictures Per Page: <b>8</b>\n<li>Photo options > Image Processing > Max Scaled Photo Dimension: <b>600</b>\n<li>Photo options > Random Photos > Total Photos: <b>5</b>\n<li>Photo options > Random Photos > Photos Per Line: <b>5</b>\n<li>Photo options > Random Photos > Use Portrait Photos: <b>no</b>\n<li>Photo options > Random Photos > Use Landscape Photos: <b>yes</b>\n<li>User Options > maximum avatar height and width: <b>100</b>\n<li><b>Theme description:</b></br>\nThere are 3 preset colorschemes for this theme; marine, bronze, blue pearl. Corporate also includes menu mouseover images, and not only that! There is also a specific set to match each of the 3 colourschemes. These are loaded automatically as you select the colourscheme you want to use. There are also 2, yes 2!  preinstalled title images per colourscheme, so you can see the title image rotation script in action. To enable them, go to Administration Panel > Manage title pictures. Make active the ones which share the same name as your coloursheme. e.g for bluepearl, select bluepearl1 & bluepearl2. Be sure to deselect any which relate to other colour schemes for this theme. You can have a lot of fun with this one! For additional configuration options, open themes/Corporate/config.php.inc', 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes` VALUES (5, 'Joombo', 'Joombo', 'Phil Mills', 'pmills', '0.7.3', 1, 600, 150, '<li>Admin Panel > Site Preferences > Additional Options > Show Search</li><li>Forum options > Forum width: <b>600px</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Gallery): <b>2</b>\n<li>Photo options > Gallery Appearance > Number of Columns (Album): <b>2</b>\n<li>Photo options > Gallery Appearance > Albums Per Page: <b>8</b>\n<li>Photo options > Gallery Appearance > Pictures Per Page: <b>8</b>\n<li>Photo options > Image Processing > Max Scaled Photo Dimension: <b>600</b>\n<li>Photo options > Random Photos > Total Photos: <b>6</b>\n<li>Photo options > Random Photos > Photos Per Line: <b>6</b>\n<li>User Options > maximum avatar height and width: <b>100</b>\n<li><b>Theme description:</b></br>\nJoombo is a very attractive modern theme featuring clean lines, mouseover image swaps, advanced styles, site statistics, integrated login/user menu, customised site search, multiple menus and best of all, a scrollable blog! Just look and see what can be done with SiteX! For additional configuration options, open themes/Joombo/config.php.inc', 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes` VALUES (6, 'Harmony', 'Harmony', 'Annika Mai Purje', 'annikamai', '0.8.0', 1, 300, 80, '<li>Forum options > Forum width: <b>650px</b>\r\n<li>Photo options > Gallery Appearance > Number of Columns (Gallery): <b>3</b>\r\n<li>Photo options > Gallery Appearance > Number of Columns (Album): <b>3</b>\r\n<li>Photo options > Gallery Appearance > Albums Per Page: <b>6</b>\r\n<li>Photo options > Gallery Appearance > Pictures Per Page: <b>20</b>\r\n<li>Photo options > Image Processing > Max Scaled Photo Dimension: <b>650</b>\r\n<li>Photo options > Random Photos > Total Photos: <b>5</b>\r\n<li>Photo options > Random Photos > Photos Per Line: <b>5</b>\r\n<li>User Options > maximum avatar height and width: <b>120</b>\r\n<li><b>Theme description:</b></br>\r\nHarmony is a minimalist theme with clean lines and empasis on simplicity. It features menu hover text, horizontal login arrangement outside the site border and overprinted sitename. For additional configuration options, open themes/Harmony/config.php.inc', 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Themes_Setup` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `themeid` int(5) NOT NULL default '0',
		  `color_primary` varchar(7) NOT NULL default '',
		  `color_secondary` varchar(7) NOT NULL default '',
		  `color_background` varchar(7) NOT NULL default '',
		  `color_table` varchar(7) NOT NULL default '',
		  `color_table_row` varchar(7) NOT NULL default '',
		  `color_text` varchar(7) NOT NULL default '',
		  `color_text_secondary` varchar(7) NOT NULL default '',
		  `color_text_table` varchar(7) NOT NULL default '',
		  `color_links` varchar(7) NOT NULL default '',
		  `color_links_hover` varchar(7) NOT NULL default '',
		  `color_links_visited` varchar(7) NOT NULL default '',
		  `color_sitename` varchar(7) NOT NULL default '',
		  `show_sitename` tinyint(1) NOT NULL default '0',
		  `selected` tinyint(1) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=14";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (1, 'Ocean Spray', 1, '#EEEEEE', '#000099', '#FFFFFF', '#000099', '#EEEEEE', '#000000', '#FFFFFF', '#FFFFFF', '#0033CC', '#0033CC', '#AAAAAA', '#000099', 1, 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (2, 'Yellow Jacket', 1, '#FFFF00', '#000000', '#FFFFFF', '#000000', '#EEEEEE', '#000000', '#FFFF00', '#FFFF00', '#000000', '#000000', '#000000', '#000000', 0, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (3, 'Passion Fruit', 1, '#CC0000', '#FFEEDD', '#FFFFFF', '#FFEEDD', '#EEEEEE', '#990000', '#990000', '#990000', '#CC0000', '#CC0000', '#CC0000', '#FFFFFF', 1, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (4, 'Rustic', 2, '#333333', '#CC6600', '#CCCCCC', '#333333', '#EEEEEE', '#000000', '#FFFFFF', '#FFFFFF', '#CC6600', '#CC6600', '#CC6600', '#FFFFFF', 1, 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (5, 'Greenway', 2, '#009900', '#006600', '#FFFF99', '#006600', '#FFFFFF', '#212121', '#FFFFFF', '#FFFFFF', '#003300', '#003300', '#003300', '#FFFFFF', 1, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (6, 'Acid Wash', 2, '#212121', '#990000', '#000000', '#990000', '#212121', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#616161', '#616161', '#616161', '#FFFFFF', 1, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (7, 'LaSirene', 2, '#000066', '#000000', '#CCCCFF', '#000000', '#FFFFFF', '#212121', '#FFFFFF', '#FFFFFF', '#003300', '#003300', '#000066', '#FFFFFF', 1, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (8, 'Cool Down', 3, '#BCCDD5', '#404040', '#FFFFFF', '#BFBFBF', '#E0E0E0', '#616161', '#FFFFFF', '#336699', '#000000', '#A1A1A1', '#000000', '#404040', 1, 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (9, 'Bluepearl', 4, '#96A8CE', '#FFFFFF', '#FFFFFF', '#96A8CE', '#E0E0E0', '#616161', '#404040', '#FFFFFF', '#000000', '#000000', '#000000','#000000', 1, 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (10, 'Bronze', 4, '#BB7D4E', '#FFFFFF', '#FFFFFF', '#BB7D4E', '#E0E0E0', '#616161', '#FFFFFF', '#FFFFFF', '#000000', '#000000', '#000000', '#000000', 1, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (11, 'Marine', 4, '#66CCCC', '#FFFFFF','#FFFFFF', '#A1A1A1', '#E0E0E0', '#404040', '#FFFFFF', '#FFFFFF', '#000000', '#000000', '#000000', '#000000', 1, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (12, 'Charcoal', 5, '#B02E32', '#7E7B86', '#F7F7F7', '#7E7B86', '#F1F1F1', '#393939', '#FFFFFF', '#FFFFFF', '#D34444', '#D34444', '#B02E32', '#000000', 1, 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (13, 'Forest', 5, '#8C332B', '#608D76', '#F1EEED', '#608D76', '#E0E0E0', '#404040', '#FFFFFF', '#404040', '#8C332B', '#8C332B', '#608D76', '#404040', 1, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Themes_Setup` VALUES (14, 'Springfield', 6, '#CCCC33', '#CCCC33', '#FFFFFF', '#999933', '#E0DFB9', '#010101', '#999933', '#404040', '#C4261D', '#010101', '#C4261D', '#999933', 1, 1)";
		$result = mysql_query($query, $Link) or die(mysql_error());		
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Title_Pictures` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  `filename` varchar(255) NOT NULL default '',
		  `filesize` bigint(15) NOT NULL default '0',
		  `themeid` int(5) NOT NULL default '0',
		  `active` tinyint(1) NOT NULL default '0',
		  `width` int(10) NOT NULL default '0',
		  `height` int(10) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=11";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (1, 'Rustic', 'streamline.jpg', '2320', '2', '0','250', '35')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (2, 'Fusion', 'fusion.jpg', '8270', '3', '1','760', '165')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (3, 'Bluepearl1', 'corporate_bluepearl_1.jpg', '3270', '4', '0','760', '100')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (4, 'Bluepearl2', 'corporate_bluepearl_2.jpg', '5710', '4', '1','760', '100')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (5, 'Bronze1', 'corporate_bronze_1.jpg', '3110', '4', '0','760', '100')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (6, 'Bronze2', 'corporate_bronze_2.jpg', '5730', '4', '0','760', '100')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (7, 'Marine1', 'corporate_marine_1.jpg', '3400', '4', '0','760', '100')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (8, 'Marine2', 'corporate_marine_2.jpg', '5810', '4', '0','760', '100')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (9, 'Joombo Charcoal', 'joombo_charcoal.png', 2020, '5', 1, 600, 150)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (10, 'Joombo Forest', 'joombo_forest.png', 2020, '5', 0, 600, 150)";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Title_Pictures` VALUES (11, 'Harmony springfield', 'harmony_springfield.gif', 0, 6, 1, 300, 82)";
		$result = mysql_query($query, $Link) or die(mysql_error());

		$query = "CREATE TABLE `".$DB_PREFIX."_Users` (
		  `id` int(5) NOT NULL auto_increment,
		  `username` varchar(35) NOT NULL default '',
		  `password` varchar(35) NOT NULL default '',
		  `firstname` varchar(80) NOT NULL default '',
		  `lastname` varchar(80) NOT NULL default '',
		  `email` varchar(80) NOT NULL default '',
		  `location` varchar(255) NOT NULL default '',
		  `website` varchar(255) NOT NULL default '',
		  `skypeid` varchar(255) NOT NULL default '',
		  `msnid` varchar(255) NOT NULL default '',
		  `bio` mediumtext NOT NULL default '',
		  `avatar` varchar(255) NOT NULL default '',
		  `signature` mediumtext NOT NULL,
		  `lastlogin` bigint(15) NOT NULL default '0',
		  `membersince` bigint(15) NOT NULL default '0',
		  `timezone` varchar(3) NOT NULL default '0',
		  `newsletter` tinyint(1) NOT NULL default '0',
		  `showemail` tinyint(1) NOT NULL default '0',
		  `validated` tinyint(1) NOT NULL default '1',
		  `validation_code` varchar(255) NOT NULL default '',
		  `warned` tinyint(1) NOT NULL default '0',
		  `active` tinyint(1) NOT NULL default '1',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=2";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Users_Assoc` (
		  `id` bigint(10) NOT NULL auto_increment,
		  `userid` int(5) NOT NULL default '0',
		  `typeid` int(5) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=1";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "CREATE TABLE `".$DB_PREFIX."_Users_Types` (
		  `id` int(5) NOT NULL auto_increment,
		  `name` varchar(255) NOT NULL default '',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=2";
		$result = mysql_query($query, $Link) or die(mysql_error());

		$query = "INSERT INTO `".$DB_PREFIX."_Users_Types` VALUES (1, '".$sxLang['SetupUserTypeAdmin']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Users_Types` VALUES (2, '".$sxLang['SetupUserTypeMember']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Users_Types` VALUES (3, '".$sxLang['SetupUserTypeModerator']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Users_Types` VALUES (4, '".$sxLang['SetupUserTypeEditor']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$query = "INSERT INTO `".$DB_PREFIX."_Users_Types` VALUES (5, '".$sxLang['SetupUserTypeForumManager']."')";
		$result = mysql_query($query, $Link) or die(mysql_error());		
				
		$query = "CREATE TABLE `".$DB_PREFIX."_Visitors` (
		  `id` bigint(15) NOT NULL auto_increment,
		  `userid` int(5) NOT NULL default '0',
		  `lastip` varchar(100) NOT NULL default '',
		  `visits` bigint(15) NOT NULL default '0',
		  `pagehits` bigint(15) NOT NULL default '0',
		  `lastvisit` bigint(15) NOT NULL default '0',
		  PRIMARY KEY  (`id`)
		) TYPE=MyISAM AUTO_INCREMENT=2";
		$result = mysql_query($query, $Link) or die(mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Visitors` VALUES (1, '0', 'previous_count', 0, 0, 0)";
		$result = mysql_query($query, $Link) or die(mysql_error());
						
	} // end no error so setup
	
	if($error)
		$nw = 1;
	else
		$step = 2;
}

if(isset($_POST['TestPerms']))
{

	include("../lang/$sxLanguage.php");
	
	$step = 2;
	
	if(sxContentWriteable() == TRUE)
	{
		$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='1' WHERE setup_key='ContentWriteable'";
		$result = mysql_query($query, $Link) or die(mysql_error());
		sxUpdateContentDirectories();
	}
	
	$directory_data = array();
	
	foreach($sxContentDir as $value)
	{
		$value = "../".$value;
		$directory_data[$value] = 1;
		
		if(!is_writable($value))	
		{
			$perm_error = 1;
			$directory_data[$value] = 0;
		}
	}
}

if(isset($_POST['AckPerms']))
{
	include("../lang/$sxLanguage.php");
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='3' WHERE setup_key='SetupStep'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	$step = 3;	
}

if(isset($_POST['SetPref']))
{
	include("../lang/$sxLanguage.php");

	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='".$SiteName."' WHERE setup_key='SiteName'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='$admin_email' WHERE setup_key='AdminEmail'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='$date_format' WHERE setup_key='DateFormat'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='4' WHERE setup_key='SetupStep'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='$imaging_mode' WHERE setup_key='ImagingMode'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='$server_timezone' WHERE setup_key='ServerTimezone'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='$admin_email' WHERE setup_key='ContactFormEmail'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='$language' WHERE setup_key='Language'";
	$result = mysql_query($query, $Link) or die(mysql_error());	
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='$form_security' WHERE setup_key='FormSecurity'";
	$result = mysql_query($query, $Link) or die(mysql_error());	
	
	$step = 4;
}

if(isset($_POST['SetTheme']))
{
	include("../lang/$sxLanguage.php");

	$query = "UPDATE `".$DB_PREFIX."_Themes` SET selected='1' WHERE id='$theme'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "SELECT * FROM ".$DB_PREFIX."_Themes WHERE id='$theme'";
	$result = mysql_query($query, $Link);
	$ROW = mysql_fetch_object($result);
	
	if($ROW->scheme_management == 1)
	{
		$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='5' WHERE setup_key='SetupStep'";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$step = 5;
	}
	else
	{
		$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='6' WHERE setup_key='SetupStep'";
		$result = mysql_query($query, $Link) or die(mysql_error());
		$step = 6;
	}
}

if(isset($_POST['SetScheme']))
{
	include("../lang/$sxLanguage.php");
	
	$query = "SELECT * FROM ".$DB_PREFIX."_Themes_Setup WHERE id='$scheme'";
	$result = mysql_query($query, $Link);
	$ROW = mysql_fetch_object($result);
	
	$query = "UPDATE ".$DB_PREFIX."_Themes_Setup SET selected='0' WHERE themeid='$ROW->themeid'";
	$result = mysql_query($query, $Link);
	
	$query = "UPDATE `".$DB_PREFIX."_Themes_Setup` SET selected='1' WHERE id='$scheme'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	
	$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='6' WHERE setup_key='SetupStep'";
	$result = mysql_query($query, $Link) or die(mysql_error());
	$step = 6;
}

if(isset($_POST['SetUser_Finish']))
{
	if(($usernameNew)AND($passwordNew))
	{
		$query = "SELECT setup_value FROM ".$DB_PREFIX."_Setup WHERE setup_key='Url'";
		$result = mysql_query($query, $Link);
		$sxSetupURL = mysql_fetch_object($result);
		
		$sxSetup['Url'] = $sxSetupURL->setup_value;
		
		include("../lang/$sxLanguage.php");

		$query = "UPDATE `".$DB_PREFIX."_Setup` SET setup_value='1' WHERE setup_key='SetupComplete'";
		$result = mysql_query($query, $Link) or die("Setup final step #1 : ".mysql_error());
		
		$NOW = mktime();
		
		$query = "INSERT INTO `".$DB_PREFIX."_Users` (id, username, password, firstname, lastname, email, location, website, lastlogin, membersince, timezone, newsletter, showemail, validated, active) VALUES (1, '$usernameNew', '$passwordNew', '$firstname', '$lastname', '$email', '$location', '$website', '$NOW', '$NOW', '0', '1', '1', '1', '1')";
		$result = mysql_query($query, $Link) or die("Setup final step #2 : ".mysql_error());
		
		$query = "INSERT INTO `".$DB_PREFIX."_Users_Assoc` VALUES (1, 1, 1)";
		$result = mysql_query($query, $Link) or die("Setup final step #3 : ".mysql_error());
		
		$query = "DELETE FROM `".$DB_PREFIX."_Setup` WHERE setup_key='SetupStep'";
		$result = mysql_query($query, $Link) or die("Setup final step #4 : ".mysql_error());
		
		@mail($email, $sxLangMail['SubjectUserInitial'], $sxLangMail['UserInitial'], "From: $email");
		
		$query = "DELETE FROM `".$DB_PREFIX."_Visitors` WHERE lastvisit='$NOW'";
		$result = mysql_query($query, $Link) or die("Setup final step #5 : ".mysql_error());
		
		header("Location: ".sxPathToRoot()."index.php");
		die();
	}
	else
		$error_message = $sxLang['MessageSetupErrorUser'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?PHP if($sxLanguage) echo $sxLang['SetupTitle']; else echo 'SiteX Installation'; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/css">
.passed {
	color:#00CC00;
}
.failed {
	color:#CC0000;
}
.sitex {
	font-size: 18px;
	font-weight: bold;
	color: #FFFFFF;
	background-color: #003467;
	text-align: left;
	margin: 0px;
	padding: 10px;
	padding-top: 50px;
}
.step {
	font-size: 16px;
	font-weight: bold;
	color: #003467;
	padding-top: 20px;
	padding-bottom: 5px;
	border-top-width: thin;
	border-right-width: thin;
	border-bottom-width: thin;
	border-left-width: thin;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: solid;
	border-left-style: none;
	border-top-color: #000000;
	border-right-color: #000000;
	border-bottom-color: #000000;
	border-left-color: #000000;
	margin-bottom: 15px;
}
.heading {
	font-weight: bold;
}
.code {
	font-family: "Courier New", Courier, mono;
	color: #333333;
	background-color: #FFFFFF;
	border: medium solid #990000;
	margin: 30px;
	padding: 25px;
}
body{
	background-color: #33679A;
}
body,p,td{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.sxTable{
	color: #333333;
	border: medium solid #003467;
}
.sxTD{
	background-color: #EEEEEE;
}
</style>
<body alink="#0033CC" vlink="#0033CC" link="#0033CC">
<form name="sxFormInstall" method="post" action="<?PHP echo $PHP_SELF; ?>">
<table class="sxTable" width="600px" border="0" cellspacing="0" cellpadding="20" align="center">
 <tr><td class="sxTD">
<div class="sitex"><?PHP if($sxLanguage) echo $sxLang['SetupTitle']; else echo 'SiteX Installation'; ?></div>
<?PHP if((!$step)OR($restart == true)){ ?>
<div class="step">Localization</div>
<div class="heading">Language Selection</div>
<p>Please select your language: </p>
<p>
<select name="sxLanguage" style="width:200px"><?PHP
foreach(getLanguages("../") as $sxLangVal){
if($sxLangVal == 'English') $selected = ' selected';
else $selected = '';
echo '<option value="' . $sxLangVal . '"' . $selected . '>' . $sxLangVal . '</option>';
}
?></select></p>
<p><input type="submit" name="SaveLang" value="  Continue  " class="sxButton"/>
   <input type="hidden" name="step" value="<?PHP echo $step; ?>" /></p>
<?PHP
}
if(($step == 1)AND($restart == false))
{
	echo '<div class="step">'.$sxLang['SetupStep1'].'</div>';
	echo '<div class="heading">'.$sxLang['SetupStep1Name'].'</div>';

	if(!$nw)
		echo '<p>'.$sxLang['SetupStep1Txt1'].'</p>';

	if(($USER != "")AND($DATABASE != ""))
	{
			
		if(($error)AND($CheckDB))
		{
			echo '<p>'.$sxLang['SetupStep1Txt2'].'</p>';
			echo '<p><strong>'.$sxLang['SetupMySQLError'].': "'.$error.'"</strong></p>';
			echo '<input type="hidden" name="sxLanguage" value="'.$sxLanguage.'" />';
			echo '<p><input type="submit" name="CheckDB" value="'.$sxLang['SetupButtonCheckDB'].'" class="sxButton"/></p>';
		}
		else
		{
			echo '<p>'.$sxLang['SetupStep1Txt3'].'</p>';
			echo '<input type="hidden" name="sxLanguage" value="'.$sxLanguage.'" />';
			echo '<p><input type="submit" name="CheckDB" value="'.$sxLang['SetupButtonCheckDB'].'" class="sxButton"/></p>';
		}
		
	}
	else
	{
		echo '<p>'.$sxLang['SetupStep1Txt4'].'</p>';
		echo '<div class="code">';
		echo '$HOST = &quot;localhost&quot;; ('.$sxLang['SetupStep1ExplainLocalhost'].')<br />';
		echo '$USER = &quot;&quot;; ('.$sxLang['SetupStep1ExplainMySQLUsername'].')<br />';
		echo '$PASS = &quot;&quot;; ('.$sxLang['SetupStep1ExplainMySQLPassword'].')<br />';
		echo '$DATABASE = &quot;&quot;; ('.$sxLang['SetupStep1ExplainMySQLDBName'].')<br />';
		echo '$DB_PREFIX = &quot;SiteX&quot;;</div>';
		echo '<p>'.$sxLang['SetupStep1Txt5'].'</p>';
		echo '<input type="hidden" name="sxLanguage" value="'.$sxLanguage.'" />';
		echo '<input type="hidden" name="nw" value="1" />';
		echo '<input type="hidden" name="SaveLang" value="1" />';
		echo '<p><input type="submit" value="'.$sxLang['SetupButtonCheckGlobals'].'" class="sxButton"/></p>';
	}
} // End step 1
	
if(($step == 2)AND($restart == false))
{
	echo '<div class="step">'.$sxLang['SetupStep2'].'</div>';
	echo '<div class="heading">'.$sxLang['SetupStep2Name'].'</div><br />';

	if(!$TestPerms)
	{
		echo '<p>'.$sxLang['SetupStep2Txt2'].'</p>';
		echo '<code>shell% chown -R apache.apache content</code>';
		echo '<p>'.$sxLang['SetupStep2Txt1'].'</p>';
		echo '<p><a href="http://sitex.bjsintay.com/page.php?pageid=4#7">'.$sxLang['HelpQ'].'</a></p>';
		echo '<input type="hidden" name="sxLanguage" value="'.$sxLanguage.'" />';
		echo '<p><input type="submit" name="TestPerms" value="'.$sxLang['SetupButtonTestPerms'].'" class="sxButton"/></p>';

	}
	else
	{
		if(!$perm_error)
		{
			echo '<p>'.$sxLang['SetupStep2Txt3'].'</p>';
			echo '<input type="hidden" name="sxLanguage" value="'.$sxLanguage.'" />';
			echo '<p><input type="submit" name="AckPerms" value="'.$sxLang['SetupButtonContinue'].'" class="sxButton"/></p>';
		}
		else
		{
		
			echo '<p>'.$sxLang['SetupStep2Txt4'].'</p>';
			echo '<table border="0">';
			echo '<tr><td><strong>Directory</strong></td><td>&nbsp;</td><td><strong>Test Result</strong></td></tr>';
			echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
			
			foreach($directory_data as $ddkey => $ddvalue)
			{
				echo '<tr><td>'.$ddkey.'</td><td>&nbsp;</td><td>';
				if($ddvalue == 1)
					echo '<span class="passed">PASSED</span>';
				else
					echo '<span class="failed"><strong>FAILED!</strong></span>';
				echo '</td></tr>';
			}
			
			echo '</table>';
			echo '<p><a href="http://sitex.bjsintay.com/page.php?pageid=4#7">'.$sxLang['HelpQ'].'</a></p>';
			echo '<input type="hidden" name="sxLanguage" value="'.$sxLanguage.'" />';
			echo '<p><input type="submit" name="TestPerms" value="'.$sxLang['SetupButtonRetestPerms'].'" class="sxButton"/> ';
			echo '<input type="submit" name="AckPerms" value="'.$sxLang['SetupButtonContinue'].'" class="sxButton"/></p>';
		}
	}
} // End step 2

if(($step == 3)AND($restart == false))
{
	echo '<div class="step">'.$sxLang['SetupStep3'].'</div>';
	echo '<div class="heading">'.$sxLang['SetupStep3Name'].'</div><br />';
?>
<table width="500" border="0" cellspacing="0" cellpadding="5">
  <tr> 
    <td width="170" align="right" valign="top"><strong><?PHP echo $sxLang['PreferencesItemSiteName']; ?></strong></td>
    <td><input name="SiteName" type="text" /></td>
  </tr>
  <tr> 
    <td width="170" align="right" valign="top"><strong><?PHP echo $sxLang['PreferencesItemAdminEmail']; ?></strong></td>
    <td><input name="admin_email" type="text" id="admin_email" /></td>
  </tr>
  <tr> 
	  <td width="170" align="right" valign="top"><strong><?PHP echo $sxLang['PreferencesItemDateFormat']; ?></strong></td>
	  <td><select name="date_format">
			<option value="mm/dd/yy"><?PHP echo $sxLang['DateFormatMDY']; ?></option>
			<option value="dd/mm/yy"><?PHP echo $sxLang['DateFormatDMY']; ?></option>
		  </select>
	  </td>
	</tr>
	<tr> 
	  <td width="170" align="right" valign="top"><strong><?PHP echo $sxLang['PreferencesItemImagingMode']; ?></strong></td>
	  <td><select name="imaging_mode">
			<option value="auto"><?PHP echo $sxLang['PreferencesImgAuto']; ?></option>
			<option value="GD1"><?PHP echo $sxLang['PreferencesImgGD1']; ?></option>
			<option value="GD2"><?PHP echo $sxLang['PreferencesImgGD2']; ?></option>
		  </select>
	  </td>
	</tr>
	<tr> 
		<td width="170" valign="top"><div align="right"><strong><?PHP echo $sxLang['PreferencesItemTimezone']; ?></strong></div></td>
		<td><select name="server_timezone">
			<?PHP
			for($i = -24; $i <= 24; $i++)
			{
				echo '<option value="' . $i . '"';
				if($i == 0)
					echo ' selected';
				echo '>';
				if($i > 0)
					echo '+ ';
				echo $i . '</option>';
			}
			?>
			</select> <?PHP echo $sxLang['PreferencesHoursFrom']; ?><br />
			(<?PHP echo $sxLang['CurrentTime']; ?>: <?PHP echo date("m/d/y @ g:ia", mktime()); ?>)
		</td>
	  </tr>
	  <tr> 
	    <td width="170" align="right" valign="top"><strong><?PHP echo $sxLang['PreferencesItemLanguage']; ?></strong></td>
	    <td><select name="language"><?PHP
	    foreach(getLanguages("../") as $sxLangVal)
		{
	    	echo '<option value="' . $sxLangVal . '"';
			
			// Default to English language
			if($sxLangVal == 'English')
				echo ' selected="selected"';
			
			echo '>' . $sxLangVal . '</option>';
		}
	    ?></select>
	    </td>
	  </tr>
	  <tr>
	    <td width="170" align="right" valign="top"><strong><?PHP echo $sxLang['PreferencesItemFormSecurity']; ?></strong></td>
	    <td><input type="checkbox" name="form_security" value="1" checked="checked" /></td>
	  </tr>
</table>
<p align="center">
<input type="hidden" name="sxLanguage" value="<?PHP echo $sxLanguage; ?>" />
<input type="submit" name="SetPref" value="<?PHP echo $sxLang['SetupButtonConfigurePrefs']; ?>" class="sxButton"/></p>
<?PHP
} // End of step 3

if(($step == 4)AND($restart == false))
{
	echo '<div class="step">'.$sxLang['SetupStep4'].'</div>';
	echo '<div class="heading">'.$sxLang['SetupStep4Name'].'</div><br />';
	
?>
<p><?PHP echo $sxLang['SetupStep4Txt1']; ?></p>
<p><strong><?PHP echo $sxLang['ThemesItemTheme']; ?>:</strong></p>
<table width="200">
	<tr>
		<td><label>
			<input type="radio" name="theme" value="3" checked="checked"/>
			Fusion<br /><img src="../themes/Fusion/ThemeFusion.jpg" alt="Fusion" width="300" height="172" vspace="6" border="1" /></label></td>
	</tr>
	<tr>
		<td><label>
			<input type="radio" name="theme" value="5" />
			Joombo<br /><img src="../themes/Joombo/ThemeJoombo.jpg" alt="Joombo" width="300" height="172" vspace="6" border="1" /></label></td>
	</tr>
	<tr>
		<td><label>
			<input type="radio" name="theme" value="6" />
			Harmony<br /><img src="../themes/Harmony/ThemeHarmony.jpg" alt="Harmony" width="300" height="172" vspace="6" border="1" /></label></td>
	</tr>
	<tr>
		<td><label>
			<input type="radio" name="theme" value="1" />
			Structure<br /><img src="../themes/Structure/ThemeStructure.jpg" alt="Structure" width="300" height="172" vspace="6" border="1" /></label></td>
	</tr>
	<tr>
		<td><label>
			<input type="radio" name="theme" value="2" />
			Streamline<br /><img src="../themes/Streamline/ThemeStreamline.jpg" alt="Streamline" width="300" height="172" vspace="6" border="1" /></label></td>
	</tr>
	<tr>
		<td><label>
			<input type="radio" name="theme" value="4" />
			Corporate<br /><img src="../themes/Corporate/ThemeCorporate.jpg" alt="Corporate" width="300" height="172" vspace="6" border="1" /></label></td>
	</tr>
</table>
<p><?PHP echo $sxLang['SetupStep4Txt2']; ?></p>
<p align="center">
<input type="hidden" name="sxLanguage" value="<?PHP echo $sxLanguage; ?>" />
<input type="submit" name="SetTheme" value="<?PHP echo $sxLang['SetupButtonConfigureTheme']; ?>" class="sxButton"/></p>
<?PHP
} // End of step 4

if(($step == 5)AND($restart == false))
{ 
	echo '<div class="step">'.$sxLang['SetupStep5'].'</div>';
	echo '<div class="heading">'.$sxLang['SetupStep5Name'].'</div><br />';
	
?>
<p><?PHP echo $sxLang['SetupStep5Txt1']; ?></p>
<p><strong><?PHP echo $sxLang['ThemesItemColorSchemes']; ?>:</strong> <select name="scheme">
<?PHP

	if(!isset($theme))
	{
		$query = "SELECT * FROM ".$DB_PREFIX."_Themes WHERE selected='1'";
		$result = mysql_query($query, $Link);
		$ROW = mysql_fetch_object($result);
		$theme = $ROW->id;
	}

	$query = "SELECT * FROM ".$DB_PREFIX."_Themes_Setup WHERE themeid='$theme' ORDER BY name";
	$result = mysql_query($query, $Link);
	while($ROW = mysql_fetch_object($result))
	{
		if($ROW->id == 1)
			$selected = " selected";
		else
			$selected = "";
		echo '<option value="' . $ROW->id . '"' . $selected . '>' . $ROW->name . '</option>';
	}
?>
</select></p>
<p><?PHP echo $sxLang['SetupStep5Txt2']; ?></p>
<p align="center">
<input type="hidden" name="sxLanguage" value="<?PHP echo $sxLanguage; ?>" />
<input type="submit" name="SetScheme" value="<?PHP echo $sxLang['SetupButtonConfigureScheme']; ?>" class="sxButton" /></p>
<?PHP
} // End of step 5

if(($step == 6)AND($restart == false))
{ 
	echo '<div class="step">'.$sxLang['SetupStep6'].'</div>';
	echo '<div class="heading">'.$sxLang['SetupStep6Name'].'</div><br />';
	
	if($error_message)
		echo '<center><br /><strong>' .$error_message . '</strong></center>';
	
	echo '<p>'.$sxLang['SetupStep6Txt1'].'</p>';
?>
<table width="500" border="0" cellspacing="0" cellpadding="5">
  <tr> 
    <td> <div align="right"><strong><?PHP echo $sxLang['UserItemFirstName']; ?></strong></div></td>
    <td> <input name="firstname" type="text" maxlength="40" /> 
    </td>
  </tr>
  <tr> 
    <td> <div align="right"><strong><?PHP echo $sxLang['UserItemLastName']; ?></strong></div></td>
    <td> <input type="text" name="lastname" maxlength="40" /> 
    </td>
  </tr>
  <tr> 
    <td> <div align="right"><strong><?PHP echo $sxLang['UserItemEmail']; ?></strong></div></td>
    <td> <input type="text" name="email" maxlength="80" /> 
    </td>
  </tr>
  <tr> 
    <td> <div align="right"><strong><?PHP echo $sxLang['UserItemWebsite']; ?></strong></div></td>
    <td> <input type="text" name="website" maxlength="255" />
	<i> (ex. http://sitex.bjsintay.com)</i></td>
  </tr>
  <tr> 
    <td> <div align="right"><strong><?PHP echo $sxLang['UserItemLocation']; ?></strong></div></td>
    <td> <input type="text" name="location" maxlength="80" /></td>
  </tr>
  <tr> 
    <td> <div align="right"><strong><?PHP echo $sxLang['UserItemUsername']; ?></strong></div></td>
    <td> <input type="text" name="usernameNew" maxlength="40" /> 
    </td>
  </tr>
  <tr> 
    <td> <div align="right"><strong><?PHP echo $sxLang['UserItemPassword']; ?></strong></div></td>
    <td> 
      <input name="passwordNew" type="password" id="passwordNew" maxlength="32" /> 
    </td>
  </tr>
</table>
  <p><?PHP echo $sxLang['SetupStep6Txt2']; ?></p>
  <div align="center">
    <input type="hidden" name="sxLanguage" value="<?PHP echo $sxLanguage; ?>" />
    <input type="submit" name="SetUser_Finish" value="<?PHP echo $sxLang['SetupButtonFinish']; ?>" class="sxButton"/>
  </div>
<?PHP } ?>
  </td>
 </tr>
</table>
</form>
</body>
</html>
Return current item: SiteX