[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/installation/sql/ -> upgrade4014to45.sql (source)

   1  # $Id: upgrade4014to45.sql,v 1.1 2006/08/24 Chanh Ong Exp $
   2  # Fix to run in mysql 5 and remove duplicate - Chanh Ong
   3  # First rename all existing tables
   4  
   5  ALTER TABLE `mos_categories` RENAME `old_categories`;
   6  #ALTER TABLE `mos_articles` RENAME `old_articles`;
   7  ALTER TABLE `mos_stories` RENAME `old_stories`;
   8  ALTER TABLE `mos_banner` RENAME `old_banner`;
   9  ALTER TABLE `mos_bannerclient` RENAME `old_bannerclient`;
  10  ALTER TABLE `mos_bannerfinish` RENAME `old_bannerfinish`;
  11  ALTER TABLE `mos_component_module` RENAME `old_component_module`;
  12  ALTER TABLE `mos_components` RENAME `old_components`;
  13  ALTER TABLE `mos_contact_details` RENAME `old_contact_details`;
  14  ALTER TABLE `mos_counter` RENAME `old_counter`;
  15  ALTER TABLE `mos_faqcont` RENAME `old_faqcont`;
  16  ALTER TABLE `mos_groups` RENAME `old_groups`;
  17  ALTER TABLE `mos_links` RENAME `old_links`;
  18  ALTER TABLE `mos_mambo_modules` RENAME `old_mambo_modules`;
  19  ALTER TABLE `mos_menu` RENAME `old_menu`;
  20  ALTER TABLE `mos_menucontent` RENAME `old_menucontent`;
  21  ALTER TABLE `mos_newsfeedscategory` RENAME `old_newsfeedcategory`;
  22  ALTER TABLE `mos_newsfeedslinks` RENAME `old_newsfeedlinks`;
  23  ALTER TABLE `mos_newsflash` RENAME `old_newsflash`;
  24  ALTER TABLE `mos_poll_data` RENAME `old_poll_data`;
  25  ALTER TABLE `mos_poll_date` RENAME `old_poll_date`;
  26  ALTER TABLE `mos_poll_desc` RENAME `old_poll_desc`;
  27  ALTER TABLE `mos_poll_menu` RENAME `old_poll_menu`;
  28  ALTER TABLE `mos_queue` RENAME `old_queue`;
  29  ALTER TABLE `mos_session` RENAME `old_session`;
  30  ALTER TABLE `mos_system` RENAME `old_system`;
  31  ALTER TABLE `mos_users` RENAME `old_users`;
  32  
  33  # Then create MOS 4.5 database
  34  
  35  #
  36  # Table structure for table `mos_banner`
  37  #
  38  
  39  CREATE TABLE `mos_banner` (
  40    `bid` int(11) NOT NULL auto_increment,
  41    `cid` int(11) NOT NULL default 0,
  42    `type` varchar(10) NOT NULL default 'banner',
  43    `name` varchar(50) NOT NULL default '',
  44    `imptotal` int(11) NOT NULL default 0,
  45    `impmade` int(11) NOT NULL default 0,
  46    `clicks` int(11) NOT NULL default 0,
  47    `imageurl` varchar(100) NOT NULL default '',
  48    `clickurl` varchar(200) NOT NULL default '',
  49    `date` datetime default NULL,
  50    `showBanner` tinyint(1) NOT NULL default 0,
  51    `checked_out` tinyint(1) NOT NULL default 0,
  52    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
  53    `editor` varchar(50) default NULL,
  54    `custombannercode` text,
  55    PRIMARY KEY  (`bid`),
  56    KEY `viewbanner` (`showBanner`)
  57  ) TYPE=MyISAM AUTO_INCREMENT=1 ;
  58  
  59  #
  60  # Dumping data for table `mos_banner`
  61  #
  62  
  63  # --------------------------------------------------------
  64  
  65  #
  66  # Table structure for table `mos_bannerclient`
  67  #
  68  
  69  CREATE TABLE `mos_bannerclient` (
  70    `cid` int(11) NOT NULL auto_increment,
  71    `name` varchar(60) NOT NULL default '',
  72    `contact` varchar(60) NOT NULL default '',
  73    `email` varchar(60) NOT NULL default '',
  74    `extrainfo` text NOT NULL,
  75    `checked_out` tinyint(1) NOT NULL default 0,
  76    `checked_out_time` time default NULL,
  77    `editor` varchar(50) default NULL,
  78    PRIMARY KEY  (`cid`)
  79  ) TYPE=MyISAM;
  80  
  81  #
  82  # Dumping data for table `mos_bannerclient`
  83  #
  84  
  85  # --------------------------------------------------------
  86  
  87  #
  88  # Table structure for table `mos_bannerfinish`
  89  #
  90  
  91  CREATE TABLE `mos_bannerfinish` (
  92    `bid` int(11) NOT NULL auto_increment,
  93    `cid` int(11) NOT NULL default 0,
  94    `type` varchar(10) NOT NULL default '',
  95    `name` varchar(50) NOT NULL default '',
  96    `impressions` int(11) NOT NULL default 0,
  97    `clicks` int(11) NOT NULL default 0,
  98    `imageurl` varchar(50) NOT NULL default '',
  99    `datestart` datetime default NULL,
 100    `dateend` datetime default NULL,
 101    PRIMARY KEY  (`bid`)
 102  ) TYPE=MyISAM;
 103  
 104  #
 105  # Dumping data for table `mos_bannerfinish`
 106  #
 107  
 108  # --------------------------------------------------------
 109  
 110  #
 111  # Table structure for table `mos_categories`
 112  #
 113  
 114  CREATE TABLE `mos_categories` (
 115    `id` int(11) NOT NULL auto_increment,
 116    `title` varchar(50) NOT NULL default '',
 117    `name` varchar(255) NOT NULL default '',
 118    `image` varchar(100) NOT NULL default '',
 119    `section` varchar(20) NOT NULL default '',
 120    `image_position` varchar(10) NOT NULL default '',
 121    `description` text NOT NULL,
 122    `published` tinyint(1) NOT NULL default 0,
 123    `checked_out` int(11) unsigned NOT NULL default 0,
 124    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 125    `editor` varchar(50) default NULL,
 126    `ordering` int(11) NOT NULL default 0,
 127    `access` tinyint(3) unsigned NOT NULL default 0,
 128    `count` int(11) NOT NULL default 0,
 129    PRIMARY KEY  (`id`),
 130    KEY `cat_idx` (`section`,`published`,`access`),
 131    KEY `idx_section` (`section`),
 132    KEY `idx_access` (`access`),
 133    KEY `idx_checkout` (`checked_out`)
 134  ) TYPE=MyISAM;
 135  
 136  #
 137  # Dumping data for table `mos_categories`
 138  #
 139  
 140  INSERT INTO `mos_categories` VALUES (1, 'Latest', 'Latest News', 'pastarchives.jpg', '1', 'left', 'The latest news from the Mambo Team', 1, 0, '0000-00-00 00:00:00', '', 0, 0, 1);
 141  INSERT INTO `mos_categories` VALUES (2, 'MOS', 'Mambo', 'asterisk.png', 'com_weblinks', 'left', 'A selection of links that are all related to the Mambo project.', 1, 0, '0000-00-00 00:00:00', NULL, 0, 0, 0);
 142  INSERT INTO `mos_categories` VALUES (3, 'Administrator', 'Administrator', '', 'help', 'left', 'MOS Administrator Help', 1, 0, '0000-00-00 00:00:00', NULL, 1, 0, 0);
 143  INSERT INTO `mos_categories` VALUES (4, 'Templates', 'Templates', '', 'help', 'left', 'MOS Templates Help and Tutorials', 1, 0, '0000-00-00 00:00:00', NULL, 3, 0, 0);
 144  INSERT INTO `mos_categories` VALUES (5, 'Developers', 'Developers', '', 'help', 'left', 'MOS Developers\' API', 1, 0, '0000-00-00 00:00:00', NULL, 4, 0, 0);
 145  INSERT INTO `mos_categories` VALUES (6, 'Components', 'Components', '', 'help', 'left', 'Components Help', 1, 0, '0000-00-00 00:00:00', NULL, 2, 0, 0);
 146  # --------------------------------------------------------
 147  
 148  #
 149  # Table structure for table `mos_components`
 150  #
 151  
 152  CREATE TABLE `mos_components` (
 153    `id` int(11) NOT NULL auto_increment,
 154    `name` varchar(50) NOT NULL default '',
 155    `link` varchar(255) NOT NULL default '',
 156    `menuid` int(11) unsigned NOT NULL default 0,
 157    `parent` int(11) unsigned NOT NULL default 0,
 158    `admin_menu_link` varchar(255) NOT NULL default '',
 159    `admin_menu_alt` varchar(255) NOT NULL default '',
 160    `option` varchar(50) NOT NULL default '',
 161    `ordering` int(11) unsigned NOT NULL default 0,
 162    `admin_menu_img` varchar(255) NOT NULL default '',
 163    `iscore` tinyint(4) NOT NULL default 0,
 164    PRIMARY KEY  (`id`)
 165  ) TYPE=MyISAM;
 166  
 167  #
 168  # Dumping data for table `mos_components`
 169  #
 170  
 171  INSERT INTO `mos_components` VALUES (1, 'Banners', '', 0, 0, '', 'Banner Management', 'com_banners', 0, 'js/ThemeOffice/component.png', 1);
 172  INSERT INTO `mos_components` VALUES (2, 'Manage Banners', '', 0, 1, 'option=com_banners', 'Active Banners', 'com_banners', 1, 'js/ThemeOffice/edit.png', 1);
 173  INSERT INTO `mos_components` VALUES (3, 'Manage Clients', '', 0, 1, 'option=com_banners&task=listclients', 'Manage Clients', 'com_banners', 2, 'js/ThemeOffice/categories.png', 1);
 174  INSERT INTO `mos_components` VALUES (4, 'Web Links', 'option=com_weblinks', 0, 0, '', 'Manage Weblinks', 'com_weblinks', 0, 'js/ThemeOffice/component.png', 1);
 175  INSERT INTO `mos_components` VALUES (5, 'Newsflash', '', 0, 0, 'option=com_newsflash', 'Manage newsflashes', 'com_newsflash', 0, 'js/ThemeOffice/component.png', 1);
 176  INSERT INTO `mos_components` VALUES (6, 'Contact', 'option=com_contact', 0, 0, 'option=com_contact', 'Edit contact details', 'com_contact', 0, 'js/ThemeOffice/component.png', 1);
 177  INSERT INTO `mos_components` VALUES (7, 'Weblink Items', '', 0, 4, 'option=com_weblinks', 'View existing weblinks', 'com_weblinks', 1, 'js/ThemeOffice/edit.png', 1);
 178  INSERT INTO `mos_components` VALUES (8, 'Weblink Categories', '', 0, 4, 'option=com_categories&section=com_weblinks', 'Manage weblink categories', '', 2, 'js/ThemeOffice/categories.png', 1);
 179  INSERT INTO `mos_components` VALUES (9, 'FrontPage', 'option=com_frontpage', 0, 0, '', 'Manage Front Page Items', 'com_frontpage', 0, 'js/ThemeOffice/component.png', 1);
 180  INSERT INTO `mos_components` VALUES (10, 'Manage Items', '', 0, 9, 'option=com_frontpage', 'Manage FrontPage Items', 'com_frontpage', 1, 'js/ThemeOffice/edit.png', 1);
 181  INSERT INTO `mos_components` VALUES (11, 'Settings', '', 0, 9, 'option=com_frontpage&act=settings', 'FrontPage Settings', 'com_frontpage', 2, 'js/ThemeOffice/config.png', 1);
 182  INSERT INTO `mos_components` VALUES (12, 'Polls', 'option=com_poll', 0, 0, 'option=com_poll', 'Manage Polls', 'com_poll', 0, 'js/ThemeOffice/component.png', 1);
 183  INSERT INTO `mos_components` VALUES (13, 'News Feeds', '', 0, 0, '', 'News Feeds Management', 'com_newsfeeds', 0, 'js/ThemeOffice/component.png', 1);
 184  INSERT INTO `mos_components` VALUES (14, 'Manage News Feeds', '', 0, 13, 'option=com_newsfeeds', 'Manage News Feeds', 'com_newsfeeds', 1, 'js/ThemeOffice/edit.png', 1);
 185  INSERT INTO `mos_components` VALUES (15, 'Manage Categories', '', 0, 13, 'option=com_categories&section=com_newsfeeds', 'Manage Categories', '', 2, 'js/ThemeOffice/categories.png', 1);
 186  INSERT INTO `mos_components` VALUES (16, 'Newsfeeds (Component)', 'option=com_newsfeeds', '', '', '','', '', '', '', '');
 187  INSERT INTO `mos_components` VALUES (17, 'Media Manager', '', 0, 0, 'option=com_media', 'Media Manager', 'com_media', 0, 'js/ThemeOffice/media.png', 1);
 188  INSERT INTO `mos_components` VALUES (18, 'Login', 'option=com_login', 0, 0, '', '', 'com_login', 0, '', 1);
 189  # --------------------------------------------------------
 190  
 191  #
 192  # Table structure for table `mos_contact_details`
 193  #
 194  
 195  CREATE TABLE `mos_contact_details` (
 196    `id` int(11) NOT NULL auto_increment,
 197    `name` varchar(100) NOT NULL default '',
 198    `con_position` varchar(50) default NULL,
 199    `address` text,
 200    `suburb` varchar(50) default NULL,
 201    `state` varchar(20) default NULL,
 202    `country` varchar(50) default NULL,
 203    `postcode` varchar(10) default NULL,
 204    `telephone` varchar(25) default NULL,
 205    `fax` varchar(25) default NULL,
 206    `misc` mediumtext,
 207    `image` varchar(100) default NULL,
 208    `imagepos` varchar(20) default NULL,
 209    `email_to` varchar(100) default NULL,
 210    `default_con` tinyint(1) unsigned NOT NULL default 0,
 211    `published` tinyint(1) unsigned NOT NULL default 0,
 212    `checked_out` int(11) unsigned NOT NULL default 0,
 213    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 214    `ordering` int(11) NOT NULL default 0,
 215    PRIMARY KEY  (`id`)
 216  ) TYPE=MyISAM;
 217  
 218  #
 219  # Dumping data for table `mos_contact_details`
 220  #
 221  
 222  # --------------------------------------------------------
 223  
 224  #
 225  # Table structure for table `mos_content`
 226  #
 227  
 228  CREATE TABLE `mos_content` (
 229    `id` int(11) unsigned NOT NULL auto_increment,
 230    `title` varchar(100) NOT NULL default '',
 231    `title_alias` varchar(100) NOT NULL default '',
 232    `introtext` mediumtext NOT NULL,
 233    `fulltext` mediumtext NOT NULL,
 234    `state` tinyint(3) NOT NULL default 0,
 235    `sectionid` int(11) unsigned NOT NULL default 0,
 236    `mask` int(11) unsigned NOT NULL default 0,
 237    `catid` int(11) unsigned NOT NULL default 0,
 238    `created` datetime NOT NULL default '0000-00-00 00:00:00',
 239    `created_by` int(11) unsigned NOT NULL default 0,
 240    `created_by_alias` varchar(100) NOT NULL default '',
 241    `modified` datetime NOT NULL default '0000-00-00 00:00:00',
 242    `modified_by` int(11) unsigned NOT NULL default 0,
 243    `checked_out` int(11) unsigned NOT NULL default 0,
 244    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 245    `publish_up` datetime NOT NULL default '0000-00-00 00:00:00',
 246    `publish_down` datetime NOT NULL default '0000-00-00 00:00:00',
 247    `images` text NOT NULL,
 248    `urls` text NOT NULL,
 249    `attribs` text NOT NULL,
 250    `version` int(11) unsigned NOT NULL default '1',
 251    `parentid` int(11) unsigned NOT NULL default 0,
 252    `ordering` float unsigned NOT NULL default 0,
 253    `metakey` text NOT NULL,
 254    `metadesc` text NOT NULL,
 255    `access` int(11) unsigned NOT NULL default 0,
 256    `hits` int(11) unsigned NOT NULL default 0,
 257    PRIMARY KEY  (`id`),
 258    KEY `idx_section` (`sectionid`),
 259    KEY `idx_access` (`access`),
 260    KEY `idx_checkout` (`checked_out`),
 261    KEY `idx_state` (`state`),
 262    KEY `idx_catid` (`catid`),
 263    KEY `idx_mask` (`mask`)
 264  ) TYPE=MyISAM;
 265  
 266  
 267  #
 268  # Table structure for table `mos_content_frontpage`
 269  #
 270  
 271  CREATE TABLE `mos_content_frontpage` (
 272    `content_id` int(11) NOT NULL default 0,
 273    `ordering` int(11) unsigned NOT NULL default 0,
 274    PRIMARY KEY  (`content_id`)
 275  ) TYPE=MyISAM;
 276  
 277  
 278  #
 279  # Table structure for table `mos_content_rating`
 280  #
 281  CREATE TABLE `mos_content_rating` (
 282    `content_id` int(11) NOT NULL default 0,
 283    `rating_sum` int(11) unsigned NOT NULL default 0,
 284    `rating_count` int(11) unsigned NOT NULL default 0,
 285    `lastip` varchar(50) NOT NULL default '',
 286    PRIMARY KEY  (`content_id`)
 287  ) TYPE=MyISAM;
 288  
 289  # --------------------------------------------------------
 290  
 291  # Table structure for table `mos_core_log_items`
 292  #
 293  # To be implemented in Version 4.6
 294  
 295  CREATE TABLE `mos_core_log_items` (
 296    `time_stamp` date NOT NULL default '0000-00-00',
 297    `item_table` varchar(50) NOT NULL default '',
 298    `item_id` int(11) unsigned NOT NULL default 0,
 299    `hits` int(11) unsigned NOT NULL default 0
 300  ) TYPE=MyISAM;
 301  
 302  # --------------------------------------------------------
 303  
 304  #
 305  # Table structure for table `mos_core_log_searches`
 306  #
 307  # To be implemented in Version 4.6
 308  
 309  CREATE TABLE `mos_core_log_searches` (
 310    `search_term` varchar(128) NOT NULL default '',
 311    `hits` int(11) unsigned NOT NULL default 0
 312  ) TYPE=MyISAM;
 313  
 314  # --------------------------------------------------------
 315  
 316  #
 317  # Table structure for table `mos_groups`
 318  #
 319  
 320  CREATE TABLE `mos_groups` (
 321    `id` tinyint(3) unsigned NOT NULL default 0,
 322    `name` varchar(50) NOT NULL default '',
 323    PRIMARY KEY  (`id`)
 324  ) TYPE=MyISAM;
 325  
 326  #
 327  # Dumping data for table `mos_groups`
 328  #
 329  
 330  INSERT INTO `mos_groups` VALUES (0, 'Public');
 331  INSERT INTO `mos_groups` VALUES (1, 'Registered');
 332  INSERT INTO `mos_groups` VALUES (2, 'Special');
 333  # --------------------------------------------------------
 334  
 335  #
 336  # Table structure for table `mos_help`
 337  #
 338  
 339  CREATE TABLE `mos_help` (
 340    `id` int(11) NOT NULL auto_increment,
 341    `lang` char(3) NOT NULL default 'eng',
 342    `context` varchar(40) NOT NULL default '',
 343    `name` varchar(40) NOT NULL default '',
 344    `title` varchar(100) NOT NULL default '',
 345    `parent` int(11) NOT NULL default 0,
 346    `ordering` int(11) NOT NULL default 0,
 347    `helptext` text NOT NULL,
 348    `catid` int(11) unsigned NOT NULL default 0,
 349    `checked_out` int(11) unsigned NOT NULL default 0,
 350    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 351    PRIMARY KEY  (`id`),
 352    UNIQUE KEY `id` (`id`),
 353    UNIQUE KEY `IdLangIdx` (`id`,`lang`),
 354    KEY `id_2` (`id`),
 355    FULLTEXT KEY `HeltextIdx` (`helptext`)
 356  ) TYPE=MyISAM;
 357  
 358  #
 359  # Dumping data for table `mos_help`
 360  #
 361  
 362  # --------------------------------------------------------
 363  
 364  #
 365  # Table structure for table `mos_menu`
 366  #
 367  
 368  CREATE TABLE `mos_menu` (
 369    `id` int(11) NOT NULL auto_increment,
 370    `menutype` varchar(25) default NULL,
 371    `name` varchar(100) default NULL,
 372    `link` text,
 373    `type` varchar(50) NOT NULL default '',
 374    `published` tinyint(1) NOT NULL default 0,
 375    `parent` int(11) unsigned NOT NULL default 0,
 376    `componentid` int(11) unsigned NOT NULL default 0,
 377    `sublevel` int(11) default 0,
 378    `ordering` int(11) default 0,
 379    `checked_out` int(11) unsigned NOT NULL default 0,
 380    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 381    `pollid` int(11) NOT NULL default 0,
 382    `browserNav` tinyint(4) default 0,
 383    `access` tinyint(3) unsigned NOT NULL default 0,
 384    `utaccess` tinyint(3) unsigned NOT NULL default 0,
 385    `params` text NOT NULL,
 386    PRIMARY KEY  (`id`),
 387    KEY `componentid` (`componentid`,`menutype`,`published`,`access`),
 388    KEY `menutype` (`menutype`)
 389  ) TYPE=MyISAM;
 390  
 391  
 392  #
 393  # Dumping data for table `mos_messages`
 394  #
 395  
 396  CREATE TABLE `mos_messages` (
 397    `message_id` int(10) unsigned NOT NULL auto_increment,
 398    `user_id_from` int(10) unsigned NOT NULL default 0,
 399    `user_id_to` int(10) unsigned NOT NULL default 0,
 400    `folder_id` int(10) unsigned NOT NULL default 0,
 401    `date_time` datetime NOT NULL default '0000-00-00 00:00:00',
 402    `state` int(11) NOT NULL default 0,
 403    `priority` int(1) unsigned NOT NULL default 0,
 404    `subject` varchar(230) NOT NULL default '',
 405    `message` text NOT NULL,
 406    PRIMARY KEY  (`message_id`)
 407  ) TYPE=MyISAM;
 408  # --------------------------------------------------------
 409  
 410  #
 411  # Dumping data for table `mos_messages_cfg`
 412  #
 413  
 414  CREATE TABLE `mos_messages_cfg` (
 415    `user_id` int(10) unsigned NOT NULL default 0,
 416    `cfg_name` varchar(100) NOT NULL default '',
 417    `cfg_value` varchar(255) NOT NULL default '',
 418    UNIQUE `idx_user_var_name` (`user_id`,`cfg_name`)
 419  ) TYPE=MyISAM;
 420  # --------------------------------------------------------
 421  
 422  #
 423  # Table structure for table `mos_modules`
 424  #
 425  
 426  CREATE TABLE `mos_modules` (
 427    `id` int(11) NOT NULL auto_increment,
 428    `title` text NOT NULL,
 429    `content` text NOT NULL,
 430    `ordering` tinyint(4) NOT NULL default 0,
 431    `position` varchar(10) default NULL,
 432    `checked_out` int(11) unsigned NOT NULL default 0,
 433    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 434    `published` tinyint(1) NOT NULL default 0,
 435    `module` varchar(50) default NULL,
 436    `numnews` int(11) NOT NULL default 0,
 437    `access` tinyint(3) unsigned NOT NULL default 0,
 438    `showtitle` tinyint(3) unsigned NOT NULL default '1',
 439    `params` text NOT NULL,
 440    `iscore` tinyint(4) NOT NULL default 0,
 441    PRIMARY KEY  (`id`),
 442    KEY `published` (`published`,`access`),
 443    KEY `newsfeeds` (`module`,`published`)
 444  ) TYPE=MyISAM;
 445  
 446  #
 447  # Dumping data for table `mos_modules`
 448  #
 449  
 450  INSERT INTO `mos_modules` VALUES (1, 'Polls', '', 1, 'right', 0, '0000-00-00 00:00:00', 1, 'mod_poll', 0, 0, 1, '', 1);
 451  INSERT INTO `mos_modules` VALUES (2, 'User Menu', '', 2, 'left', 0, '0000-00-00 00:00:00', 1, 'mod_mainmenu', 0, 1, 1, 'menutype=usermenu', 1);
 452  INSERT INTO `mos_modules` VALUES (3, 'Main Menu', '', 1, 'left', 0, '0000-00-00 00:00:00', 1, 'mod_mainmenu', 0, 0, 1, '', 1);
 453  INSERT INTO `mos_modules` VALUES (4, 'Login Form', '', 3, 'left', 0, '0000-00-00 00:00:00', 1, 'mod_login', 0, 0, 1, '', 1);
 454  INSERT INTO `mos_modules` VALUES (5, 'Syndicate', '', 2, 'right', 0, '0000-00-00 00:00:00', 1, 'mod_rssfeed', 0, 0, 0, '', 1);
 455  INSERT INTO `mos_modules` VALUES (6, 'Browser Prefs', '', 3, 'right', 0, '0000-00-00 00:00:00', 0, 'mod_browser_prefs', 0, 0, 1, '', 1);
 456  INSERT INTO `mos_modules` VALUES (7, 'Hit Counter', '', 1, 'user2', 0, '0000-00-00 00:00:00', 1, 'mod_counter', 0, 0, 1, '', 1);
 457  INSERT INTO `mos_modules` VALUES (8, 'Latest News', '', 4, 'right', 0, '0000-00-00 00:00:00', 0, 'mod_latestnews', 0, 0, 1, '', 1);
 458  INSERT INTO `mos_modules` VALUES (9, 'Newsfeeds', '', 5, 'right', 0, '0000-00-00 00:00:00', 0, 'mod_newsfeeds', 0, 0, 1, '', 1);
 459  INSERT INTO `mos_modules` VALUES (10, 'Online Users', '', 5, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_online', 0, 0, 1, '', 1);
 460  INSERT INTO `mos_modules` VALUES (11, 'Statistics', '', 4, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_stats', 0, 0, 1, '', 1);
 461  INSERT INTO `mos_modules` VALUES (12, 'Who\'s Online', '', 1, 'user1', 0, '0000-00-00 00:00:00', 1, 'mod_whosonline', 0, 0, 1, '', 1);
 462  INSERT INTO `mos_modules` VALUES (13, 'Most Read', '', 6, 'right', 0, '0000-00-00 00:00:00', 0, 'mod_mostread', 0, 0, 1, '', 1);
 463  INSERT INTO `mos_modules` VALUES (14, 'Template Chooser','',6,'left',0,'0000-00-00 00:00:00',0,'mod_templatechooser', 0, 0, 1, 'show_preview=1', 1);
 464  INSERT INTO `mos_modules` VALUES (15, 'Archive', '', 7, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_archive', 0, 0, 1, '', 1);
 465  INSERT INTO `mos_modules` VALUES (16, 'Sections', '', 8, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_sections', 0, 0, 1, '', 1);
 466  INSERT INTO `mos_modules` VALUES (17, 'Newsflash', '', 1, 'top', 0, '0000-00-00 00:00:00', 1, 'mod_newsflash', 0, 0, 1, '', 1);
 467  INSERT INTO `mos_modules` VALUES (18, 'Related Items', '', 9, 'left', 0, '0000-00-00 00:00:00', 1, 'mod_related_items', 0, 0, 1, '', 1);
 468  
 469  # --------------------------------------------------------
 470  
 471  #
 472  # Table structure for table `mos_modules_menu`
 473  #
 474  
 475  CREATE TABLE `mos_modules_menu` (
 476    `moduleid` int(11) NOT NULL default 0,
 477    `menuid` int(11) NOT NULL default 0,
 478    PRIMARY KEY  (`moduleid`,`menuid`)
 479  ) TYPE=MyISAM;
 480  
 481  #
 482  # Dumping data for table `mos_modules_menu`
 483  #
 484  
 485  INSERT INTO `mos_modules_menu` VALUES (1, 1);
 486  INSERT INTO `mos_modules_menu` VALUES (2, 0);
 487  INSERT INTO `mos_modules_menu` VALUES (3, 0);
 488  INSERT INTO `mos_modules_menu` VALUES (4, 0);
 489  INSERT INTO `mos_modules_menu` VALUES (5, 1);
 490  INSERT INTO `mos_modules_menu` VALUES (6, 0);
 491  INSERT INTO `mos_modules_menu` VALUES (7, 0);
 492  INSERT INTO `mos_modules_menu` VALUES (8, 0);
 493  INSERT INTO `mos_modules_menu` VALUES (9, 0);
 494  INSERT INTO `mos_modules_menu` VALUES (10, 0);
 495  INSERT INTO `mos_modules_menu` VALUES (11, 0);
 496  INSERT INTO `mos_modules_menu` VALUES (12, 0);
 497  INSERT INTO `mos_modules_menu` VALUES (13, 0);
 498  INSERT INTO `mos_modules_menu` VALUES (14, 0);
 499  INSERT INTO `mos_modules_menu` VALUES (16, 1);
 500  INSERT INTO `mos_modules_menu` VALUES (17, 0);
 501  # --------------------------------------------------------
 502  
 503  #
 504  # Table structure for table `mos_newsfeeds`
 505  #
 506  
 507  CREATE TABLE `mos_newsfeeds` (
 508    `catid` int(11) NOT NULL default 0,
 509    `id` int(11) NOT NULL auto_increment,
 510    `name` text NOT NULL,
 511    `link` text NOT NULL,
 512    `filename` varchar(200) default NULL,
 513    `published` tinyint(1) NOT NULL default 0,
 514    `numarticles` int(11) unsigned NOT NULL default '1',
 515    `cache_time` int(11) unsigned NOT NULL default '3600',
 516    `checked_out` tinyint(3) unsigned NOT NULL default 0,
 517    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 518    `ordering` int(11) unsigned NOT NULL default 0,
 519    PRIMARY KEY  (`id`),
 520    KEY `published` (`published`)
 521  ) TYPE=MyISAM;
 522  
 523  # --------------------------------------------------------
 524  
 525  #
 526  # Table structure for table `mos_newsfeedscache`
 527  #
 528  
 529  CREATE TABLE `mos_newsfeedscache` (
 530    `time` varchar(14) default NULL,
 531    `cachefile` varchar(50) NOT NULL default '',
 532    `filedata` text NOT NULL
 533  ) TYPE=MyISAM;
 534  
 535  #
 536  # Dumping data for table `mos_newsfeedscache`
 537  #
 538  
 539  # --------------------------------------------------------
 540  
 541  #
 542  # Table structure for table `mos_newsflash`
 543  #
 544  
 545  CREATE TABLE `mos_newsflash` (
 546    `id` int(11) NOT NULL auto_increment,
 547    `title` varchar(50) NOT NULL default '',
 548    `content` text NOT NULL,
 549    `published` tinyint(1) NOT NULL default 0,
 550    `checked_out` int(11) NOT NULL default 0,
 551    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 552    `catid` int(11) unsigned NOT NULL default 0,
 553    `publish_up` datetime NOT NULL default '0000-00-00 00:00:00',
 554    `publish_down` datetime NOT NULL default '0000-00-00 00:00:00',
 555    `access` int(11) unsigned NOT NULL default 0,
 556    PRIMARY KEY  (`id`)
 557  ) TYPE=MyISAM;
 558  
 559  #
 560  # Dumping data for table `mos_newsflash`
 561  #
 562  
 563  INSERT INTO `mos_newsflash` VALUES (1, 'Newsflash 1', 'Mambo 4.5 is \'Power In Simplicity\'!.  It has never been easier to create your own dynamic site.  Manage all your content from the best CMS admin interface.', 1, 0, '0000-00-00 00:00:00', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0);
 564  INSERT INTO `mos_newsflash` VALUES (2, 'Newsflash 2', 'Yesterday all servers in the U.S. went out on strike in a bid to get more RAM and better CPUs. A spokes person said that the need for better RAM was due to some fool increasing the front-side bus speed. In future, busses will be told to slow down in residential motherboards.', 1, 0, '0000-00-00 00:00:00', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0);
 565  INSERT INTO `mos_newsflash` VALUES (3, 'Newsflash 3', 'Aoccdrnig to a rscheearch at an Elingsh uinervtisy, it deosn\'t mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht frist and lsat ltteer is at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae we do not raed ervey lteter by itslef but the wrod as a wlohe.', 1, 0, '0000-00-00 00:00:00', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0);
 566  # --------------------------------------------------------
 567  
 568  #
 569  # Table structure for table `mos_poll_data`
 570  #
 571  
 572  CREATE TABLE `mos_poll_data` (
 573    `id` int(11) NOT NULL auto_increment,
 574    `pollid` int(4) NOT NULL default 0,
 575    `text` text NOT NULL default '',
 576    `hits` int(11) NOT NULL default 0,
 577    PRIMARY KEY  (`id`),
 578    KEY `pollid` (`pollid`,`text`(1))
 579  ) TYPE=MyISAM;
 580  
 581  #
 582  # Dumping data for table `mos_poll_data`
 583  #
 584  
 585  # --------------------------------------------------------
 586  
 587  #
 588  # Table structure for table `mos_poll_date`
 589  #
 590  
 591  CREATE TABLE `mos_poll_date` (
 592    `id` bigint(20) NOT NULL auto_increment,
 593    `date` datetime NOT NULL default '0000-00-00 00:00:00',
 594    `vote_id` int(11) NOT NULL default 0,
 595    `poll_id` int(11) NOT NULL default 0,
 596    PRIMARY KEY  (`id`),
 597    KEY `poll_id` (`poll_id`)
 598  ) TYPE=MyISAM;
 599  
 600  #
 601  # Dumping data for table `mos_poll_date`
 602  #
 603  
 604  # --------------------------------------------------------
 605  
 606  #
 607  # Table structure for table `mos_polls`
 608  #
 609  
 610  CREATE TABLE `mos_polls` (
 611    `id` int(11) unsigned NOT NULL auto_increment,
 612    `title` varchar(100) NOT NULL default '',
 613    `voters` int(9) NOT NULL default 0,
 614    `checked_out` int(11) NOT NULL default 0,
 615    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 616    `published` tinyint(1) NOT NULL default 0,
 617    `access` int(11) NOT NULL default 0,
 618    `lag` int(11) NOT NULL default 0,
 619    PRIMARY KEY  (`id`)
 620  ) TYPE=MyISAM;
 621  
 622  #
 623  # Table structure for table `mos_poll_menu`
 624  #
 625  
 626  CREATE TABLE `mos_poll_menu` (
 627    `pollid` int(11) NOT NULL default 0,
 628    `menuid` int(11) NOT NULL default 0,
 629    PRIMARY KEY  (`pollid`,`menuid`)
 630  ) TYPE=MyISAM;
 631  
 632  #
 633  # Dumping data for table `mos_poll_menu`
 634  #
 635  
 636  # --------------------------------------------------------
 637  
 638  #
 639  # Table structure for table `mos_sections`
 640  #
 641  
 642  CREATE TABLE `mos_sections` (
 643    `id` int(11) NOT NULL auto_increment,
 644    `title` varchar(50) NOT NULL default '',
 645    `name` varchar(255) NOT NULL default '',
 646    `image` varchar(100) NOT NULL default '',
 647    `scope` varchar(50) NOT NULL default '',
 648    `image_position` varchar(10) NOT NULL default '',
 649    `description` text NOT NULL,
 650    `published` tinyint(1) NOT NULL default 0,
 651    `checked_out` int(11) unsigned NOT NULL default 0,
 652    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 653    `ordering` int(11) NOT NULL default 0,
 654    `access` tinyint(3) unsigned NOT NULL default 0,
 655      `count` int(11) NOT NULL default 0,
 656    PRIMARY KEY  (`id`),
 657    KEY `idx_scope` (`scope`)
 658  ) TYPE=MyISAM;
 659  
 660  #
 661  # Dumping data for table `mos_sections`
 662  #
 663  
 664  INSERT INTO `mos_sections` VALUES (1, 'News', 'The News', 'articles.jpg', 'content', 'right', 'Select a news topic from the list below, then select a news article to read.', 1, 0, '0000-00-00 00:00:00', 1, 0, 1);
 665  INSERT INTO `mos_sections` VALUES (2, 'Articles', 'Articles', 'articles.jpg', 'content', 'right', 'Select a news topic from the list below, then select a news article to read.', 1, 0, '0000-00-00 00:00:00', 1, 0, 1);
 666  INSERT INTO `mos_sections` VALUES (3, 'Faq', 'Frequently Asked Questions', 'articles.jpg', 'content', 'right', 'Select a news topic from the list below, then select a news article to read.', 1, 0, '0000-00-00 00:00:00', 1, 0, 1);
 667  
 668  #
 669  # Table structure for table `mos_session`
 670  #
 671  
 672  CREATE TABLE `mos_session` (
 673    `username` varchar(50) default '',
 674    `time` varchar(14) default '',
 675    `session_id` varchar(200) NOT NULL default 0,
 676    `guest` tinyint(4) default '1',
 677    `userid` int(11) default 0,
 678    `usertype` varchar(50) default '',
 679    `gid` tinyint(3) unsigned NOT NULL default 0,
 680    PRIMARY KEY  (`session_id`),
 681    KEY `whosonline` (`guest`,`usertype`)
 682  ) TYPE=MyISAM;
 683  
 684  #
 685  # Table structure for table `mos_stats_agents`
 686  #
 687  
 688  CREATE TABLE `mos_stats_agents` (
 689    `agent` varchar(255) NOT NULL default '',
 690    `type` tinyint(1) unsigned NOT NULL default 0,
 691    `hits` int(11) unsigned NOT NULL default '1'
 692  ) TYPE=MyISAM;
 693  
 694  #
 695  # Dumping data for table `mos_stats_agents`
 696  #
 697  
 698  # --------------------------------------------------------
 699  
 700  #
 701  # Table structure for table `mos_templates`
 702  #
 703  
 704  CREATE TABLE `mos_templates` (
 705    `id` int(11) NOT NULL default 0,
 706    `cur_template` varchar(50) NOT NULL default '',
 707    `col_main` char(1) NOT NULL default '1',
 708    PRIMARY KEY  (`id`)
 709  ) TYPE=MyISAM;
 710  
 711  #
 712  # Dumping data for table `mos_templates`
 713  #
 714  
 715  INSERT INTO `mos_templates` VALUES (0, 'peeklime', '3');
 716  # --------------------------------------------------------
 717  
 718  #
 719  # Table structure for table `mos_users`
 720  #
 721  
 722  CREATE TABLE `mos_users` (
 723    `id` int(11) NOT NULL auto_increment,
 724    `name` varchar(50) NOT NULL default '',
 725    `username` varchar(25) NOT NULL default '',
 726    `email` varchar(100) NOT NULL default '',
 727    `password` varchar(100) NOT NULL default '',
 728    `usertype` varchar(25) NOT NULL default '',
 729    `block` tinyint(4) NOT NULL default 0,
 730    `sendEmail` tinyint(4) default 0,
 731    `gid` tinyint(3) unsigned NOT NULL default '1',
 732    `registerDate` datetime NOT NULL default '0000-00-00 00:00:00',
 733    `lastvisitDate` datetime NOT NULL default '0000-00-00 00:00:00',
 734    PRIMARY KEY  (`id`),
 735    KEY `usertype` (`usertype`),
 736    KEY `idx_name` (`name`)
 737  ) TYPE=MyISAM;
 738  
 739  #
 740  # Table structure for table `mos_usertypes`
 741  #
 742  
 743  CREATE TABLE `mos_usertypes` (
 744    `id` tinyint(3) unsigned NOT NULL default 0,
 745    `name` varchar(50) NOT NULL default '',
 746    `mask` varchar(11) NOT NULL default '',
 747    PRIMARY KEY  (`id`)
 748  ) TYPE=MyISAM;
 749  
 750  #
 751  # Dumping data for table `mos_usertypes`
 752  #
 753  
 754  INSERT INTO `mos_usertypes` VALUES (0, 'superadministrator', '');
 755  INSERT INTO `mos_usertypes` VALUES (1, 'administrator', '');
 756  INSERT INTO `mos_usertypes` VALUES (2, 'editor', '');
 757  INSERT INTO `mos_usertypes` VALUES (3, 'user', '');
 758  INSERT INTO `mos_usertypes` VALUES (4, 'author', '');
 759  INSERT INTO `mos_usertypes` VALUES (5, 'publisher', '');
 760  INSERT INTO `mos_usertypes` VALUES (6, 'manager', '');
 761  # --------------------------------------------------------
 762  
 763  #
 764  # Table structure for table `mos_weblinks`
 765  #
 766  
 767  CREATE TABLE `mos_weblinks` (
 768    `id` int(11) unsigned NOT NULL auto_increment,
 769    `catid` int(11) NOT NULL default 0,
 770    `sid` int(11) NOT NULL default 0,
 771    `title` varchar(250) NOT NULL default '',
 772    `url` varchar(250) NOT NULL default '',
 773    `description` varchar(250) NOT NULL default '',
 774    `date` datetime NOT NULL default '0000-00-00 00:00:00',
 775    `hits` int(11) NOT NULL default 0,
 776    `published` tinyint(1) NOT NULL default 0,
 777    `checked_out` int(11) NOT NULL default 0,
 778    `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
 779    `ordering` int(11) NOT NULL default 0,
 780    `archived` tinyint(1) NOT NULL default 0,
 781    `approved` tinyint(1) NOT NULL default '1',
 782    PRIMARY KEY  (`id`),
 783    KEY `catid` (`catid`,`published`,`archived`)
 784  ) TYPE=MyISAM;
 785  
 786  #
 787  # Table structure for table `mos_core_acl_aro`
 788  #
 789  
 790  CREATE TABLE `mos_core_acl_aro` (
 791    `aro_id` int(11) NOT NULL auto_increment,
 792    `section_value` varchar(240) NOT NULL default 0,
 793    `value` varchar(240) NOT NULL default '',
 794    `order_value` int(11) NOT NULL default 0,
 795    `name` varchar(255) NOT NULL default '',
 796    `hidden` int(11) NOT NULL default 0,
 797    PRIMARY KEY  (`aro_id`),
 798    UNIQUE KEY `section_value_value_aro` (`section_value`,`value`),
 799    UNIQUE KEY `mos_gacl_section_value_value_aro` (`section_value`,`value`),
 800    KEY `hidden_aro` (`hidden`),
 801    KEY `mos_gacl_hidden_aro` (`hidden`)
 802  ) TYPE=MyISAM;
 803  
 804  #
 805  # Table structure for table `mos_core_acl_aro_groups`
 806  #
 807  CREATE TABLE `mos_core_acl_aro_groups` (
 808    `group_id` int(11) NOT NULL auto_increment,
 809    `parent_id` int(11) NOT NULL default 0,
 810    `name` varchar(255) NOT NULL default '',
 811    `lft` int(11) NOT NULL default 0,
 812    `rgt` int(11) NOT NULL default 0,
 813    PRIMARY KEY  (`group_id`),
 814    KEY `parent_id_aro_groups` (`parent_id`),
 815    KEY `mos_gacl_parent_id_aro_groups` (`parent_id`),
 816    KEY `mos_gacl_lft_rgt_aro_groups` (`lft`,`rgt`)
 817  ) TYPE=MyISAM;
 818  
 819  #
 820  # Dumping data for table `mos_core_acl_aro_groups`
 821  #
 822  INSERT INTO `mos_core_acl_aro_groups` VALUES (17,0,'ROOT',1,22);
 823  INSERT INTO `mos_core_acl_aro_groups` VALUES (28,17,'USERS',2,21);
 824  INSERT INTO `mos_core_acl_aro_groups` VALUES (29,28,'Public Frontend',3,12);
 825  INSERT INTO `mos_core_acl_aro_groups` VALUES (18,29,'Registered',4,11);
 826  INSERT INTO `mos_core_acl_aro_groups` VALUES (19,18,'Author',5,10);
 827  INSERT INTO `mos_core_acl_aro_groups` VALUES (20,19,'Editor',6,9);
 828  INSERT INTO `mos_core_acl_aro_groups` VALUES (21,20,'Publisher',7,8);
 829  INSERT INTO `mos_core_acl_aro_groups` VALUES (30,28,'Public Backend',13,20);
 830  INSERT INTO `mos_core_acl_aro_groups` VALUES (23,30,'Manager',14,19);
 831  INSERT INTO `mos_core_acl_aro_groups` VALUES (24,23,'Administrator',15,18);
 832  INSERT INTO `mos_core_acl_aro_groups` VALUES (25,24,'Super Administrator',16,17);
 833  
 834  #
 835  # Table structure for table `mos_core_acl_groups_aro_map`
 836  #
 837  CREATE TABLE `mos_core_acl_groups_aro_map` (
 838    `group_id` int(11) NOT NULL default 0,
 839    `section_value` varchar(240) NOT NULL default '',
 840    `aro_id` int(11) NOT NULL default 0,
 841    UNIQUE KEY `group_id_aro_id_groups_aro_map` (`group_id`,`section_value`,`aro_id`)
 842  ) TYPE=MyISAM;
 843  
 844  #
 845  # Table structure for table `mos_core_acl_aro_sections`
 846  #
 847  CREATE TABLE `mos_core_acl_aro_sections` (
 848    `section_id` int(11) NOT NULL auto_increment,
 849    `value` varchar(230) NOT NULL default '',
 850    `order_value` int(11) NOT NULL default 0,
 851    `name` varchar(230) NOT NULL default '',
 852    `hidden` int(11) NOT NULL default 0,
 853    PRIMARY KEY  (`section_id`),
 854    UNIQUE KEY `value_aro_sections` (`value`),
 855    UNIQUE KEY `mos_gacl_value_aro_sections` (`value`),
 856    KEY `hidden_aro_sections` (`hidden`),
 857    KEY `mos_gacl_hidden_aro_sections` (`hidden`)
 858  ) TYPE=MyISAM;
 859  
 860  INSERT INTO mos_core_acl_aro_sections VALUES (10,'users',1,'Users',0);
 861  
 862  
 863  
 864  # --------------------------------------------------------
 865  
 866  # Finally import old data
 867  
 868  #--------Import users
 869  
 870  INSERT INTO `mos_users`
 871      (`id`, `name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `gid`)
 872  SELECT o.id, o.name, o.username, o.email, o.password, o.usertype, o.block, o.sendEmail, o.gid
 873  FROM old_users AS o;
 874  
 875  #--------Update ACL tables
 876  INSERT INTO `mos_core_acl_aro`
 877       (aro_id,section_value,value,order_value,name,hidden)
 878  SELECT mos_users.id, 'users', mos_users.id, '0', mos_users.name, '0'
 879      FROM mos_users;
 880  
 881  INSERT INTO `mos_core_acl_groups_aro_map`
 882      (group_id,aro_id)
 883  SELECT arg.group_id, mos_users.id AS aro_id
 884  FROM mos_users
 885  LEFT JOIN `mos_core_acl_aro_groups` AS arg ON arg.name='Super Administrator'
 886  WHERE usertype='superadministrator';
 887  
 888  INSERT INTO `mos_core_acl_groups_aro_map`
 889      (group_id,aro_id)
 890  SELECT arg.group_id, mos_users.id AS aro_id
 891  FROM mos_users
 892  LEFT JOIN `mos_core_acl_aro_groups` AS arg ON arg.name='Administrator'
 893  WHERE usertype='administrator';
 894  
 895  INSERT INTO `mos_core_acl_groups_aro_map`
 896      (group_id,aro_id)
 897  SELECT arg.group_id, mos_users.id AS aro_id
 898  FROM mos_users
 899  LEFT JOIN `mos_core_acl_aro_groups` AS arg ON arg.name='Editor'
 900  WHERE usertype='editor';
 901  
 902  INSERT INTO `mos_core_acl_groups_aro_map`
 903      (group_id,aro_id)
 904  SELECT arg.group_id, mos_users.id AS aro_id
 905  FROM mos_users
 906  LEFT JOIN `mos_core_acl_aro_groups` AS arg ON arg.name='Registered'
 907  WHERE usertype NOT IN ('editor','administrator','superadministrator');
 908  
 909  UPDATE `mos_users` SET gid='25' WHERE usertype='superadministrator';
 910  UPDATE `mos_users` SET gid='24' WHERE usertype='administrator';
 911  UPDATE `mos_users` SET gid='20' WHERE usertype='editor';
 912  UPDATE `mos_users` SET gid='18' WHERE usertype NOT IN ('editor','administrator','superadministrator');
 913  
 914  #--------Import Categories for content
 915  
 916  INSERT INTO mos_categories (`title`, `name`, `image`, `section`, `image_position`,
 917      `description`, `published`, `checked_out`, `checked_out_time`, `ordering`,
 918      `access`, `count`)
 919  SELECT categoryname, categoryname, 'articles.jpg' AS new_image, mos_sections.id,
 920      'left' AS new_image_position, categoryname, '1' AS new_published,
 921      '0' AS new_checked_out, '0000-00-00 00:00:00' AS new_checkedout_time,
 922      '0' AS new_ordering, '0' AS new_access, '1' AS new_count
 923      FROM old_categories
 924  INNER JOIN mos_sections ON old_categories.section=mos_sections.title;
 925  
 926  #--------Import Weblink Categories
 927  
 928  INSERT INTO mos_categories (title, name, image, section, image_position, description, published, checked_out, checked_out_time, ordering, access, count) select categoryname, categoryname, 'articles.jpg' as new_image, 'com_weblinks', 'left' as new_image_position, categoryname, '1' as new_published, '0' as new_checked_out, '0000-00-00 00:00:00' as new_checkedout_time, '0' as new_ordering, '0' as new_access, '1'as new_count from old_categories WHERE section='Weblinks';
 929  
 930  #--------Import articles
 931  
 932  # Do not need this
 933  #INSERT INTO mos_content (`title`, `introtext`, `state`, `sectionid`, `mask`, `catid`, `created`,
 934  #    `created_by`, `modified`, `modified_by`, `checked_out`, `checked_out_time`, `publish_up`,
 935  #    `publish_down`, `images`, `urls`, `attribs`, `version`, `parentid`, `ordering`, `metakey`,
 936  #    `metadesc`, `access`, `hits`)
 937  #SELECT o.title, o.content, o.published, '2' AS new_sectionid, '0' AS new_mask,
 938  #    mos_categories.id, o.date AS new_created, mos_users.id AS new_created_by,
 939  #    o.date AS new_modified, mos_users.id AS new_modified_by,
 940  #    '0' AS new_checked_out, '0000-00-00 00:00:00' AS new_checked_out_time,
 941  #    '2003-01-01 00:00:00' AS new_publish_up, '0000-00-00 00:00:00' AS new_publish_down,
 942  #    '' AS new_images, '' AS new_urls, '' AS new_attribs, '1' AS new_version,
 943  #    '0' AS new_parent, o.ordering AS new_ordering, o.title, o.title, '0' AS new_access,
 944  #    o.counter AS new_hits
 945  #FROM old_articles AS o
 946  #INNER JOIN old_categories ON o.catid=old_categories.categoryid
 947  #LEFT JOIN mos_categories on old_categories.categoryname=mos_categories.title
 948  #LEFT JOIN mos_users ON mos_users.name = o.author
 949  #WHERE o.archived = '0';
 950  
 951  # archived
 952  #
 953  #INSERT INTO mos_content (`title`, `introtext`, `state`, `sectionid`, `mask`, `catid`, `created`,
 954  #    `created_by`, `modified`, `modified_by`, `checked_out`, `checked_out_time`, `publish_up`,
 955  #    `publish_down`, `images`, `urls`, `attribs`, `version`, `parentid`, `ordering`, `metakey`,
 956  #    `metadesc`, `access`, `hits`)
 957  #SELECT o.title, o.content, o.published, '2' AS new_sectionid, '0' AS new_mask,
 958  #    mos_categories.id, o.date AS new_created, mos_users.id AS new_created_by,
 959  #    o.date AS new_modified, mos_users.id AS new_modified_by,
 960  #    '0' AS new_checked_out, '0000-00-00 00:00:00' AS new_checked_out_time,
 961  #    '2003-01-01 00:00:00' AS new_publish_up, '0000-00-00 00:00:00' AS new_publish_down,
 962  #    '' AS new_images, '' AS new_urls, '' AS new_attribs, '1' AS new_version,
 963  #    '0' AS new_parent, o.ordering AS new_ordering, o.title, o.title, '0' AS new_access,
 964  #    o.counter AS new_hits
 965  #FROM old_articles AS o
 966  #INNER JOIN old_categories ON o.catid=old_categories.categoryid
 967  #LEFT JOIN mos_categories on old_categories.categoryname=mos_categories.title
 968  #LEFT JOIN mos_users ON mos_users.name = o.author
 969  #WHERE o.archived = '1';
 970  # Do not need this
 971  
 972  #--------Import Stories (News)
 973  
 974  INSERT INTO mos_content (`title`, `introtext`, `fulltext`, `state`, `sectionid`,
 975      `mask`, `catid`, `created`,
 976      `created_by`, `modified`, `modified_by`,
 977      `checked_out`, `checked_out_time`,
 978      `publish_up`, `publish_down`,
 979      `images`, `urls`,
 980      `attribs`, `version`, `parentid`, `ordering`,
 981      `metakey`, `metadesc`, `access`, `hits`)
 982  SELECT o.title, CONCAT_WS('','{mosimage}',o.introtext), o.fultext, o.published as new_state, '1' as new_sectionid,
 983      '0' as new_mask, mos_categories.id, o.time as new_created,
 984      mos_users.id as new_created_by, o.time as new_modified, mos_users.id as new_modified_by,
 985      '0' as new_checked_out, '0000-00-00 00:00:00' as new_checked_out_time,
 986      '2003-01-01 00:00:00' as new_publish_up, '0000-00-00 00:00:00' as new_publish_down,
 987      CONCAT_WS('|',o.newsimage,o.image_position,'Image','0') as new_images, '' as new_urls,
 988      '' as new_attribs, '1' as new_version, '0' as new_parent, o.ordering as new_ordering,
 989      o.title, o.title, o.access as new_access, o.counter as new_hits
 990  FROM old_stories AS o
 991  INNER JOIN old_categories ON o.catid=old_categories.categoryid
 992  LEFT JOIN mos_categories on old_categories.categoryname=mos_categories.title
 993  LEFT JOIN mos_users ON mos_users.name = o.author
 994  WHERE o.archived = '0';
 995  
 996  INSERT INTO mos_content (`title`, `introtext`, `fulltext`, `state`, `sectionid`,
 997      `mask`, `catid`, `created`,
 998      `created_by`, `modified`, `modified_by`,
 999      `checked_out`, `checked_out_time`,
1000      `publish_up`, `publish_down`,
1001      `images`, `urls`,
1002      `attribs`, `version`, `parentid`, `ordering`,
1003      `metakey`, `metadesc`, `access`, `hits`)
1004  SELECT o.title, CONCAT_WS('','{mosimage}',o.introtext), o.fultext, '-1' as new_state, '1' as new_sectionid,
1005      '0' as new_mask, mos_categories.id, o.time as new_created,
1006      mos_users.id as new_created_by, o.time as new_modified, mos_users.id as new_modified_by,
1007      '0' as new_checked_out, '0000-00-00 00:00:00' as new_checked_out_time,
1008      '2003-01-01 00:00:00' as new_publish_up, '0000-00-00 00:00:00' as new_publish_down,
1009      CONCAT_WS('|',o.newsimage,o.image_position,'Image','0') as new_images, '' as new_urls,
1010      '' as new_attribs, '1' as new_version, '0' as new_parent, o.ordering as new_ordering,
1011      o.title, o.title, o.access as new_access, o.counter as new_hits
1012  FROM old_stories AS o
1013  INNER JOIN old_categories ON o.catid=old_categories.categoryid
1014  LEFT JOIN mos_categories on old_categories.categoryname=mos_categories.title
1015  LEFT JOIN mos_users ON mos_users.name = o.author
1016  WHERE o.archived = '1';
1017  
1018  #--------Import FAQs
1019  
1020  INSERT INTO mos_content (`title`, `introtext`, `state`, `sectionid`,
1021      `mask`, `catid`, `created`,
1022      `created_by`, `modified`, `modified_by`,
1023      `checked_out`, `checked_out_time`,
1024      `publish_up`, `publish_down`,
1025      `images`, `urls`,
1026      `attribs`, `version`, `parentid`, `ordering`,
1027      `metakey`, `metadesc`, `access`, `hits`)
1028  select o.title, o.content, o.published as new_state, '3' as new_sectionid,
1029      '0' as new_mask, mos_categories.id, NOW() as new_created,
1030      '62' as new_created_by, NOW() as new_modified, '62' as new_modified_by,
1031      '0' as new_checked_out, '0000-00-00 00:00:00' as new_checked_out_time,
1032      '2003-01-01 00:00:00' as new_publish_up, '0000-00-00 00:00:00' as new_publish_down,
1033      '' as new_images, '' as new_urls,
1034      '' as new_attribs, '1' as new_version, '0' as new_parent, o.ordering as new_ordering,
1035      o.title, o.title, '0' as new_access, o.counter as new_hits
1036  FROM old_faqcont AS o
1037  INNER JOIN old_categories ON o.catid=old_categories.categoryid
1038  LEFT JOIN mos_categories on old_categories.categoryname=mos_categories.title
1039  WHERE o.archived = '0';
1040  
1041  #--------Import Weblinks
1042  
1043  INSERT INTO mos_weblinks (catid, sid, title, url, description, date, hits, published,
1044      checked_out, checked_out_time, ordering, archived, approved)
1045  select mos_categories.id, old_links.sid, old_links.title, old_links.url,
1046      old_links.description, old_links.date, old_links.hits, old_links.published,
1047      old_links.checked_out, old_links.checked_out_time, '0',old_links.archived, old_links.approved
1048  FROM (old_categories
1049  inner join mos_categories on old_categories.categoryname=mos_categories.name)
1050  INNER JOIN old_links on old_categories.categoryid=old_links.catid;
1051  
1052  
1053  
1054  #--------Import contact_details
1055  
1056  INSERT INTO mos_contact_details (name, con_position, address, suburb, state,
1057      country, postcode, telephone, fax, misc, image, imagepos, email_to, default_con, published)
1058  select o.name, '', o.address, o.suburb, o.state, o.country, o.postcode, o.telephone,
1059      o.fax, '', '', '',o.email_to, 1, 1
1060  FROM old_contact_details AS o;
1061  
1062  #--------Import menu typed content
1063  # temporarily hold the menu id in the catid field
1064  
1065  INSERT INTO mos_content (`title`, `introtext`, `state`, `sectionid`,
1066      `mask`, `catid`, `created`,
1067      `created_by`, `modified`, `modified_by`,
1068      `checked_out`, `checked_out_time`,
1069      `publish_up`, `publish_down`,
1070      `images`, `urls`,
1071      `attribs`, `version`, `parentid`, `ordering`,
1072      `metakey`, `metadesc`, `access`, `hits`)
1073  select o.heading, o.content, '1' as new_state, '0' as new_sectionid,
1074      '0' as new_mask, o.menuid AS new_catid, NOW() as new_created,
1075      '62' as new_created_by, NOW() as new_modified, '62' as new_modified_by,
1076      '0' as new_checked_out, '0000-00-00 00:00:00' as new_checked_out_time,
1077      '2003-01-01 00:00:00' as new_publish_up, '0000-00-00 00:00:00' as new_publish_down,
1078      '' as new_images, '' as new_urls,
1079      '' as new_attribs, '1' as new_version, '0' as new_parent, '1' as new_ordering,
1080      o.heading, o.heading, '0' as new_access, '0' as new_hits
1081  FROM old_menucontent AS o;
1082  
1083  #--------Import menu details
1084  
1085  # the old home page
1086  INSERT INTO mos_menu (`id`, `menutype`, `name`,
1087      `link`,
1088      `type`, `published`, `parent`,
1089      `componentid`, `sublevel`,
1090      `ordering`, `checked_out`,
1091      `checked_out_time`,    `pollid`,
1092      `browserNav`, `access`, `utaccess`, `params`)
1093  SELECT o.id, o.menutype AS new_menutype, o.name AS new_name,
1094      'index.php?option=com_frontpage' AS new_link,
1095      'components' AS new_contenttype, o.inuse, o.componentid,
1096      mos_components.id AS new_componentid, o.sublevel AS new_sublevel,
1097      o.ordering AS new_ordering, '0' as new_checked_out,
1098      '0000-00-00 0000:00:00' AS new_checked_out_time, '0' AS new_pollid,
1099      o.browserNav as new_browsernav, o.access AS new_access, '0', ''
1100  FROM old_menu AS o
1101  LEFT JOIN mos_content ON mos_content.catid=o.id AND mos_content.sectionid='0'
1102  LEFT JOIN mos_components ON mos_components.option = 'com_frontpage' AND mos_components.id=9
1103  WHERE o.link='index.php' AND o.contenttype='mambo';
1104  
1105  # the old news page
1106  INSERT INTO mos_menu (`id`, `menutype`, `name`,
1107      `link`,
1108      `type`, `published`, `parent`,
1109      `componentid`, `sublevel`,
1110      `ordering`, `checked_out`,
1111      `checked_out_time`,    `pollid`,
1112      `browserNav`, `access`, `utaccess`, `params`)
1113  SELECT o.id, o.menutype AS new_menutype, o.name AS new_name,
1114      'index.php?option=com_content&task=section&id=1' AS new_link,
1115      'content_section' AS new_contenttype, o.inuse, o.componentid,
1116      mos_content.id AS new_componentid, o.sublevel AS new_sublevel,
1117      o.ordering AS new_ordering, '0' as new_checked_out,
1118      '0000-00-00 0000:00:00' AS new_checked_out_time, '0' AS new_pollid,
1119      o.browserNav as new_browsernav, o.access AS new_access, '0', ''
1120  FROM old_menu AS o
1121  LEFT JOIN mos_content ON mos_content.catid=o.id AND mos_content.sectionid='0'
1122  WHERE o.link='index.php?option=news' AND o.contenttype='mambo';
1123  
1124  # the old articles page
1125  INSERT INTO mos_menu (`id`, `menutype`, `name`,
1126      `link`,
1127      `type`, `published`, `parent`,
1128      `componentid`, `sublevel`,
1129      `ordering`, `checked_out`,
1130      `checked_out_time`,    `pollid`,
1131      `browserNav`, `access`, `utaccess`, `params`)
1132  SELECT o.id, o.menutype AS new_menutype, o.name AS new_name,
1133      'index.php?option=com_content&task=section&id=2' AS new_link,
1134      'content_section' AS new_contenttype, o.inuse, o.componentid,
1135      mos_content.id AS new_componentid, o.sublevel AS new_sublevel,
1136      o.ordering AS new_ordering, '0' as new_checked_out,
1137      '0000-00-00 0000:00:00' AS new_checked_out_time, '0' AS new_pollid,
1138      o.browserNav as new_browsernav, o.access AS new_access, '0', ''
1139  FROM old_menu AS o
1140  LEFT JOIN mos_content ON mos_content.catid=o.id AND mos_content.sectionid='0'
1141  WHERE o.link='index.php?option=articles' AND o.contenttype='mambo';
1142  
1143  # the old faq page
1144  INSERT INTO mos_menu (`id`, `menutype`, `name`,
1145      `link`,
1146      `type`, `published`, `parent`,
1147      `componentid`, `sublevel`,
1148      `ordering`, `checked_out`,
1149      `checked_out_time`,    `pollid`,
1150      `browserNav`, `access`, `utaccess`, `params`)
1151  SELECT o.id, o.menutype AS new_menutype, o.name AS new_name,
1152      'index.php?option=com_content&task=section&id=3' AS new_link,
1153      'content_section' AS new_contenttype, o.inuse, o.componentid,
1154      mos_content.id AS new_componentid, o.sublevel AS new_sublevel,
1155      o.ordering AS new_ordering, '0' as new_checked_out,
1156      '0000-00-00 0000:00:00' AS new_checked_out_time, '0' AS new_pollid,
1157      o.browserNav as new_browsernav, o.access AS new_access, '0', ''
1158  FROM old_menu AS o
1159  LEFT JOIN mos_content ON mos_content.catid=o.id AND mos_content.sectionid='0'
1160  WHERE o.link='index.php?option=faq' AND o.contenttype='mambo';
1161  
1162  # the old weblinks page
1163  INSERT INTO mos_menu (`id`, `menutype`, `name`,
1164      `link`,
1165      `type`, `published`, `parent`,
1166      `componentid`, `sublevel`,
1167      `ordering`, `checked_out`,
1168      `checked_out_time`,    `pollid`,
1169      `browserNav`, `access`, `utaccess`, `params`)
1170  SELECT o.id, o.menutype AS new_menutype, o.name AS new_name,
1171      'index.php?option=com_weblinks' AS new_link,
1172      'components' AS new_contenttype, o.inuse, o.componentid,
1173      mos_components.id AS new_componentid, o.sublevel AS new_sublevel,
1174      o.ordering AS new_ordering, '0' as new_checked_out,
1175      '0000-00-00 0000:00:00' AS new_checked_out_time, '0' AS new_pollid,
1176      o.browserNav as new_browsernav, o.access AS new_access, '0', ''
1177  FROM old_menu AS o
1178  LEFT JOIN mos_content ON mos_content.catid=o.id AND mos_content.sectionid='0'
1179  LEFT JOIN mos_components ON mos_components.option = 'com_weblinks'
1180  WHERE o.link='index.php?option=weblinks' AND o.contenttype='mambo' AND mos_components.id=4;
1181  
1182  # the old contacts page
1183  INSERT INTO mos_menu (`id`, `menutype`, `name`,
1184      `link`,
1185      `type`, `published`, `parent`,
1186      `componentid`, `sublevel`,
1187      `ordering`, `checked_out`,
1188      `checked_out_time`,    `pollid`,
1189      `browserNav`, `access`, `utaccess`, `params`)
1190  SELECT o.id, o.menutype AS new_menutype, o.name AS new_name,
1191      'index.php?option=com_contact' AS new_link,
1192      'components' AS new_contenttype, o.inuse, o.componentid,
1193      mos_components.id AS new_componentid, o.sublevel AS new_sublevel,
1194      o.ordering AS new_ordering, '0' as new_checked_out,
1195      '0000-00-00 0000:00:00' AS new_checked_out_time, '0' AS new_pollid,
1196      o.browserNav as new_browsernav, o.access AS new_access, '0', ''
1197  FROM old_menu AS o
1198  LEFT JOIN mos_content ON mos_content.catid=o.id AND mos_content.sectionid='0'
1199  LEFT JOIN mos_components ON mos_components.option = 'com_contact'
1200  WHERE o.link='index.php?option=contact' AND o.contenttype='mambo';
1201  
1202  # the old direct links
1203  INSERT INTO mos_menu (`id`, `menutype`, `name`,
1204      `link`,
1205      `type`, `published`, `parent`,
1206      `componentid`, `sublevel`,
1207      `ordering`, `checked_out`,
1208      `checked_out_time`,    `pollid`,
1209      `browserNav`, `access`, `utaccess`, `params`)
1210  SELECT o.id, o.menutype AS new_menutype, o.name AS new_name,
1211      o.link AS new_link,
1212      'url' AS new_contenttype, o.inuse, o.componentid,
1213      mos_content.id AS new_componentid, o.sublevel AS new_sublevel,
1214      o.ordering AS new_ordering, '0' as new_checked_out,
1215      '0000-00-00 0000:00:00' AS new_checked_out_time, '0' AS new_pollid,
1216      o.browserNav as new_browsernav, o.access AS new_access, '0', ''
1217  FROM old_menu AS o
1218  LEFT JOIN mos_content ON mos_content.catid=o.id AND mos_content.sectionid='0'
1219  WHERE o.contenttype='web';
1220  
1221  # the typed content
1222  INSERT INTO mos_menu (`id`, `menutype`, `name`,
1223      `link`,
1224      `type`, `published`, `parent`,
1225      `componentid`, `sublevel`,
1226      `ordering`, `checked_out`,
1227      `checked_out_time`,    `pollid`,
1228      `browserNav`, `access`, `utaccess`, `params`)
1229  SELECT o.id, o.menutype AS new_menutype, o.name AS new_name,
1230      CONCAT_WS('','index.php?option=com_content&task=view&id=',mos_content.id) AS new_link,
1231      'content_typed' AS new_contenttype, o.inuse, o.componentid,
1232      mos_content.id AS new_componentid, o.sublevel AS new_sublevel,
1233      o.ordering AS new_ordering, '0' as new_checked_out,
1234      '0000-00-00 0000:00:00' AS new_checked_out_time, '0' AS new_pollid,
1235      o.browserNav as new_browsernav, o.access AS new_access, '0', ''
1236  FROM old_menu AS o
1237  LEFT JOIN mos_content ON mos_content.catid=o.id AND mos_content.sectionid='0'
1238  WHERE o.contenttype='typed';
1239  
1240  # the old frontpage item
1241  INSERT INTO `mos_content_frontpage`
1242  SELECT mos_content.id, old_stories.ordering FROM mos_content 
1243  INNER JOIN old_stories ON mos_content.title=old_stories.title WHERE old_stories.frontpage=1;
1244  
1245  # usermenu
1246  INSERT INTO `mos_menu` VALUES ('', 'usermenu', 'Your Details', 'index.php?option=com_user&task=UserDetails', 'url', 1, 0, 0, 0, 1, 0, '2000-00-00 00:00:00', 0, 0, 1, 3, '');
1247  INSERT INTO `mos_menu` VALUES ('', 'usermenu', 'Submit News', 'index.php?option=com_content&task=new&sectionid=1', 'url', 1, 0, 0, 0, 2, 0, '2000-00-00 00:00:00', 0, 0, 1, 2, '');
1248  INSERT INTO `mos_menu` VALUES ('', 'usermenu', 'Submit WebLink', 'index.php?option=com_weblinks&task=new', 'url', 1, 0, 0, 0, 4, 0, '2000-00-00 00:00:00', 0, 0, 1, 2, '');
1249  INSERT INTO `mos_menu` VALUES ('', 'usermenu', 'Check-In My Items', 'index.php?option=com_user&task=CheckIn', 'url', 1, 0, 0, 0, 5, 0, '0000-00-00 00:00:00', 0, 0, 1, 2, '');
1250  
1251  
1252  # null the catid field
1253  UPDATE mos_content SET catid='0' where sectionid='0';
1254  
1255  # --------------------------------------------------------
1256  # statistics
1257  
1258  INSERT INTO `mos_stats_agents`
1259      (`agent`,`hits`,`type`)
1260  SELECT `name`,`count`,'0'
1261  FROM old_counter
1262  WHERE `type`='browser';
1263  
1264  INSERT INTO `mos_stats_agents`
1265      (`agent`,`hits`,`type`)
1266  SELECT `name`,`count`,'1'
1267  FROM old_counter
1268  WHERE `type`='OS';
1269  # --------------------------------------------------------
1270  
1271  UPDATE `mos_menu` SET link='index.php?option=com_user&task=UserDetails' WHERE link='index.php?option=user&op=UserDetails';
1272  UPDATE `mos_menu` SET link='index.php?option=com_user&task=CheckIn' WHERE link='index.php?option=user&op=CheckIn';
1273  
1274  # registration control moved to configuration
1275  UPDATE `mos_modules` SET params='' WHERE module='mod_login';
1276  
1277  # special group not supported in the core pending ACL improvements in 4.6
1278  DELETE FROM `mos_groups` WHERE name='Special';
1279  
1280  ## add activation
1281  ALTER TABLE `mos_users` ADD `activation` varchar(100) NOT NULL default '' AFTER `lastvisitDate`;
1282  
1283  DROP TABLE IF EXISTS mos_templates;
1284  # Table structure for table `mos_templates_menu`
1285  
1286  CREATE TABLE `mos_templates_menu` (
1287    `template` varchar(50) NOT NULL default '',
1288    `menuid` int(11) NOT NULL default 0,
1289    `client_id` tinyint(4) NOT NULL default 0,
1290    PRIMARY KEY  (`template`,`menuid`)
1291  ) TYPE=MyISAM;
1292  
1293  INSERT INTO `mos_templates_menu` VALUES ('rhuk_solarflare_ii', '0', '0');
1294  INSERT INTO `mos_templates_menu` VALUES ('mambo_admin_blue', '0', '1');