install.sql 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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(19) NOT NULL,
  14. `content_module` varchar(19) 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. CREATE TABLE IF NOT EXISTS `bx_charts_most_followed_profiles` (
  24. `id` int(11) NOT NULL AUTO_INCREMENT,
  25. `object_id` int(11) NOT NULL default '0',
  26. `profile_module` varchar(19) NOT NULL,
  27. `followers_count` int(11) NOT NULL default '0',
  28. PRIMARY KEY (`id`),
  29. INDEX `followers_count` (`followers_count`),
  30. INDEX `object_id` (`object_id`),
  31. INDEX `profile_module` (`profile_module`)
  32. );
  33. -- STUDIO: page & widget
  34. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  35. (3, @sName, '_bx_charts', '_bx_charts', 'bx_charts@modules/boonex/charts/|std-icon.svg');
  36. SET @iPageId = LAST_INSERT_ID();
  37. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`, `bookmark`)
  38. VALUES(@iPageId, @sName, 'extensions', '{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);
  39. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  40. SET @iParentPageOrder = (SELECT IFNULL(MAX(`order`), 0) + 1 FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  41. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  42. (@iParentPageId, LAST_INSERT_ID(), @iParentPageOrder);