install.sql 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. -- TABLES
  2. CREATE TABLE IF NOT EXISTS `bx_charts_top_by_likes` (
  3. `id` int(11) NOT NULL AUTO_INCREMENT,
  4. `object_id` int(11) NOT NULL default '0',
  5. `module` varchar(255) NOT NULL,
  6. `value` int(11) NOT NULL default '0',
  7. PRIMARY KEY (`id`),
  8. INDEX `value` (`value`)
  9. );
  10. CREATE TABLE IF NOT EXISTS `bx_charts_most_active_profiles` (
  11. `id` int(11) NOT NULL AUTO_INCREMENT,
  12. `object_id` int(11) NOT NULL default '0',
  13. `profile_module` varchar(255) NOT NULL,
  14. `content_module` varchar(255) NOT NULL,
  15. `views_count` int(11) NOT NULL default '0',
  16. `create_count` int(11) NOT NULL default '0',
  17. PRIMARY KEY (`id`),
  18. INDEX `views_count` (`views_count`),
  19. INDEX `create_count` (`create_count`),
  20. INDEX `object_id` (`object_id`),
  21. INDEX `profile_module` (`profile_module`)
  22. );
  23. -- STUDIO: page & widget
  24. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  25. (3, @sName, '_bx_charts', '_bx_charts', 'bx_charts@modules/boonex/charts/|std-icon.svg');
  26. SET @iPageId = LAST_INSERT_ID();
  27. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`, `bookmark`)
  28. VALUES(@iPageId, @sName, '{url_studio}module.php?name=bx_charts', '', 'bx_charts@modules/boonex/charts/|std-icon.svg', '_bx_charts', '', '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);
  29. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  30. SET @iParentPageOrder = (SELECT IFNULL(MAX(`order`), 0) + 1 FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  31. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  32. (@iParentPageId, LAST_INSERT_ID(), @iParentPageOrder);