Index: branches/5.2.x/core/install/install_schema.sql
===================================================================
--- branches/5.2.x/core/install/install_schema.sql	(revision 14881)
+++ branches/5.2.x/core/install/install_schema.sql	(revision 14882)
@@ -1,1297 +1,1297 @@
 CREATE TABLE PermissionConfig (
   PermissionConfigId int(11) NOT NULL auto_increment,
   PermissionName varchar(255) NOT NULL default '',
   Description varchar(255) NOT NULL default '',
   ModuleId varchar(20) NOT NULL default '0',
   IsSystem tinyint(1) NOT NULL DEFAULT '0',
   PRIMARY KEY  (PermissionConfigId),
   KEY PermissionName (PermissionName)
 );
 
 CREATE TABLE Permissions (
   PermissionId int(11) NOT NULL auto_increment,
   Permission varchar(255) NOT NULL default '',
   GroupId int(11) default '0',
   PermissionValue int(11) NOT NULL default '0',
   `Type` tinyint(4) NOT NULL default '0',
   CatId int(11) NOT NULL default '0',
   PRIMARY KEY  (PermissionId),
   UNIQUE KEY PermIndex (Permission,GroupId,CatId,`Type`)
 );
 
 CREATE TABLE CustomField (
   CustomFieldId int(11) NOT NULL auto_increment,
   `Type` int(11) NOT NULL default '0',
   FieldName varchar(255) NOT NULL default '',
   FieldLabel varchar(40) default NULL,
   MultiLingual tinyint(3) unsigned NOT NULL default '1',
   Heading varchar(60) default NULL,
   Prompt varchar(60) default NULL,
   ElementType varchar(50) NOT NULL default '',
   ValueList text,
   DefaultValue varchar(255) NOT NULL default '',
   DisplayOrder int(11) NOT NULL default '0',
   OnGeneralTab tinyint(4) NOT NULL default '0',
   IsSystem tinyint(3) unsigned NOT NULL default '0',
   IsRequired tinyint(3) unsigned NOT NULL default '0',
   PRIMARY KEY  (CustomFieldId),
   KEY `Type` (`Type`),
   KEY MultiLingual (MultiLingual),
   KEY DisplayOrder (DisplayOrder),
   KEY OnGeneralTab (OnGeneralTab),
   KEY IsSystem (IsSystem),
   KEY DefaultValue (DefaultValue)
 );
 
 CREATE TABLE ConfigurationValues (
   VariableId int(11) NOT NULL AUTO_INCREMENT,
   VariableName varchar(255) NOT NULL DEFAULT '',
   VariableValue text,
   ModuleOwner varchar(20) DEFAULT 'In-Portal',
   Section varchar(255) NOT NULL DEFAULT '',
   Heading varchar(255) NOT NULL DEFAULT '',
   Prompt varchar(255) NOT NULL DEFAULT '',
   ElementType varchar(255) NOT NULL DEFAULT '',
   Validation text,
   ValueList text,
   DisplayOrder double NOT NULL DEFAULT '0',
   GroupDisplayOrder double NOT NULL DEFAULT '0',
   `Install` int(11) NOT NULL DEFAULT '1',
   HintLabel varchar(255) DEFAULT NULL,
   PRIMARY KEY (VariableId),
   UNIQUE KEY VariableName (VariableName),
   KEY DisplayOrder (DisplayOrder),
   KEY GroupDisplayOrder (GroupDisplayOrder),
   KEY `Install` (`Install`),
   KEY HintLabel (HintLabel)
 );
 
 CREATE TABLE EmailQueue (
   EmailQueueId int(10) unsigned NOT NULL AUTO_INCREMENT,
   ToEmail varchar(255) NOT NULL DEFAULT '',
   `Subject` varchar(255) NOT NULL DEFAULT '',
   MessageHeaders text,
   MessageBody longtext,
   Queued int(10) unsigned DEFAULT NULL,
   SendRetries int(10) unsigned NOT NULL DEFAULT '0',
   LastSendRetry int(10) unsigned DEFAULT NULL,
   MailingId int(10) unsigned NOT NULL DEFAULT '0',
   LogData text,
   PRIMARY KEY (EmailQueueId),
   KEY LastSendRetry (LastSendRetry),
   KEY SendRetries (SendRetries),
   KEY MailingId (MailingId)
 );
 
 CREATE TABLE Events (
   EventId int(11) NOT NULL AUTO_INCREMENT,
   `Event` varchar(40) NOT NULL DEFAULT '',
   ReplacementTags text,
   AllowChangingSender tinyint(4) NOT NULL DEFAULT '0',
   CustomSender tinyint(4) NOT NULL DEFAULT '0',
   SenderName varchar(255) NOT NULL DEFAULT '',
   SenderAddressType tinyint(4) NOT NULL DEFAULT '0',
   SenderAddress varchar(255) NOT NULL DEFAULT '',
   AllowChangingRecipient tinyint(4) NOT NULL DEFAULT '0',
   CustomRecipient tinyint(4) NOT NULL DEFAULT '0',
   Recipients text,
   l1_Subject text,
   l2_Subject text,
   l3_Subject text,
   l4_Subject text,
   l5_Subject text,
   l1_Body longtext,
   l2_Body longtext,
   l3_Body longtext,
   l4_Body longtext,
   l5_Body longtext,
   Headers text,
   MessageType varchar(4) NOT NULL DEFAULT 'text',
   Enabled int(11) NOT NULL DEFAULT '1',
   FrontEndOnly tinyint(3) unsigned NOT NULL DEFAULT '0',
   Module varchar(40) NOT NULL DEFAULT 'Core',
   Description text,
   `Type` int(11) NOT NULL DEFAULT '0',
   PRIMARY KEY (EventId),
   KEY `Type` (`Type`),
   KEY Enabled (Enabled),
   KEY `Event` (`Event`),
   KEY FrontEndOnly (FrontEndOnly),
   KEY AllowChangingSender (AllowChangingSender),
   KEY CustomSender (CustomSender),
   KEY SenderAddressType (SenderAddressType),
   KEY AllowChangingRecipient (AllowChangingRecipient),
   KEY CustomRecipient (CustomRecipient)
 );
 
 CREATE TABLE IdGenerator (
   lastid int(11) default NULL
 );
 
 CREATE TABLE Language (
   LanguageId int(11) NOT NULL AUTO_INCREMENT,
   PackName varchar(40) NOT NULL DEFAULT '',
   LocalName varchar(40) NOT NULL DEFAULT '',
   Enabled int(11) NOT NULL DEFAULT '1',
   PrimaryLang int(11) NOT NULL DEFAULT '0',
   AdminInterfaceLang tinyint(3) unsigned NOT NULL DEFAULT '0',
   Priority int(11) NOT NULL DEFAULT '0',
   IconURL varchar(255) DEFAULT NULL,
   IconDisabledURL varchar(255) DEFAULT NULL,
   DateFormat varchar(50) NOT NULL DEFAULT 'm/d/Y',
   TimeFormat varchar(50) NOT NULL DEFAULT 'g:i:s A',
   InputDateFormat varchar(50) NOT NULL DEFAULT 'm/d/Y',
   InputTimeFormat varchar(50) NOT NULL DEFAULT 'g:i:s A',
   DecimalPoint varchar(10) NOT NULL DEFAULT '.',
   ThousandSep varchar(10) NOT NULL DEFAULT '',
   `Charset` varchar(20) NOT NULL DEFAULT 'utf-8',
   UnitSystem tinyint(4) NOT NULL DEFAULT '1',
   FilenameReplacements text,
   Locale varchar(10) NOT NULL DEFAULT 'en-US',
   UserDocsUrl varchar(255) NOT NULL DEFAULT '',
   SynchronizationModes varchar(255) NOT NULL DEFAULT '',
   PRIMARY KEY (LanguageId),
   KEY Enabled (Enabled),
   KEY PrimaryLang (PrimaryLang),
   KEY AdminInterfaceLang (AdminInterfaceLang),
   KEY Priority (Priority)
 );
 
 CREATE TABLE Modules (
   `Name` varchar(255) NOT NULL DEFAULT '',
   Path varchar(255) NOT NULL DEFAULT '',
   Var varchar(100) NOT NULL DEFAULT '',
   Version varchar(10) NOT NULL DEFAULT '0.0.0',
   Loaded tinyint(4) NOT NULL DEFAULT '1',
   LoadOrder tinyint(4) NOT NULL DEFAULT '0',
   TemplatePath varchar(255) NOT NULL DEFAULT '',
   RootCat int(11) NOT NULL DEFAULT '0',
   BuildDate int(10) unsigned DEFAULT NULL,
   AppliedDBRevisions text,
   PRIMARY KEY (`Name`),
   KEY Loaded (Loaded),
   KEY LoadOrder (LoadOrder)
 );
 
 CREATE TABLE PersistantSessionData (
   VariableId bigint(20) NOT NULL AUTO_INCREMENT,
   PortalUserId int(11) NOT NULL DEFAULT '0',
   VariableName varchar(255) NOT NULL DEFAULT '',
   VariableValue text,
   PRIMARY KEY (VariableId),
   KEY UserId (PortalUserId),
   KEY VariableName (VariableName)
 );
 
 CREATE TABLE Phrase (
   PhraseId int(11) NOT NULL AUTO_INCREMENT,
   Phrase varchar(255) NOT NULL DEFAULT '',
   PhraseKey varchar(255) NOT NULL DEFAULT '',
   l1_Translation text,
   l2_Translation text,
   l3_Translation text,
   l4_Translation text,
   l5_Translation text,
   l1_HintTranslation text,
   l2_HintTranslation text,
   l3_HintTranslation text,
   l4_HintTranslation text,
   l5_HintTranslation text,
   l1_ColumnTranslation text,
   l2_ColumnTranslation text,
   l3_ColumnTranslation text,
   l4_ColumnTranslation text,
   l5_ColumnTranslation text,
   PhraseType int(11) NOT NULL DEFAULT '0',
   LastChanged int(10) unsigned DEFAULT NULL,
   LastChangeIP varchar(15) NOT NULL DEFAULT '',
   Module varchar(30) NOT NULL DEFAULT 'In-Portal',
   PRIMARY KEY (PhraseId),
   KEY Phrase_Index (Phrase),
   KEY PhraseKey (PhraseKey),
   KEY l1_Translation (l1_Translation(5))
 );
 
 CREATE TABLE PhraseCache (
   Template varchar(40) NOT NULL DEFAULT '',
   PhraseList text,
   CacheDate int(11) NOT NULL DEFAULT '0',
   ThemeId int(11) NOT NULL DEFAULT '0',
   StylesheetId int(10) unsigned NOT NULL DEFAULT '0',
   ConfigVariables text,
   PRIMARY KEY (Template),
   KEY CacheDate (CacheDate),
   KEY ThemeId (ThemeId),
   KEY StylesheetId (StylesheetId)
 );
 
 CREATE TABLE PortalGroup (
   GroupId int(11) NOT NULL AUTO_INCREMENT,
   `Name` varchar(255) NOT NULL DEFAULT '',
   Description varchar(255) DEFAULT NULL,
   CreatedOn int(10) unsigned DEFAULT NULL,
   System tinyint(4) NOT NULL DEFAULT '0',
   Personal tinyint(4) NOT NULL DEFAULT '0',
   Enabled tinyint(4) NOT NULL DEFAULT '1',
   FrontRegistration tinyint(3) unsigned NOT NULL DEFAULT '0',
   IPRestrictions text,
   PRIMARY KEY (GroupId),
   UNIQUE KEY `Name` (`Name`),
   KEY Personal (Personal),
   KEY Enabled (Enabled),
   KEY CreatedOn (CreatedOn)
 );
 
 CREATE TABLE PortalUser (
   PortalUserId int(11) NOT NULL AUTO_INCREMENT,
   Username varchar(255) NOT NULL,
   `Password` varchar(255) DEFAULT 'd41d8cd98f00b204e9800998ecf8427e',
   FirstName varchar(255) NOT NULL DEFAULT '',
   LastName varchar(255) NOT NULL DEFAULT '',
   Company varchar(255) NOT NULL DEFAULT '',
   Email varchar(255) NOT NULL DEFAULT '',
   CreatedOn int(11) DEFAULT NULL,
   Phone varchar(255) NOT NULL DEFAULT '',
   Fax varchar(255) NOT NULL DEFAULT '',
   Street varchar(255) NOT NULL DEFAULT '',
   Street2 varchar(255) NOT NULL DEFAULT '',
   City varchar(255) NOT NULL DEFAULT '',
   State varchar(20) NOT NULL DEFAULT '',
   Zip varchar(20) NOT NULL DEFAULT '',
   Country varchar(20) NOT NULL DEFAULT '',
   ResourceId int(11) NOT NULL DEFAULT '0',
   `Status` tinyint(4) NOT NULL DEFAULT '1',
   Modified int(11) DEFAULT NULL,
   dob int(11) DEFAULT NULL,
   tz int(11) DEFAULT NULL,
   IPAddress varchar(15) NOT NULL,
   IsBanned tinyint(1) NOT NULL DEFAULT '0',
   PwResetConfirm varchar(255) NOT NULL,
   PwRequestTime int(11) unsigned DEFAULT NULL,
   AdminLanguage int(11) DEFAULT NULL,
   DisplayToPublic text,
   UserType tinyint(4) NOT NULL,
   PrimaryGroupId int(11) DEFAULT NULL,
   OldStyleLogin tinyint(4) NOT NULL,
   IPRestrictions text,
   PRIMARY KEY (PortalUserId),
   UNIQUE KEY ResourceId (ResourceId),
   KEY CreatedOn (CreatedOn),
   KEY `Status` (`Status`),
   KEY Modified (Modified),
   KEY dob (dob),
   KEY IsBanned (IsBanned),
   KEY AdminLanguage (AdminLanguage),
   KEY UserType (UserType),
   KEY Username (Username)
 );
 
 CREATE TABLE PortalUserCustomData (
   CustomDataId int(11) NOT NULL auto_increment,
   ResourceId int(10) unsigned NOT NULL default '0',
   KEY ResourceId (ResourceId),
   PRIMARY KEY  (CustomDataId)
 );
 
 CREATE TABLE SessionData (
   SessionKey varchar(50) NOT NULL DEFAULT '',
   VariableName varchar(255) NOT NULL DEFAULT '',
   VariableValue longtext,
   PRIMARY KEY (SessionKey,VariableName),
   KEY SessionKey (SessionKey),
   KEY VariableName (VariableName)
 );
 
 CREATE TABLE Theme (
   ThemeId int(11) NOT NULL AUTO_INCREMENT,
   `Name` varchar(40) NOT NULL DEFAULT '',
   Enabled int(11) NOT NULL DEFAULT '1',
   Description varchar(255) DEFAULT NULL,
   PrimaryTheme int(11) NOT NULL DEFAULT '0',
   CacheTimeout int(11) NOT NULL DEFAULT '0',
   StylesheetId int(10) unsigned NOT NULL DEFAULT '0',
   LanguagePackInstalled tinyint(3) unsigned NOT NULL DEFAULT '0',
   TemplateAliases text,
   PRIMARY KEY (ThemeId),
   KEY Enabled (Enabled),
   KEY StylesheetId (StylesheetId),
   KEY PrimaryTheme (PrimaryTheme),
   KEY LanguagePackInstalled (LanguagePackInstalled)
 );
 
 CREATE TABLE ThemeFiles (
   FileId int(11) NOT NULL AUTO_INCREMENT,
   ThemeId int(11) NOT NULL DEFAULT '0',
   FileName varchar(255) NOT NULL DEFAULT '',
   FilePath varchar(255) NOT NULL DEFAULT '',
   TemplateAlias varchar(255) NOT NULL DEFAULT '',
   Description varchar(255) DEFAULT NULL,
   FileType int(11) NOT NULL DEFAULT '0',
   FileFound tinyint(3) unsigned NOT NULL DEFAULT '0',
   FileMetaInfo text,
   PRIMARY KEY (FileId),
   KEY theme (ThemeId),
   KEY FileName (FileName),
   KEY FilePath (FilePath),
   KEY FileFound (FileFound),
   KEY TemplateAlias (TemplateAlias)
 );
 
 CREATE TABLE UserGroup (
   PortalUserId int(11) NOT NULL DEFAULT '0',
   GroupId int(11) NOT NULL DEFAULT '0',
   MembershipExpires int(10) unsigned DEFAULT NULL,
   ExpirationReminderSent tinyint(4) NOT NULL DEFAULT '0',
   PRIMARY KEY (PortalUserId,GroupId),
   KEY GroupId (GroupId),
   KEY MembershipExpires (MembershipExpires),
   KEY ExpirationReminderSent (ExpirationReminderSent)
 );
 
 CREATE TABLE UserSession (
   SessionKey int(10) unsigned NOT NULL DEFAULT '0',
   LastAccessed int(10) unsigned NOT NULL DEFAULT '0',
   PortalUserId int(11) NOT NULL DEFAULT '-2',
   `Language` int(11) NOT NULL DEFAULT '1',
   Theme int(11) NOT NULL DEFAULT '1',
   GroupId int(11) NOT NULL DEFAULT '0',
   IpAddress varchar(20) NOT NULL DEFAULT '0.0.0.0',
   `Status` int(11) NOT NULL DEFAULT '1',
   GroupList varchar(255) DEFAULT NULL,
   tz int(11) DEFAULT NULL,
   BrowserSignature varchar(32) NOT NULL DEFAULT '',
   PRIMARY KEY (SessionKey),
   KEY UserId (PortalUserId),
   KEY LastAccessed (LastAccessed),
   KEY BrowserSignature (BrowserSignature)
 );
 
 CREATE TABLE EmailLog (
   EmailLogId int(11) NOT NULL AUTO_INCREMENT,
   fromuser varchar(200) DEFAULT NULL,
   addressto varchar(255) DEFAULT NULL,
   `subject` varchar(255) DEFAULT NULL,
   `timestamp` bigint(20) DEFAULT '0',
   `event` varchar(100) DEFAULT NULL,
   EventParams text,
   PRIMARY KEY (EmailLogId),
   KEY `timestamp` (`timestamp`)
 );
 
 CREATE TABLE Cache (
   VarName varchar(255) NOT NULL default '',
   Data longtext,
   Cached int(11) default NULL,
   LifeTime int(11) NOT NULL default '-1',
   PRIMARY KEY  (VarName),
   KEY Cached (Cached)
 );
 
 CREATE TABLE CountryStates (
   CountryStateId int(11) NOT NULL AUTO_INCREMENT,
   `Type` int(11) NOT NULL DEFAULT '1',
   StateCountryId int(11) DEFAULT NULL,
   l1_Name varchar(255) NOT NULL,
   l2_Name varchar(255) NOT NULL,
   l3_Name varchar(255) NOT NULL,
   l4_Name varchar(255) NOT NULL,
   l5_Name varchar(255) NOT NULL,
   IsoCode char(3) NOT NULL DEFAULT '',
   ShortIsoCode char(2) DEFAULT NULL,
   PRIMARY KEY (CountryStateId),
   KEY `Type` (`Type`),
   KEY StateCountryId (StateCountryId),
   KEY l1_Name (l1_Name(5))
 );
 
 CREATE TABLE Category (
   CategoryId int(11) NOT NULL AUTO_INCREMENT,
   `Type` int(11) NOT NULL DEFAULT '1',
   SymLinkCategoryId int(10) unsigned DEFAULT NULL,
   ParentId int(11) NOT NULL DEFAULT '0',
   `Name` varchar(255) NOT NULL DEFAULT '',
   l1_Name varchar(255) NOT NULL DEFAULT '',
   l2_Name varchar(255) NOT NULL DEFAULT '',
   l3_Name varchar(255) NOT NULL DEFAULT '',
   l4_Name varchar(255) NOT NULL DEFAULT '',
   l5_Name varchar(255) NOT NULL DEFAULT '',
   Filename varchar(255) NOT NULL DEFAULT '',
   AutomaticFilename tinyint(3) unsigned NOT NULL DEFAULT '1',
   Description text,
   l1_Description text,
   l2_Description text,
   l3_Description text,
   l4_Description text,
   l5_Description text,
   CreatedOn int(11) DEFAULT NULL,
   EditorsPick tinyint(4) NOT NULL DEFAULT '0',
   `Status` tinyint(4) NOT NULL DEFAULT '1',
   Priority int(11) NOT NULL DEFAULT '0',
   MetaKeywords text,
   CachedDescendantCatsQty int(11) NOT NULL DEFAULT '0',
   CachedNavbar text,
   l1_CachedNavbar text,
   l2_CachedNavbar text,
   l3_CachedNavbar text,
   l4_CachedNavbar text,
   l5_CachedNavbar text,
   CreatedById int(11) DEFAULT NULL,
   ResourceId int(11) DEFAULT NULL,
   ParentPath text,
   TreeLeft bigint(20) NOT NULL DEFAULT '0',
   TreeRight bigint(20) NOT NULL DEFAULT '0',
   NamedParentPath text,
   MetaDescription text,
   HotItem int(11) NOT NULL DEFAULT '2',
   NewItem int(11) NOT NULL DEFAULT '2',
   PopItem int(11) NOT NULL DEFAULT '2',
   Modified int(11) DEFAULT NULL,
   ModifiedById int(11) DEFAULT NULL,
   CachedTemplate varchar(255) NOT NULL DEFAULT '',
   Template varchar(255) NOT NULL DEFAULT '#inherit#',
   UseExternalUrl tinyint(3) unsigned NOT NULL DEFAULT '0',
   ExternalUrl varchar(255) NOT NULL DEFAULT '',
   UseMenuIconUrl tinyint(3) unsigned NOT NULL DEFAULT '0',
   MenuIconUrl varchar(255) NOT NULL DEFAULT '',
   l1_Title varchar(255) DEFAULT '',
   l2_Title varchar(255) DEFAULT '',
   l3_Title varchar(255) DEFAULT '',
   l4_Title varchar(255) DEFAULT '',
   l5_Title varchar(255) DEFAULT '',
   l1_MenuTitle varchar(255) NOT NULL DEFAULT '',
   l2_MenuTitle varchar(255) NOT NULL DEFAULT '',
   l3_MenuTitle varchar(255) NOT NULL DEFAULT '',
   l4_MenuTitle varchar(255) NOT NULL DEFAULT '',
   l5_MenuTitle varchar(255) NOT NULL DEFAULT '',
   MetaTitle text,
   IndexTools text,
   IsMenu tinyint(4) NOT NULL DEFAULT '1',
   Protected tinyint(4) NOT NULL DEFAULT '0',
   FormId int(11) DEFAULT NULL,
   FormSubmittedTemplate varchar(255) DEFAULT NULL,
   FriendlyURL varchar(255) NOT NULL DEFAULT '',
   ThemeId int(10) unsigned NOT NULL DEFAULT '0',
   EnablePageCache tinyint(4) NOT NULL DEFAULT '0',
   OverridePageCacheKey tinyint(4) NOT NULL DEFAULT '0',
   PageCacheKey varchar(255) NOT NULL DEFAULT '',
   PageExpiration int(11) DEFAULT NULL,
   LiveRevisionNumber int(11) NOT NULL DEFAULT '1',
   DirectLinkEnabled tinyint(4) NOT NULL DEFAULT '1',
   DirectLinkAuthKey varchar(20) NOT NULL,
   PRIMARY KEY (CategoryId),
   UNIQUE KEY ResourceId (ResourceId),
   KEY ParentId (ParentId),
   KEY Modified (Modified),
   KEY Priority (Priority),
   KEY sorting (`Name`,Priority),
   KEY Filename (Filename(5)),
   KEY l1_Name (l1_Name(5)),
   KEY l2_Name (l2_Name(5)),
   KEY l3_Name (l3_Name(5)),
   KEY l4_Name (l4_Name(5)),
   KEY l5_Name (l5_Name(5)),
   KEY l1_Description (l1_Description(5)),
   KEY l2_Description (l2_Description(5)),
   KEY l3_Description (l3_Description(5)),
   KEY l4_Description (l4_Description(5)),
   KEY l5_Description (l5_Description(5)),
   KEY TreeLeft (TreeLeft),
   KEY TreeRight (TreeRight),
   KEY SymLinkCategoryId (SymLinkCategoryId),
   KEY `Status` (`Status`),
   KEY CreatedOn (CreatedOn),
   KEY EditorsPick (EditorsPick),
   KEY ThemeId (ThemeId),
   KEY EnablePageCache (EnablePageCache),
   KEY OverridePageCacheKey (OverridePageCacheKey),
   KEY PageExpiration (PageExpiration),
   KEY Protected (Protected),
   KEY LiveRevisionNumber (LiveRevisionNumber)
 );
 
 CREATE TABLE CategoryCustomData (
   CustomDataId int(11) NOT NULL auto_increment,
   ResourceId int(10) unsigned NOT NULL default '0',
   KEY ResourceId (ResourceId),
   PRIMARY KEY  (CustomDataId)
 );
 
 CREATE TABLE CategoryItems (
   CategoryId int(11) NOT NULL default '0',
   ItemResourceId int(11) NOT NULL default '0',
   PrimaryCat tinyint(4) NOT NULL default '0',
   ItemPrefix varchar(50) NOT NULL default '',
   Filename varchar(255) NOT NULL default '',
   UNIQUE KEY CategoryId (CategoryId,ItemResourceId),
   KEY PrimaryCat (PrimaryCat),
   KEY ItemPrefix (ItemPrefix),
   KEY ItemResourceId (ItemResourceId),
   KEY Filename (Filename)
 );
 
 CREATE TABLE PermCache (
   PermCacheId int(11) NOT NULL auto_increment,
   CategoryId int(11) NOT NULL default '0',
   PermId int(11) NOT NULL default '0',
   ACL varchar(255) NOT NULL default '',
   PRIMARY KEY  (PermCacheId),
   KEY CategoryId (CategoryId),
   KEY PermId (PermId),
   KEY ACL (ACL)
 );
 
 CREATE TABLE PopupSizes (
   PopupId int(10) unsigned NOT NULL auto_increment,
   TemplateName varchar(255) NOT NULL default '',
   PopupWidth int(11) NOT NULL default '0',
   PopupHeight int(11) NOT NULL default '0',
   PRIMARY KEY  (PopupId),
   KEY TemplateName (TemplateName)
 );
 
 CREATE TABLE Counters (
   CounterId int(10) unsigned NOT NULL auto_increment,
   Name varchar(100) NOT NULL default '',
   CountQuery text,
   CountValue text,
   LastCounted int(10) unsigned default NULL,
   LifeTime int(10) unsigned NOT NULL default '3600',
   IsClone tinyint(3) unsigned NOT NULL default '0',
   TablesAffected text,
   PRIMARY KEY  (CounterId),
   UNIQUE KEY Name (Name),
   KEY IsClone (IsClone),
   KEY LifeTime (LifeTime),
   KEY LastCounted (LastCounted)
 );
 
 CREATE TABLE Skins (
   SkinId int(11) NOT NULL AUTO_INCREMENT,
   `Name` varchar(255) DEFAULT NULL,
   CSS text,
   Logo varchar(255) DEFAULT NULL,
   LogoBottom varchar(255) NOT NULL DEFAULT '',
   LogoLogin varchar(255) NOT NULL DEFAULT '',
   `Options` text,
   LastCompiled int(11) NOT NULL DEFAULT '0',
   IsPrimary int(1) NOT NULL DEFAULT '0',
   DisplaySiteNameInHeader tinyint(1) NOT NULL DEFAULT '1',
   PRIMARY KEY (SkinId),
   KEY IsPrimary (IsPrimary),
   KEY LastCompiled (LastCompiled)
 );
 
 CREATE TABLE ChangeLogs (
   ChangeLogId bigint(20) NOT NULL AUTO_INCREMENT,
   PortalUserId int(11) NOT NULL DEFAULT '0',
   SessionLogId int(11) NOT NULL DEFAULT '0',
   `Action` tinyint(4) NOT NULL DEFAULT '0',
   OccuredOn int(11) DEFAULT NULL,
   Prefix varchar(255) NOT NULL DEFAULT '',
   ItemId bigint(20) NOT NULL DEFAULT '0',
   Changes text,
   MasterPrefix varchar(255) NOT NULL DEFAULT '',
   MasterId bigint(20) NOT NULL DEFAULT '0',
   PRIMARY KEY (ChangeLogId),
   KEY PortalUserId (PortalUserId),
   KEY SessionLogId (SessionLogId),
   KEY `Action` (`Action`),
   KEY OccuredOn (OccuredOn),
   KEY Prefix (Prefix),
   KEY MasterPrefix (MasterPrefix)
 );
 
 CREATE TABLE SessionLogs (
   SessionLogId bigint(20) NOT NULL AUTO_INCREMENT,
   PortalUserId int(11) NOT NULL DEFAULT '0',
   SessionId int(10) NOT NULL DEFAULT '0',
   `Status` tinyint(4) NOT NULL DEFAULT '1',
   SessionStart int(11) DEFAULT NULL,
   SessionEnd int(11) DEFAULT NULL,
   IP varchar(15) NOT NULL DEFAULT '',
   AffectedItems int(11) NOT NULL DEFAULT '0',
   PRIMARY KEY (SessionLogId),
   KEY SessionId (SessionId),
   KEY `Status` (`Status`),
   KEY PortalUserId (PortalUserId)
 );
 
 CREATE TABLE StatisticsCapture (
   StatisticsId int(10) unsigned NOT NULL auto_increment,
   TemplateName varchar(255) NOT NULL default '',
   Hits int(10) unsigned NOT NULL default '0',
   LastHit int(11) NOT NULL default '0',
   ScriptTimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   ScriptTimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   ScriptTimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   SqlTimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   SqlTimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   SqlTimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   SqlCountMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   SqlCountAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   SqlCountMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   PRIMARY KEY  (StatisticsId),
   KEY TemplateName (TemplateName),
   KEY Hits (Hits),
   KEY LastHit (LastHit),
   KEY ScriptTimeMin (ScriptTimeMin),
   KEY ScriptTimeAvg (ScriptTimeAvg),
   KEY ScriptTimeMax (ScriptTimeMax),
   KEY SqlTimeMin (SqlTimeMin),
   KEY SqlTimeAvg (SqlTimeAvg),
   KEY SqlTimeMax (SqlTimeMax),
   KEY SqlCountMin (SqlCountMin),
   KEY SqlCountAvg (SqlCountAvg),
   KEY SqlCountMax (SqlCountMax)
 );
 
 CREATE TABLE SlowSqlCapture (
   CaptureId int(10) unsigned NOT NULL auto_increment,
   TemplateNames text,
   Hits int(10) unsigned NOT NULL default '0',
   LastHit int(11) NOT NULL default '0',
   SqlQuery text,
   TimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   TimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   TimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
   QueryCrc int(11) NOT NULL default '0',
   PRIMARY KEY  (CaptureId),
   KEY Hits (Hits),
   KEY LastHit (LastHit),
   KEY TimeMin (TimeMin),
   KEY TimeAvg (TimeAvg),
   KEY TimeMax (TimeMax),
   KEY QueryCrc (QueryCrc)
 );
 
 CREATE TABLE ScheduledTasks (
-  ScheduledTaskId int(11) NOT NULL auto_increment,
-  `Name` varchar(255) NOT NULL default '',
-  `Type` tinyint(3) unsigned NOT NULL default '1',
-  Status tinyint(3) unsigned NOT NULL default '1',
-  Event varchar(255) NOT NULL default '',
-  RunInterval int(10) unsigned NOT NULL default '0',
-  RunMode tinyint(3) unsigned NOT NULL default '2',
-  LastRunOn int(10) unsigned default NULL,
-  LastRunStatus tinyint(3) unsigned NOT NULL default '1',
-  NextRunOn int(11) default NULL,
-  RunTime int(10) unsigned NOT NULL default '0',
-  Timeout int(10) UNSIGNED NULL,
-  LastTimeoutOn int(10) unsigned default NULL,
+  ScheduledTaskId int(11) NOT NULL AUTO_INCREMENT,
+  `Name` varchar(255) NOT NULL DEFAULT '',
+  `Type` tinyint(3) unsigned NOT NULL DEFAULT '1',
+  `Status` tinyint(3) unsigned NOT NULL DEFAULT '1',
+  `Event` varchar(255) NOT NULL DEFAULT '',
+  RunInterval int(10) unsigned NOT NULL DEFAULT '0',
+  RunMode tinyint(3) unsigned NOT NULL DEFAULT '2',
+  LastRunOn int(10) unsigned DEFAULT NULL,
+  LastRunStatus tinyint(3) unsigned NOT NULL DEFAULT '1',
+  NextRunOn int(11) DEFAULT NULL,
+  RunTime int(10) unsigned NOT NULL DEFAULT '0',
+  Timeout int(10) unsigned DEFAULT NULL,
+  LastTimeoutOn int(10) unsigned DEFAULT NULL,
   SiteDomainLimitation varchar(255) NOT NULL,
-  PRIMARY KEY  (ScheduledTaskId),
-  KEY Status (Status),
+  PRIMARY KEY (ScheduledTaskId),
+  KEY `Status` (`Status`),
   KEY RunInterval (RunInterval),
   KEY RunMode (RunMode),
-  KEY `Type` (`Type`),
   KEY LastRunOn (LastRunOn),
   KEY LastRunStatus (LastRunStatus),
   KEY RunTime (RunTime),
   KEY NextRunOn (NextRunOn),
+  KEY SiteDomainLimitation (SiteDomainLimitation),
   KEY Timeout (Timeout),
-  KEY SiteDomainLimitation (SiteDomainLimitation)
+  KEY `Type` (`Type`)
 );
 
 CREATE TABLE SpellingDictionary (
   SpellingDictionaryId int(11) NOT NULL auto_increment,
   MisspelledWord varchar(255) NOT NULL default '',
   SuggestedCorrection varchar(255) NOT NULL default '',
   PRIMARY KEY  (SpellingDictionaryId),
   KEY MisspelledWord (MisspelledWord),
   KEY SuggestedCorrection (SuggestedCorrection)
 );
 
 CREATE TABLE Thesaurus (
   ThesaurusId int(11) NOT NULL auto_increment,
   SearchTerm varchar(255) NOT NULL default '',
   ThesaurusTerm varchar(255) NOT NULL default '',
   ThesaurusType tinyint(3) unsigned NOT NULL default '0',
   PRIMARY KEY  (ThesaurusId),
   KEY ThesaurusType (ThesaurusType),
   KEY SearchTerm (SearchTerm)
 );
 
 CREATE TABLE LocalesList (
   LocaleId int(11) NOT NULL auto_increment,
   LocaleIdentifier varchar(6) NOT NULL default '',
   LocaleName varchar(255) NOT NULL default '',
   Locale varchar(20) NOT NULL default '',
   ScriptTag varchar(255) NOT NULL default '',
   ANSICodePage varchar(10) NOT NULL default '',
   PRIMARY KEY (LocaleId)
 );
 
 CREATE TABLE BanRules (
   RuleId int(11) NOT NULL auto_increment,
   RuleType tinyint(4) NOT NULL default '0',
   ItemField varchar(255) default NULL,
   ItemVerb tinyint(4) NOT NULL default '0',
   ItemValue varchar(255) NOT NULL default '',
   ItemType int(11) NOT NULL default '0',
   Priority int(11) NOT NULL default '0',
   Status tinyint(4) NOT NULL default '1',
   ErrorTag varchar(255) default NULL,
   PRIMARY KEY  (RuleId),
   KEY Status (Status),
   KEY Priority (Priority),
   KEY ItemType (ItemType)
 );
 
 CREATE TABLE CountCache (
   ListType int(11) NOT NULL default '0',
   ItemType int(11) NOT NULL default '-1',
   Value int(11) NOT NULL default '0',
   CountCacheId int(11) NOT NULL auto_increment,
   LastUpdate int(11) NOT NULL default '0',
   ExtraId varchar(50) default NULL,
   TodayOnly tinyint(4) NOT NULL default '0',
   PRIMARY KEY  (CountCacheId)
 );
 
 CREATE TABLE Favorites (
   FavoriteId int(11) NOT NULL auto_increment,
   PortalUserId int(11) NOT NULL default '0',
   ResourceId int(11) NOT NULL default '0',
   ItemTypeId int(11) NOT NULL default '0',
   Modified int(11) NOT NULL default '0',
   PRIMARY KEY  (FavoriteId),
   UNIQUE KEY main (PortalUserId,ResourceId),
   KEY Modified (Modified),
   KEY ItemTypeId (ItemTypeId)
 );
 
 CREATE TABLE Images (
   ImageId int(11) NOT NULL auto_increment,
   ResourceId int(11) NOT NULL default '0',
   Url varchar(255) NOT NULL default '',
   Name varchar(255) NOT NULL default '',
   AltName VARCHAR(255) NOT NULL DEFAULT '',
   ImageIndex int(11) NOT NULL default '0',
   LocalImage tinyint(4) NOT NULL default '1',
   LocalPath varchar(240) NOT NULL default '',
   Enabled int(11) NOT NULL default '1',
   DefaultImg int(11) NOT NULL default '0',
   ThumbUrl varchar(255) default NULL,
   Priority int(11) NOT NULL default '0',
   ThumbPath varchar(255) default NULL,
   LocalThumb tinyint(4) NOT NULL default '1',
   SameImages tinyint(4) NOT NULL default '1',
   PRIMARY KEY  (ImageId),
   KEY ResourceId (ResourceId),
   KEY Enabled (Enabled),
   KEY Priority (Priority)
 );
 
 CREATE TABLE ItemRating (
   RatingId int(11) NOT NULL auto_increment,
   IPAddress varchar(255) NOT NULL default '',
   CreatedOn INT UNSIGNED NULL DEFAULT NULL,
   RatingValue int(11) NOT NULL default '0',
   ItemId int(11) NOT NULL default '0',
   PRIMARY KEY  (RatingId),
   KEY CreatedOn (CreatedOn),
   KEY ItemId (ItemId),
   KEY RatingValue (RatingValue)
 );
 
 CREATE TABLE ItemReview (
   ReviewId int(11) NOT NULL AUTO_INCREMENT,
   CreatedOn int(10) unsigned DEFAULT NULL,
   ReviewText longtext,
   Rating tinyint(3) unsigned NOT NULL DEFAULT '0',
   IPAddress varchar(255) NOT NULL DEFAULT '',
   ItemId int(11) NOT NULL DEFAULT '0',
   CreatedById int(11) DEFAULT NULL,
   ItemType tinyint(4) NOT NULL DEFAULT '0',
   Priority int(11) NOT NULL DEFAULT '0',
   `Status` tinyint(4) NOT NULL DEFAULT '2',
   TextFormat int(11) NOT NULL DEFAULT '0',
   Module varchar(255) NOT NULL DEFAULT '',
   HelpfulCount int(11) NOT NULL,
   NotHelpfulCount int(11) NOT NULL,
   PRIMARY KEY (ReviewId),
   KEY CreatedOn (CreatedOn),
   KEY ItemId (ItemId),
   KEY ItemType (ItemType),
   KEY Priority (Priority),
   KEY `Status` (`Status`)
 );
 
 CREATE TABLE SpamReports (
   ReportId int(11) NOT NULL AUTO_INCREMENT,
   ItemPrefix varchar(255) NOT NULL,
   ItemId int(11) NOT NULL,
   MessageText text,
   ReportedOn int(11) DEFAULT NULL,
   ReportedById int(11) DEFAULT NULL,
   PRIMARY KEY (ReportId),
   KEY ItemPrefix (ItemPrefix),
   KEY ItemId (ItemId),
   KEY ReportedById (ReportedById)
 );
 
 CREATE TABLE ItemTypes (
   ItemType int(11) NOT NULL default '0',
   Module varchar(50) NOT NULL default '',
   Prefix varchar(20) NOT NULL default '',
   SourceTable varchar(100) NOT NULL default '',
   TitleField varchar(50) default NULL,
   CreatorField varchar(255) NOT NULL default '',
   PopField varchar(255) default NULL,
   RateField varchar(255) default NULL,
   LangVar varchar(255) NOT NULL default '',
   PrimaryItem int(11) NOT NULL default '0',
   EditUrl varchar(255) NOT NULL default '',
   ClassName varchar(40) NOT NULL default '',
   ItemName varchar(50) NOT NULL default '',
   PRIMARY KEY  (ItemType),
   KEY Module (Module)
 );
 
 CREATE TABLE ItemFiles (
   FileId int(11) NOT NULL AUTO_INCREMENT,
   ResourceId int(11) unsigned NOT NULL DEFAULT '0',
   FileName varchar(255) NOT NULL DEFAULT '',
   FilePath varchar(255) NOT NULL DEFAULT '',
   Size int(11) NOT NULL DEFAULT '0',
   `Status` tinyint(4) NOT NULL DEFAULT '1',
   CreatedOn int(11) unsigned DEFAULT NULL,
   CreatedById int(11) DEFAULT NULL,
   MimeType varchar(255) NOT NULL DEFAULT '',
   PRIMARY KEY (FileId),
   KEY ResourceId (ResourceId),
   KEY CreatedOn (CreatedOn),
   KEY `Status` (`Status`)
 );
 
 CREATE TABLE Relationship (
   RelationshipId int(11) NOT NULL auto_increment,
   SourceId int(11) default NULL,
   TargetId int(11) default NULL,
   SourceType tinyint(4) NOT NULL default '0',
   TargetType tinyint(4) NOT NULL default '0',
   Type int(11) NOT NULL default '0',
   Enabled int(11) NOT NULL default '1',
   Priority int(11) NOT NULL default '0',
   PRIMARY KEY  (RelationshipId),
   KEY RelSource (SourceId),
   KEY RelTarget (TargetId),
   KEY `Type` (`Type`),
   KEY Enabled (Enabled),
   KEY Priority (Priority),
   KEY SourceType (SourceType),
   KEY TargetType (TargetType)
 );
 
 CREATE TABLE SearchConfig (
   TableName varchar(40) NOT NULL default '',
   FieldName varchar(40) NOT NULL default '',
   SimpleSearch tinyint(4) NOT NULL default '1',
   AdvancedSearch tinyint(4) NOT NULL default '1',
   Description varchar(255) default NULL,
   DisplayName varchar(80) default NULL,
   ModuleName VARCHAR(20) NOT NULL DEFAULT 'In-Portal',
   ConfigHeader varchar(255) default NULL,
   DisplayOrder int(11) NOT NULL default '0',
   SearchConfigId int(11) NOT NULL auto_increment,
   Priority int(11) NOT NULL default '0',
   FieldType varchar(20) NOT NULL default 'text',
   ForeignField TEXT,
   JoinClause TEXT,
   IsWhere text,
   IsNotWhere text,
   ContainsWhere text,
   NotContainsWhere text,
   CustomFieldId int(11) default NULL,
   PRIMARY KEY  (SearchConfigId),
   KEY SimpleSearch (SimpleSearch),
   KEY AdvancedSearch (AdvancedSearch),
   KEY DisplayOrder (DisplayOrder),
   KEY Priority (Priority),
   KEY CustomFieldId (CustomFieldId)
 );
 
 CREATE TABLE SearchLog (
   SearchLogId int(11) NOT NULL auto_increment,
   Keyword varchar(255) NOT NULL default '',
   Indices bigint(20) NOT NULL default '0',
   SearchType int(11) NOT NULL default '0',
   PRIMARY KEY  (SearchLogId),
   KEY Keyword (Keyword),
   KEY SearchType (SearchType)
 );
 
 CREATE TABLE SpamControl (
   ItemResourceId int(11) NOT NULL default '0',
   IPaddress varchar(20) NOT NULL default '',
   Expire INT UNSIGNED NULL DEFAULT NULL,
   PortalUserId int(11) NOT NULL default '0',
   DataType varchar(20) default NULL,
   KEY PortalUserId (PortalUserId),
   KEY Expire (Expire),
   KEY DataType (DataType),
   KEY ItemResourceId (ItemResourceId)
 );
 
 CREATE TABLE StatItem (
   StatItemId int(11) NOT NULL auto_increment,
   Module varchar(20) NOT NULL default '',
   ValueSQL varchar(255) default NULL,
   ResetSQL varchar(255) default NULL,
   ListLabel varchar(255) NOT NULL default '',
   Priority int(11) NOT NULL default '0',
   AdminSummary int(11) NOT NULL default '0',
   PRIMARY KEY  (StatItemId),
   KEY AdminSummary (AdminSummary),
   KEY Priority (Priority)
 );
 
 CREATE TABLE ImportScripts (
   ImportId int(11) NOT NULL AUTO_INCREMENT,
   `Name` varchar(255) NOT NULL DEFAULT '',
   Description text,
   Prefix varchar(10) NOT NULL DEFAULT '',
   Module varchar(50) NOT NULL DEFAULT '',
   ExtraFields varchar(255) NOT NULL DEFAULT '',
   `Type` varchar(10) NOT NULL DEFAULT '',
   `Status` tinyint(4) NOT NULL DEFAULT '1',
   PRIMARY KEY (ImportId),
   KEY Module (Module),
   KEY `Status` (`Status`)
 );
 
 CREATE TABLE Visits (
   VisitId int(11) NOT NULL AUTO_INCREMENT,
   VisitDate int(10) unsigned DEFAULT NULL,
   Referer varchar(255) NOT NULL DEFAULT '',
   IPAddress varchar(15) NOT NULL DEFAULT '',
   AffiliateId int(10) unsigned NOT NULL DEFAULT '0',
   PortalUserId int(11) NOT NULL DEFAULT '-2',
   PRIMARY KEY (VisitId),
   KEY PortalUserId (PortalUserId),
   KEY AffiliateId (AffiliateId),
   KEY VisitDate (VisitDate)
 );
 
 CREATE TABLE ImportCache (
   CacheId int(11) NOT NULL AUTO_INCREMENT,
   CacheName varchar(255) NOT NULL DEFAULT '',
   VarName int(11) NOT NULL DEFAULT '0',
   VarValue text,
   PRIMARY KEY (CacheId),
   KEY CacheName (CacheName),
   KEY VarName (VarName)
 );
 
 CREATE TABLE RelatedSearches (
   RelatedSearchId int(11) NOT NULL auto_increment,
   ResourceId int(11) NOT NULL default '0',
   Keyword varchar(255) NOT NULL default '',
   ItemType tinyint(4) NOT NULL default '0',
   Enabled tinyint(4) NOT NULL default '1',
   Priority int(11) NOT NULL default '0',
   PRIMARY KEY  (RelatedSearchId),
   KEY Enabled (Enabled),
   KEY ItemType (ItemType),
   KEY ResourceId (ResourceId)
 );
 
 CREATE TABLE StopWords (
   StopWordId int(11) NOT NULL auto_increment,
   StopWord varchar(255) NOT NULL default '',
   PRIMARY KEY  (StopWordId),
   KEY StopWord (StopWord)
 );
 
 CREATE TABLE MailingLists (
   MailingId int(10) unsigned NOT NULL AUTO_INCREMENT,
   PortalUserId int(11) NOT NULL DEFAULT '-1',
   `To` longtext,
   ToParsed longtext,
   Attachments text,
   `Subject` varchar(255) NOT NULL DEFAULT '',
   MessageText longtext,
   MessageHtml longtext,
   `Status` tinyint(3) unsigned NOT NULL DEFAULT '1',
   EmailsQueued int(10) unsigned NOT NULL DEFAULT '0',
   EmailsSent int(10) unsigned NOT NULL DEFAULT '0',
   EmailsTotal int(10) unsigned NOT NULL DEFAULT '0',
   PRIMARY KEY (MailingId),
   KEY EmailsTotal (EmailsTotal),
   KEY EmailsSent (EmailsSent),
   KEY EmailsQueued (EmailsQueued),
   KEY `Status` (`Status`),
   KEY PortalUserId (PortalUserId)
 );
 
 CREATE TABLE PageContent (
   PageContentId int(11) NOT NULL AUTO_INCREMENT,
   ContentNum int(11) NOT NULL DEFAULT '0',
   PageId int(11) NOT NULL DEFAULT '0',
   RevisionId int(11) NOT NULL,
   l1_Content text,
   l2_Content text,
   l3_Content text,
   l4_Content text,
   l5_Content text,
   PRIMARY KEY (PageContentId),
   KEY ContentNum (ContentNum,PageId),
   KEY RevisionId (RevisionId)
 );
 
 CREATE TABLE PageRevisions (
   RevisionId int(11) NOT NULL AUTO_INCREMENT,
   PageId int(11) NOT NULL,
   RevisionNumber int(11) NOT NULL,
   IsDraft tinyint(4) NOT NULL,
   FromRevisionId int(11) NOT NULL,
   CreatedById int(11) DEFAULT NULL,
   CreatedOn int(11) DEFAULT NULL,
   AutoSavedOn int(11) DEFAULT NULL,
   `Status` tinyint(4) NOT NULL DEFAULT '2',
   PRIMARY KEY (RevisionId),
   KEY PageId (PageId),
   KEY RevisionNumber (RevisionNumber),
   KEY IsDraft (IsDraft),
   KEY `Status` (`Status`)
 );
 
 CREATE TABLE FormFields (
   FormFieldId int(11) NOT NULL AUTO_INCREMENT,
   FormId int(11) NOT NULL DEFAULT '0',
   `Type` int(11) NOT NULL DEFAULT '0',
   FieldName varchar(255) NOT NULL DEFAULT '',
   FieldLabel varchar(255) DEFAULT NULL,
   Heading varchar(255) DEFAULT NULL,
   Prompt varchar(255) DEFAULT NULL,
   ElementType varchar(50) NOT NULL DEFAULT '',
   ValueList varchar(255) DEFAULT NULL,
   Priority int(11) NOT NULL DEFAULT '0',
   IsSystem tinyint(3) unsigned NOT NULL DEFAULT '0',
   Required tinyint(1) NOT NULL DEFAULT '0',
   DisplayInGrid tinyint(1) NOT NULL DEFAULT '1',
   DefaultValue text,
   Validation tinyint(4) NOT NULL DEFAULT '0',
   UploadExtensions varchar(255) NOT NULL DEFAULT '',
   UploadMaxSize int(11) DEFAULT NULL,
   Visibility tinyint(4) NOT NULL DEFAULT '1',
   EmailCommunicationRole tinyint(4) NOT NULL DEFAULT '0',
   PRIMARY KEY (FormFieldId),
   KEY `Type` (`Type`),
   KEY FormId (FormId),
   KEY Priority (Priority),
   KEY IsSystem (IsSystem),
   KEY DisplayInGrid (DisplayInGrid),
   KEY Visibility (Visibility),
   KEY EmailCommunicationRole (EmailCommunicationRole)
 );
 
 CREATE TABLE FormSubmissions (
   FormSubmissionId int(11) NOT NULL AUTO_INCREMENT,
   FormId int(11) NOT NULL DEFAULT '0',
   SubmissionTime int(11) DEFAULT NULL,
   IPAddress varchar(15) NOT NULL DEFAULT '',
   ReferrerURL text NULL,
   LogStatus tinyint(3) unsigned NOT NULL DEFAULT '2',
   LastUpdatedOn int(10) unsigned DEFAULT NULL,
   Notes text,
   MessageId varchar(255) DEFAULT NULL,
   PRIMARY KEY (FormSubmissionId),
   KEY FormId (FormId),
   KEY SubmissionTime (SubmissionTime),
   KEY LogStatus (LogStatus),
   KEY LastUpdatedOn (LastUpdatedOn),
   KEY MessageId (MessageId)
 );
 
 CREATE TABLE SubmissionLog (
   SubmissionLogId int(11) NOT NULL AUTO_INCREMENT,
   FormSubmissionId int(10) unsigned NOT NULL,
   FromEmail varchar(255) NOT NULL DEFAULT '',
   ToEmail varchar(255) NOT NULL DEFAULT '',
   Cc text,
   Bcc text,
   `Subject` varchar(255) NOT NULL DEFAULT '',
   Message text,
   Attachment text,
   ReplyStatus tinyint(3) unsigned NOT NULL DEFAULT '0',
   SentStatus tinyint(3) unsigned NOT NULL DEFAULT '0',
   SentOn int(10) unsigned DEFAULT NULL,
   RepliedOn int(10) unsigned DEFAULT NULL,
   VerifyCode varchar(32) NOT NULL DEFAULT '',
   DraftId int(10) unsigned NOT NULL DEFAULT '0',
   MessageId varchar(255) NOT NULL DEFAULT '',
   BounceInfo text,
   BounceDate int(11) DEFAULT NULL,
   PRIMARY KEY (SubmissionLogId),
   KEY FormSubmissionId (FormSubmissionId),
   KEY ReplyStatus (ReplyStatus),
   KEY SentStatus (SentStatus),
   KEY SentOn (SentOn),
   KEY RepliedOn (RepliedOn),
   KEY VerifyCode (VerifyCode),
   KEY DraftId (DraftId),
   KEY BounceDate (BounceDate),
   KEY MessageId (MessageId)
 );
 
 CREATE TABLE Drafts (
   DraftId int(11) NOT NULL AUTO_INCREMENT,
   FormSubmissionId int(10) unsigned NOT NULL DEFAULT '0',
   CreatedOn int(10) unsigned DEFAULT NULL,
   CreatedById int(11) DEFAULT NULL,
   Message text,
   PRIMARY KEY (DraftId),
   KEY FormSubmissionId (FormSubmissionId),
   KEY CreatedOn (CreatedOn),
   KEY CreatedById (CreatedById)
 );
 
 CREATE TABLE Forms (
   FormId int(11) NOT NULL AUTO_INCREMENT,
   Title varchar(255) NOT NULL DEFAULT '',
   Description text,
   RequireLogin tinyint(4) NOT NULL DEFAULT '0',
   UseSecurityImage tinyint(4) NOT NULL DEFAULT '0',
   SubmitNotifyEmail varchar(255) NOT NULL DEFAULT '',
   EnableEmailCommunication tinyint(4) NOT NULL DEFAULT '0',
   ProcessUnmatchedEmails tinyint(4) NOT NULL DEFAULT '0',
   ReplyFromName varchar(255) NOT NULL DEFAULT '',
   ReplyFromEmail varchar(255) NOT NULL DEFAULT '',
   ReplyCc varchar(255) NOT NULL DEFAULT '',
   ReplyBcc varchar(255) NOT NULL DEFAULT '',
   ReplyMessageSignature text,
   ReplyServer varchar(255) NOT NULL DEFAULT '',
   ReplyPort int(11) NOT NULL DEFAULT '110',
   ReplyUsername varchar(255) NOT NULL DEFAULT '',
   ReplyPassword varchar(255) NOT NULL DEFAULT '',
   BounceEmail varchar(255) NOT NULL DEFAULT '',
   BounceServer varchar(255) NOT NULL DEFAULT '',
   BouncePort int(11) NOT NULL DEFAULT '110',
   BounceUsername varchar(255) NOT NULL DEFAULT '',
   BouncePassword varchar(255) NOT NULL DEFAULT '',
   PRIMARY KEY (FormId),
   KEY UseSecurityImage (UseSecurityImage),
   KEY RequireLogin (RequireLogin),
   KEY EnableEmailCommunication (EnableEmailCommunication),
   KEY ProcessUnmatchedEmails (ProcessUnmatchedEmails)
 );
 
 CREATE TABLE Semaphores (
   SemaphoreId int(11) NOT NULL AUTO_INCREMENT,
   SessionKey int(10) unsigned NOT NULL DEFAULT '0',
   `Timestamp` int(10) unsigned NOT NULL DEFAULT '0',
   MainPrefix varchar(255) NOT NULL DEFAULT '',
   PRIMARY KEY (SemaphoreId),
   KEY SessionKey (SessionKey),
   KEY `Timestamp` (`Timestamp`),
   KEY MainPrefix (MainPrefix)
 );
 
 CREATE TABLE CachedUrls (
   UrlId int(11) NOT NULL AUTO_INCREMENT,
   Url varchar(255) NOT NULL DEFAULT '',
   DomainId int(11) NOT NULL DEFAULT '0',
   `Hash` int(11) NOT NULL DEFAULT '0',
   Prefixes varchar(255) NOT NULL DEFAULT '',
   ParsedVars text NOT NULL,
   Cached int(10) unsigned DEFAULT NULL,
   LifeTime int(11) NOT NULL DEFAULT '-1',
   PRIMARY KEY (UrlId),
   KEY Url (Url),
   KEY `Hash` (`Hash`),
   KEY Prefixes (Prefixes),
   KEY Cached (Cached),
   KEY LifeTime (LifeTime),
   KEY DomainId (DomainId)
 );
 
 CREATE TABLE SiteDomains (
   DomainId int(11) NOT NULL AUTO_INCREMENT,
   DomainName varchar(255) NOT NULL DEFAULT '',
   DomainNameUsesRegExp tinyint(4) NOT NULL DEFAULT '0',
   SSLUrl varchar(255) NOT NULL DEFAULT '',
   SSLUrlUsesRegExp tinyint(4) NOT NULL DEFAULT '0',
   AdminEmail varchar(255) NOT NULL DEFAULT '',
   Country varchar(3) NOT NULL DEFAULT '',
   PrimaryLanguageId int(11) NOT NULL DEFAULT '0',
   Languages varchar(255) NOT NULL DEFAULT '',
   PrimaryThemeId int(11) NOT NULL DEFAULT '0',
   Themes varchar(255) NOT NULL DEFAULT '',
   DomainIPRange text,
   ExternalUrl varchar(255) NOT NULL DEFAULT '',
   RedirectOnIPMatch tinyint(4) NOT NULL DEFAULT '0',
   Priority int(11) NOT NULL DEFAULT '0',
   PRIMARY KEY (DomainId),
   KEY DomainName (DomainName),
   KEY DomainNameUsesRegExp (DomainNameUsesRegExp),
   KEY SSLUrl (SSLUrl),
   KEY SSLUrlUsesRegExp (SSLUrlUsesRegExp),
   KEY AdminEmail (AdminEmail),
   KEY Country (Country),
   KEY PrimaryLanguageId (PrimaryLanguageId),
   KEY Languages (Languages),
   KEY PrimaryThemeId (PrimaryThemeId),
   KEY Themes (Themes),
   KEY ExternalUrl (ExternalUrl),
   KEY RedirectOnIPMatch (RedirectOnIPMatch),
   KEY Priority (Priority)
 );
 
 CREATE TABLE CurlLog (
   LogId int(11) NOT NULL AUTO_INCREMENT,
   Message varchar(255) NOT NULL,
   PageUrl varchar(255) NOT NULL,
   RequestUrl varchar(255) NOT NULL,
   PortalUserId int(11) NOT NULL,
   SessionKey int(11) NOT NULL,
   IsAdmin tinyint(4) NOT NULL,
   PageData text,
   RequestData text,
   ResponseData text,
   RequestDate int(11) DEFAULT NULL,
   ResponseDate int(11) DEFAULT NULL,
   ResponseHttpCode int(11) NOT NULL,
   CurlError varchar(255) NOT NULL,
   PRIMARY KEY (LogId),
   KEY Message (Message),
   KEY PageUrl (PageUrl),
   KEY RequestUrl (RequestUrl),
   KEY PortalUserId (PortalUserId),
   KEY SessionKey (SessionKey),
   KEY IsAdmin (IsAdmin),
   KEY RequestDate (RequestDate),
   KEY ResponseDate (ResponseDate),
   KEY ResponseHttpCode (ResponseHttpCode),
   KEY CurlError (CurlError)
 );
 
 CREATE TABLE PromoBlocks (
   BlockId int(11) NOT NULL AUTO_INCREMENT,
   Title varchar(50) NOT NULL DEFAULT '',
   Priority int(11) NOT NULL DEFAULT '0',
   Status tinyint(1) NOT NULL DEFAULT '0',
   l1_Image varchar(255) NOT NULL DEFAULT '',
   l2_Image varchar(255) NOT NULL DEFAULT '',
   l3_Image varchar(255) NOT NULL DEFAULT '',
   l4_Image varchar(255) NOT NULL DEFAULT '',
   l5_Image varchar(255) NOT NULL DEFAULT '',
   CSSClassName varchar(255) NOT NULL DEFAULT '',
   LinkType tinyint(1) NOT NULL DEFAULT '1',
   CategoryId int(11) NOT NULL DEFAULT '0',
   ExternalLink varchar(255) NOT NULL DEFAULT '',
   OpenInNewWindow tinyint(3) unsigned NOT NULL DEFAULT '0',
   ScheduleFromDate int(11) DEFAULT NULL,
   ScheduleToDate int(11) DEFAULT NULL,
   NumberOfClicks int(11) NOT NULL DEFAULT '0',
   NumberOfViews int(11) NOT NULL DEFAULT '0',
   Sticky tinyint(1) NOT NULL DEFAULT '0',
   Html text,
   l1_Html text,
   l2_Html text,
   l3_Html text,
   l4_Html text,
   l5_Html text,
   PRIMARY KEY (BlockId),
   KEY OpenInNewWindow (OpenInNewWindow)
 );
\ No newline at end of file
Index: branches/5.2.x/core/install/steps_db.xml
===================================================================
--- branches/5.2.x/core/install/steps_db.xml	(revision 14881)
+++ branches/5.2.x/core/install/steps_db.xml	(revision 14882)
@@ -1,213 +1,213 @@
 <steps>
 	<step name="clean_db" title="Clean Database">
 		<![CDATA[missing step description]]>
 	</step>
 	<step name="db_config" title="Database Configuration">
 		<![CDATA[<p><b><i>Database Hostname</i></b> - IP or hostname of your database server (normally <i>"localhost"</i>).</p>
 
 		<p><b><i>Database Name</i></b> - name of the database where In-Portal will be installed.</p>
 		<p><b><i>Database User Name</i></b> - name of the user for selected database.</p>
 		<p><b><i>Database User Password</i></b> - password for selected username.</p>
 		<p><b><i>Database Collation</i></b> - character set used to store data in text fields (normally <i>"utf8_general_ci"</i>).</p>
 		<p><b><i>Prefix for Table Names</i></b> - specified when multiple scripts will be run in the same database.
 		Prefix can be any text string allowed in table naming by your database engine (normally <i>"inp_"</i>).</p>
 		<p><b><i>Use existing In-Portal installation setup in this Database</i></b> - select <i>"Yes"</i>
 		if you already have In-Portal installed in this database and want to use it. Select <i>"No"</i> in all other cases.</p>
 		]]>
 	</step>
 	<step name="select_license" title="Select License" help_title="License Configuration">
 		<![CDATA[<p><b>In-Portal is an Open Source</b> object-oriented framework that is developed in PHP
 		 and provides a quick and easy way to build websites and web applications.</p>
 
 		 <p>In-Portal is copyrighted and distributed under <a href="http://www.in-portal.org/license" target="_blank">GPLv2 license</a>.</p>
 
 		 <p><b><i>GPL / Open Source License</i></b> - by downloading and installing In-Portal
 		  under GPLv2 license you understand and agree to all terms of the
 		  <a href="http://www.in-portal.org/license" target="_blank">GPLv2 license</a>.</p>
 
 		 <p><b><i>Upload License File</i></b> - if you have obtained Commercial
 		 <a href="http://www.in-portal.com/features-modules.html" target="_blank">Modules</a>
 		  or <a href="http://www.in-portal.com/support-downloads/customer-support.html" target="_blank">Support</a>
 		  from Intechnic you will be provided with a license file, upload it here.</p>
 		<!--
 		 <p><b><i>Download from Intechnic Servers</i></b> - .</p>
 		-->
 		 <p><b><i>Use Existing License</i></b> - if a valid license has been detected on your server,
 		 you can choose this option and continue the installation process.</p>]]>
 	</step>
 	<step name="download_license" title="Download License" help_title="Download License from Intechnic">
 		<![CDATA[<p><b>In-Portal is an Open Source</b> object-oriented framework that is developed in PHP
 		 and provides a quick and easy way to build websites and web applications.</p>
 
 		 <p>In-Portal is copyrighted and distributed under <a href="http://www.in-portal.org/license" target="_blank">GPLv2 license</a>.</p>
 
 		 <p><b><i>GPL / Open Source License</i></b> - by downloading and installing In-Portal
 		  under GPLv2 license you understand and agree to all terms of
 		  <a href="http://www.in-portal.org/license" target="_blank">GPLv2 license</a>.</p>
 
 		 <p><b><i>Download from Intechnic Servers</i></b> - if you have obtained Commercial
 		 <a href="http://www.in-portal.com/features-modules.html" target="_blank">Modules</a>
 		  or <a href="http://www.in-portal.com/support-downloads/customer-support.html" target="_blank">Support</a>
 		  from Intechnic you will be provided with a license, specify your Username and Password in order to download the license.</p>]]>
 	</step>
 	<step name="select_domain" title="Select Domain" help_title="Select Licensed Domain">
 		<![CDATA[<p>Select the domain you wish to install In-Portal on.</p>
 
 		<p>The <i>Other</i> option can be used to install In-Portal other custom domains. Note that your web server should match entered domain name.</p>]]>
 	</step>
 	<step name="root_password" title="Set Root Password" help_title="Set Admin Root Password">
 		<![CDATA[<p>The <b>Root Password</b> is initially required to access the Admin Console of In-Portal.
 		The root user can <b>NOT</b> be used to access the Front-end of your In-Portal website.</p>
 
 		<p>Once installation is completed it's highly recommented to create additional users with admin privlidges.</p>]]>
 	</step>
 	<step name="choose_modules" title="Modules to Install">
 		<![CDATA[<p>Current step lists all <b>In-Portal Modules</b> that were found on your server and can be installed now.</p>
 
 		<p>Additional <a href="http://www.in-portal.com/features-modules.html" target="_blank">In-Portal Modules</a> can be found and downloaded <a href="http://www.in-portal.com/features-modules.html" target="_blank">here</a>.</p>
 
 		<p>While <a href="http://www.in-portal.com/features-modules.html" target="_blank">In-Portal Community</a> constantly works on improving In-Portal by creating new functionality and releasing new modules we are always looking for new ideas and Your help so we can make In-Portal even better software!</p>]]>
 	</step>
 	<step name="check_paths" title="Filesystem Check">
 		<![CDATA[<p><b>In-Portal Installer checks through the system folders and files</b> that require write permissions (777) to be set in order to run successfully In-Portal on your website.</p>
 
 		<p>In case if you see a <strong>Failure notice</strong> saying that In-Portal Installation cannot continue until all permissions are set correctly please continue reading below.</p>
 
 		<p><strong>Permissions can be set</strong> by using <a href="http://www.google.com/search?q=free+ftp+program" target="_blank">FTP program</a> or directly in <i>shell</i> running "chmod" command. Please refer to the following <a href="http://www.stadtaus.com/en/tutorials/chmod-ftp-file-permissions.php" target="_blank">guide</a> to learn how to set permissions using your FTP program. In case if you have access to <i>shell</i> in your account you can simply run fix_perms.sh files located in /tools folder or do <br/><br/>
 		&nbsp;&nbsp;&nbsp;# chmod -R 777 ../system ../themes ../system/config.php</p>
 
 		<p><strong>Security reasons</strong> you will be asked to change permissions back to 755 on /system/config.php file and root / folder of In-Portal on the last step of this installation process!</p>
 		]]>
 	</step>
 	<step name="post_config" title="Basic Configuration">
 		<![CDATA[<p>Adjust <b>Basic Configuration</b> settings on this step.</p>
 
 		<p>Once your In-Portal is installed you can login into <b>Admin Console</b> to change these and other settings. The Configuration section is located in main navigation menu.</p>
 		<br/>
 		<p><b>Additional Recommendations:</b></p>
 
 		<p><b><i>1. Use Cron</i></b> (<a href="http://en.wikipedia.org/wiki/Cron" target="_blank">UNIX/BSD/Linux</a>) or <b>Task Scheduler</b> (<a href="http://en.wikipedia.org/wiki/Task_Scheduler" target="_blank">Windows</a>) to run Regular Events in your In-Portal.<br />
-				It's highly recommended to setup your cron to run <b>every minute</b> so all system events that are enabled will run in the background based on their schedule. These events can be managed in Admin Console via <b><i>Configuration -> Website -> Agents</i></b> section.
+				It's highly recommended to setup your cron to run <b>every minute</b> so all system events that are enabled will run in the background based on their schedule. These events can be managed in Admin Console via <b><i>Configuration -> Website -> Scheduled Tasks</i></b> section.
 				<p>In-Portal <b>cron</b> file is located in <b>/tools/cron.php</b> folder and can be setup using hosting Control Panel or <a href="http://en.wikipedia.org/wiki/Cron" target="_blank">manually</a>. In Plesk or CPanel interfaces use dialog to add a new cron job and specify the following (use correct paths)<br />
 				&nbsp;&nbsp;&nbsp;<b>/absolute/path/to/bin/php -f /absolute/path/to/in-portal/tools/cron.php</b></p>
 
-				<p><b><i>2. Adjust Agents</i></b><br />
-				As was explained in the previous recommendation there is a <b><i>Configuration -> Website -> Agents</i></b> section where you can control Events triggered by the system. These events do their job to cleanup the data, old image files, check the data integrity, RSS feeds and other processes required for your In-Portal to run efficiently. We do recommend to review and enable/disable these events based on your website needs.</p>
+				<p><b><i>2. Adjust Scheduled Tasks</i></b><br />
+				As was explained in the previous recommendation there is a <b><i>Configuration -> Website -> Scheduled Tasks</i></b> section where you can control Events triggered by the system. These events do their job to cleanup the data, old image files, check the data integrity, RSS feeds and other processes required for your In-Portal to run efficiently. We do recommend to review and enable/disable these events based on your website needs.</p>
 				<p><b><i>3. Set Mail Server</i></b><br />
 				 It's recommended to review and adjust your mail server settings once your In-Portal is up and running. This can be done in Admin Console under <b><i>Configuration -> Website -> Advanced</i></b> section.</p>
 
 				 <p><b>We strongly recommend carefully reviewing and adjusting all settings under Configuration -> Website section!</b></p>
 
 		]]>
 	</step>
 	<step name="sys_config" title="System Configuration">
 		<![CDATA[<p>These are system advanced settings and must be changed with caution. It's <strong><i>not recommended</i></strong> to
 		change these settings unless you exactly know what you are doing. These settings will be stored in <strong>system/config.php</strong>
 		file and can be changed manually if needed.</p>
 		<br/>
 
 		<p><b><i>Web Path to Installation</i></b> - web path to the root of your In-Portal installation. For example,
 		if your In-Portal will be running at http://www.your-website.com, then Web Path to Installation should be set to <b>/</b>
 		since In-Portal is setup in the root of the domain. In case if your In-Portal will be running under
 		 http://www.your-website.com/in-portal/, then it should be set to <b>/in-portal</b> (no trailing slash). This setting is auto-detected during the
 		 initial installation step, but can be adjusted at Installation Maintenance step.</p>
 
 		<p><b><i>Path to Writable folder</i></b> - path to a folder inside your In-Portal installation which can be accessed from the Web
 		 and has writable permissions for the web server. This folder will be used to store dynamic content such as
 		  uploaded and resized images, cached templates and other types of user files. The default value is <b>/system</b>.</p>
 
 		<p><b><i>Path to Restricted folder</i></b> - path to a folder inside or outside your In-Portal installation which will
 		used to store debug files, system logs and other non-public information. This folder must be writable by the web-server
 		 and can be located outside of your In-Portal installation if needed. The default value is <b>/system/.restricted</b> .</p>
 
 		<p><b><i>Path to Admin folder</i></b> - web path to your In-Portal Admin Console folder. The default value is set to
 		 <b>/admin</b> and your Admin Console will be accessible at http://www.your-website.com/admin.
 		 In case if you want your Admin Console to be under http://www.your-website.com/secure-admin (or anything else)
 		 you'll need to rename original <b>admin</b> folder to <b>secure-admin</b> on your filesystem and then set this path to <b>/secure-admin</b> .</p>
 
 		<p><b><i>Path to Admin Interface Presets folder</i></b> - path to a folder inside your In-Portal installation
 		contains Admin Interface Presets. The default value is <b>/admin</b> .</p>
 
 		<p><b><i>Name of Base Application Class</i></b> - default value is <b>kApplication</b> and can change very rarely. </p>
 
 		<p><b><i>Path to Base Application Class file</i></b> - default value is <b>/core/kernel/application.php</b> and can change very rarely.</p>
 
 		<p><b><i>Output Caching Engine</i></b> - provides ability to cache HTML output or other data using various caching engines to
 		 lower the database load. The default value is set to <b>None</b> if no available engines detected. Available options are:
 		  None (Fake), Memcached (Memcache), XCache (XCache) and Alternative PHP Cache (Apc).
 		  Note that only auto-detected caching engines will be available for selection.</p>
 
 		<p><b><i>Location of Memcache Servers</i></b> - host or IP address with port where Memcached Server is running.
 		 Multiple locations of can be listed separated by semi-colon (;). For example, 192.168.1.1:1121;192.168.1.2:1121;192.168.1.3:1121 .</p>
 
 		<p><b><i>CSS/JS Compression Engine</i></b> - provides <a href="http://en.wikipedia.org/wiki/Minification_(programming)">minification</a>
 		 functionality for CSS / Javascript files. The default value is set to <b>PHP-based</b> if no Java is auto-detected on server-side.
 		 Available options are: None (empty), YUICompressor (Java) (yui) and PHP-based (php) .</p>
 
 		<br/>
 		]]>
 	</step>
 	<step name="select_theme" title="Select Default Theme">
 		<![CDATA[<p>Selected theme will be used as a default in your In-Portal website.</p>
 		<p>You can manage your themes in Admin Console under Configuration -> Website -> Themes section.</p>
 
 		<p>Additional themes are available on <a href="http://www.in-portal.com/support-downloads.html" target="_blank">Support & Downloads</a> section on <a href="http://www.in-portal.com" target="_blank">In-Portal.com</a> website</p>]]>
 	</step>
 	<step name="security" title="Security Check">
 		<![CDATA[<p><strong>In-Portal Installer</strong> performs final security checks on this step.</p>
 
 		<p><b>1. Write Permissions Check</b> - checks whether critical In-Portal files are open for the outside world and can be used by hackers to attack your websites. <b>You won't be able to continue until you correctly set these permissions!</b></p>
 
 		<p><b>2. Ability to Execute PHP in Writable Folders</b> - checks if hackers can save and execute PHP files in your /system
 		folder used for the uploads.While it's recommended to adjust these settings you can continue In-Portal Installation without changing them.</p>
 		<p><b>3. Webserver PHP Configuration</b> - additional suggestions how to make your website even more secure. While it's recommended to adjust these settings you can continue In-Portal Installation without changing them.</p>
 
 		]]>
 	</step>
 	<step name="finish" title="Installation Complete" help_title="Thank You!">
 		<![CDATA[<p>Thank you for downloading and installing In-Portal Content Management System!</p>
 
 		<p>Feel free to visit <a target="_new" href="http://www.in-portal.com">www.in-portal.com</a> for support, latest news and module updates.</p>
     	<p><strong>Please make sure to clean your Browser's Cache if you were performing the upgrade.</strong></p>]]>
     </step>
     <step name="install_setup" title="Installation Maintenance">
     	<![CDATA[<p>A Configuration file has been detected on your system and it appears In-Portal is correctly installed.
 		In order to work with the maintenance functions provided to the left you must enter your admin Root password.
 		<b><i>(Use Username 'root' if using your root password)</i></b></p>
 
 		<p><b><i>Upgrade In-Portal</i></b> - available when you upload files from new In-Portal release into
 		your current installation. Upgrade scripts will run and upgrade your current In-Portal database to the uploaded version.</p>
 
 		<p><b><i>Reinstall In-Portal</i></b> - cleans out your existing In-Portal database and starts with a fresh installation.
 		<i>Note</i> that this operation cannot be undone and no backups are made! Use at your own risk.</p>
 
 		<p><b><i>Install In-Portal to a New Database</i></b> - keeps the existing installation and installs In-Portal to a new database.
 		If this option is selected you will be prompted for new database configuration information.</p>
 
 		<p><b><i>Update License Information</i></b> - used to update your In-Portal license data. Select this option if you have
 		modified your licensing status with Intechnic (obtained commercial support or module), or you have received new license data via email.</p>
 		<p><b><i>Update Database Configuration</i></b> - allows you to update your current database configuration variables such as
 		database server host, username, password and others.</p>
 
 		<p><b><i>Update Installation Paths</i></b> - should be used when the location of your In-Portal files has changed.
 		For example, if you moved them from one folder to another. It will update all settings and ensure In-Portal
 		is operational at the new location.</p>]]>
     </step>
     <step name="upgrade_modules" title="Select Modules to Upgrade">
     	<![CDATA[<p>Select modules from the list, you need to update to the last downloaded version of In-Portal</p>]]>
     </step>
     <step name="skin_upgrade" title="Admin Skin Upgrade">
     	<![CDATA[<p>Review Administrative Console skin upgrade log.</p>]]>
     </step>
     <step name="db_reconfig" title="Update Database Configuration">
 		<![CDATA[<p>In-Portal needs to connect to your Database Server. Please provide the database server type*,
 		host name (<i>normally "localhost"</i>), Database user name, and database Password. These fields are required
 		to connect to the database.</p><p>If you would like In-Portal to use a table prefix, enter it in the field
 		provided. This prefix can be any text which can be used in the names of tables on your system.
 		The characters entered in this field are placed <i>before</i> the names of the tables used by In-Portal.
 		For example, if you enter "inp_" into the prefix field, the table named Category will be named inp_Category.</p>]]>
 	</step>
     <step name="sys_requirements" title="System Requirements Check">
     	<![CDATA[The <i>System Requirements Check</i> option should be used to ensure proper system behavior in the current environment.]]>
     </step>
 </steps>
\ No newline at end of file
Index: branches/5.2.x/core/install/remove_schema.sql
===================================================================
--- branches/5.2.x/core/install/remove_schema.sql	(revision 14881)
+++ branches/5.2.x/core/install/remove_schema.sql	(revision 14882)
@@ -1,74 +1,74 @@
 DROP TABLE PermissionConfig;
 DROP TABLE Permissions;
 DROP TABLE CustomField;
 DROP TABLE ConfigurationValues;
 DROP TABLE EmailQueue;
 DROP TABLE Events;
 DROP TABLE IdGenerator;
 DROP TABLE Language;
 DROP TABLE Modules;
 DROP TABLE PersistantSessionData;
 DROP TABLE Phrase;
 DROP TABLE PhraseCache;
 DROP TABLE PortalGroup;
 DROP TABLE PortalUser;
 DROP TABLE PortalUserCustomData;
 DROP TABLE SessionData;
 DROP TABLE Theme;
 DROP TABLE ThemeFiles;
 DROP TABLE UserGroup;
 DROP TABLE UserSession;
 DROP TABLE EmailLog;
 DROP TABLE Cache;
 DROP TABLE CountryStates;
 DROP TABLE Category;
 DROP TABLE CategoryCustomData;
 DROP TABLE CategoryItems;
 DROP TABLE PermCache;
 DROP TABLE Stylesheets;
 DROP TABLE PopupSizes;
 DROP TABLE Counters;
 DROP TABLE Skins;
 DROP TABLE ChangeLogs;
 DROP TABLE SessionLogs;
 DROP TABLE StatisticsCapture;
 DROP TABLE SlowSqlCapture;
-DROP TABLE Agents;
+DROP TABLE ScheduledTasks;
 DROP TABLE SpellingDictionary;
 DROP TABLE Thesaurus;
 DROP TABLE LocalesList;
 DROP TABLE BanRules;
 DROP TABLE CountCache;
 DROP TABLE Favorites;
 DROP TABLE Images;
 DROP TABLE ItemRating;
 DROP TABLE ItemReview;
 DROP TABLE SpamReports;
 DROP TABLE ItemTypes;
 DROP TABLE ItemFiles;
 DROP TABLE Relationship;
 DROP TABLE SearchConfig;
 DROP TABLE SearchLog;
 DROP TABLE SpamControl;
 DROP TABLE StatItem;
 DROP TABLE SysCache;
 DROP TABLE TagLibrary;
 DROP TABLE TagAttributes;
 DROP TABLE ImportScripts;
 DROP TABLE StylesheetSelectors;
 DROP TABLE Visits;
 DROP TABLE ImportCache;
 DROP TABLE RelatedSearches;
 DROP TABLE StopWords;
 DROP TABLE MailingLists;
 DROP TABLE PageContent;
 DROP TABLE PageRevisions;
 DROP TABLE FormFields;
 DROP TABLE FormSubmissions;
 DROP TABLE SubmissionLog;
 DROP TABLE Drafts;
 DROP TABLE Forms;
 DROP TABLE Semaphores;
 DROP TABLE CachedUrls;
 DROP TABLE SiteDomains;
 DROP TABLE CurlLog;