install.sql 1.4 KB

1234567891011121314151617181920212223242526272829
  1. SET @sName = 'bx_mapjoined';
  2. -- TABLE: data
  3. CREATE TABLE `bx_mapjoined_accounts` (
  4. `id` int(11) NOT NULL AUTO_INCREMENT,
  5. `account_id` int(11) NOT NULL,
  6. `joined` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  7. `ip` varchar(16) DEFAULT NULL,
  8. `lng` float DEFAULT NULL,
  9. `lat` float DEFAULT NULL,
  10. PRIMARY KEY (`id`),
  11. INDEX `mapjoined_accounts_join` (`joined`)
  12. );
  13. -- STUDIO: page & widget
  14. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  15. (3, @sName, '_bx_mapjoined', '_bx_mapjoined', 'bx_mapjoined@modules/boonex/mapjoined/|std-icon.svg');
  16. SET @iPageId = LAST_INSERT_ID();
  17. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`, `bookmark`)
  18. VALUES(@iPageId, @sName, '{url_studio}module.php?name=bx_mapjoined', '', 'bx_mapjoined@modules/boonex/mapjoined/|std-icon.svg', '_bx_mapjoined', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}', 0);
  19. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  20. SET @iParentPageOrder = (SELECT IFNULL(MAX(`order`), 0) + 1 FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  21. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  22. (@iParentPageId, LAST_INSERT_ID(), @iParentPageOrder);