install.sql 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. -- Studio page and widget.
  2. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  3. (3, 'bx_groups', '_bx_groups', '_bx_groups', 'bx_groups@modules/boonex/groups/|std-pi.png');
  4. SET @iPageId = LAST_INSERT_ID();
  5. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name`='home');
  6. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id`=@iParentPageId);
  7. INSERT INTO `sys_std_widgets`(`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  8. (@iPageId, 'bx_groups', CONCAT('{url_studio}module.php?name=', 'bx_groups'), '', 'bx_groups@modules/boonex/groups/|std-wi.png', '_bx_groups', '', '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";}');
  9. INSERT INTO `sys_std_pages_widgets`(`page_id`, `widget_id`, `order`) VALUES
  10. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
  11. -- create tables
  12. CREATE TABLE IF NOT EXISTS `bx_groups_main` (
  13. `id` int(10) unsigned NOT NULL auto_increment,
  14. `title` varchar(100) NOT NULL default '',
  15. `uri` varchar(255) NOT NULL,
  16. `desc` text NOT NULL,
  17. `country` varchar(2) NOT NULL,
  18. `city` varchar(64) NOT NULL,
  19. `zip` varchar(16) NOT NULL,
  20. `status` enum('approved','pending') NOT NULL default 'approved',
  21. `thumb` int(11) NOT NULL,
  22. `created` int(11) NOT NULL,
  23. `author_id` int(10) unsigned NOT NULL default '0',
  24. `tags` varchar(255) NOT NULL default '',
  25. `categories` text NOT NULL,
  26. `views` int(11) NOT NULL,
  27. `rate` float NOT NULL,
  28. `rate_count` int(11) NOT NULL,
  29. `comments_count` int(11) NOT NULL,
  30. `fans_count` int(11) NOT NULL,
  31. `featured` tinyint(4) NOT NULL,
  32. `allow_view_group_to` int(11) NOT NULL,
  33. `allow_view_fans_to` varchar(16) NOT NULL,
  34. `allow_comment_to` varchar(16) NOT NULL,
  35. `allow_rate_to` varchar(16) NOT NULL,
  36. `allow_post_in_forum_to` varchar(16) NOT NULL,
  37. `allow_join_to` int(11) NOT NULL,
  38. `join_confirmation` tinyint(4) NOT NULL default '0',
  39. `allow_upload_photos_to` varchar(16) NOT NULL,
  40. PRIMARY KEY (`id`),
  41. UNIQUE KEY `uri` (`uri`),
  42. KEY `author_id` (`author_id`),
  43. KEY `created` (`created`),
  44. FULLTEXT KEY `search` (`title`,`desc`,`tags`,`categories`),
  45. FULLTEXT KEY `tags` (`tags`),
  46. FULLTEXT KEY `categories` (`categories`)
  47. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  48. CREATE TABLE IF NOT EXISTS `bx_groups_fans` (
  49. `id_entry` int(10) unsigned NOT NULL,
  50. `id_profile` int(10) unsigned NOT NULL,
  51. `when` int(10) unsigned NOT NULL,
  52. `confirmed` tinyint(4) UNSIGNED NOT NULL default '0',
  53. PRIMARY KEY (`id_entry`, `id_profile`)
  54. ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
  55. CREATE TABLE IF NOT EXISTS `bx_groups_admins` (
  56. `id_entry` int(10) unsigned NOT NULL,
  57. `id_profile` int(10) unsigned NOT NULL,
  58. `when` int(10) unsigned NOT NULL,
  59. PRIMARY KEY (`id_entry`, `id_profile`)
  60. ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
  61. CREATE TABLE IF NOT EXISTS `bx_groups_images` (
  62. `entry_id` int(10) unsigned NOT NULL,
  63. `media_id` int(10) unsigned NOT NULL,
  64. UNIQUE KEY `entry_id` (`entry_id`,`media_id`)
  65. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  66. CREATE TABLE IF NOT EXISTS `bx_groups_rating` (
  67. `gal_id` smallint( 6 ) NOT NULL default '0',
  68. `gal_rating_count` int( 11 ) NOT NULL default '0',
  69. `gal_rating_sum` int( 11 ) NOT NULL default '0',
  70. UNIQUE KEY `gal_id` (`gal_id`)
  71. ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
  72. CREATE TABLE IF NOT EXISTS `bx_groups_rating_track` (
  73. `gal_id` smallint( 6 ) NOT NULL default '0',
  74. `gal_ip` varchar( 20 ) default NULL,
  75. `gal_date` datetime default NULL,
  76. KEY `gal_ip` (`gal_ip`, `gal_id`)
  77. ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
  78. CREATE TABLE IF NOT EXISTS `bx_groups_cmts` (
  79. `cmt_id` int( 11 ) NOT NULL AUTO_INCREMENT ,
  80. `cmt_parent_id` int( 11 ) NOT NULL default '0',
  81. `cmt_object_id` int( 12 ) NOT NULL default '0',
  82. `cmt_author_id` int( 10 ) unsigned NOT NULL default '0',
  83. `cmt_text` text NOT NULL ,
  84. `cmt_mood` tinyint( 4 ) NOT NULL default '0',
  85. `cmt_rate` int( 11 ) NOT NULL default '0',
  86. `cmt_rate_count` int( 11 ) NOT NULL default '0',
  87. `cmt_time` datetime NOT NULL default '0000-00-00 00:00:00',
  88. `cmt_replies` int( 11 ) NOT NULL default '0',
  89. PRIMARY KEY ( `cmt_id` ),
  90. KEY `cmt_object_id` (`cmt_object_id` , `cmt_parent_id`)
  91. ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
  92. CREATE TABLE IF NOT EXISTS `bx_groups_cmts_track` (
  93. `cmt_system_id` int( 11 ) NOT NULL default '0',
  94. `cmt_id` int( 11 ) NOT NULL default '0',
  95. `cmt_rate` tinyint( 4 ) NOT NULL default '0',
  96. `cmt_rate_author_id` int( 10 ) unsigned NOT NULL default '0',
  97. `cmt_rate_author_nip` int( 11 ) unsigned NOT NULL default '0',
  98. `cmt_rate_ts` int( 11 ) NOT NULL default '0',
  99. PRIMARY KEY (`cmt_system_id` , `cmt_id` , `cmt_rate_author_nip`)
  100. ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
  101. CREATE TABLE IF NOT EXISTS `bx_groups_views_track` (
  102. `id` int(10) unsigned NOT NULL,
  103. `viewer` int(10) unsigned NOT NULL,
  104. `ip` int(10) unsigned NOT NULL,
  105. `ts` int(10) unsigned NOT NULL,
  106. KEY `id` (`id`,`viewer`,`ip`)
  107. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  108. -- tag objects
  109. INSERT INTO `sys_objects_tag` VALUES (NULL, 'bx_groups', 'SELECT `Tags` FROM `bx_groups_main` WHERE `id` = {iID} AND `status` = ''approved''', 'permalinks_modules', 'm/groups/browse/tag/{tag}', 'modules/?r=groups/browse/tag/{tag}', '_bx_groups');
  110. -- category objects
  111. INSERT INTO `sys_objects_categories` VALUES (NULL, 'bx_groups', 'SELECT `Categories` FROM `bx_groups_main` WHERE `id` = {iID} AND `status` = ''approved''', 'permalinks_modules', 'm/groups/browse/category/{tag}', 'modules/?r=groups/browse/category/{tag}', '_bx_groups');
  112. INSERT INTO `sys_categories` (`Category`, `ID`, `Type`, `Owner`, `Status`) VALUES
  113. ('Arts & Literature', '0', 'bx_groups', '0', 'active'),
  114. ('Animals & Pets', '0', 'bx_groups', '0', 'active'),
  115. ('Activities', '0', 'bx_groups', '0', 'active'),
  116. ('Automotive', '0', 'bx_groups', '0', 'active'),
  117. ('Business & Money', '0', 'bx_groups', '0', 'active'),
  118. ('Companies & Co-workers', '0', 'bx_groups', '0', 'active'),
  119. ('Cultures & Nations', '0', 'bx_groups', '0', 'active'),
  120. ('Dolphin Community', '0', 'bx_groups', '0', 'active'),
  121. ('Family & Friends', '0', 'bx_groups', '0', 'active'),
  122. ('Fan Clubs', '0', 'bx_groups', '0', 'active'),
  123. ('Fashion & Style', '0', 'bx_groups', '0', 'active'),
  124. ('Fitness & Body Building', '0', 'bx_groups', '0', 'active'),
  125. ('Food & Drink', '0', 'bx_groups', '0', 'active'),
  126. ('Gay, Lesbian & Bi', '0', 'bx_groups', '0', 'active'),
  127. ('Health & Wellness', '0', 'bx_groups', '0', 'active'),
  128. ('Hobbies & Entertainment', '0', 'bx_groups', '0', 'active'),
  129. ('Internet & Computers', '0', 'bx_groups', '0', 'active'),
  130. ('Love & Relationships', '0', 'bx_groups', '0', 'active'),
  131. ('Mass Media', '0', 'bx_groups', '0', 'active'),
  132. ('Music & Cinema', '0', 'bx_groups', '0', 'active'),
  133. ('Places & Travel', '0', 'bx_groups', '0', 'active'),
  134. ('Politics', '0', 'bx_groups', '0', 'active'),
  135. ('Recreation & Sports', '0', 'bx_groups', '0', 'active'),
  136. ('Religion', '0', 'bx_groups', '0', 'active'),
  137. ('Science & Innovations', '0', 'bx_groups', '0', 'active'),
  138. ('Sex', '0', 'bx_groups', '0', 'active'),
  139. ('Teens & Schools', '0', 'bx_groups', '0', 'active'),
  140. ('Other', '0', 'bx_groups', '0', 'active');