install.sql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. -- TABLE: PROFILES
  2. CREATE TABLE IF NOT EXISTS `bx_persons_data` (
  3. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  4. `author` int(10) unsigned NOT NULL,
  5. `added` int(11) NOT NULL,
  6. `changed` int(11) NOT NULL,
  7. `picture` int(11) NOT NULL,
  8. `cover` int(11) NOT NULL,
  9. `fullname` varchar(255) NOT NULL,
  10. `description` text NOT NULL,
  11. `views` int(11) NOT NULL default '0',
  12. `allow_view_to` int(11) NOT NULL DEFAULT '3',
  13. PRIMARY KEY (`id`),
  14. FULLTEXT KEY `fullname` (`fullname`)
  15. );
  16. -- TABLE: STORAGES & TRANSCODERS
  17. CREATE TABLE `bx_persons_pictures` (
  18. `id` int(11) NOT NULL AUTO_INCREMENT,
  19. `profile_id` int(10) unsigned NOT NULL,
  20. `remote_id` varchar(255) NOT NULL,
  21. `path` varchar(255) NOT NULL,
  22. `file_name` varchar(255) NOT NULL,
  23. `mime_type` varchar(128) NOT NULL,
  24. `ext` varchar(32) NOT NULL,
  25. `size` int(11) NOT NULL,
  26. `added` int(11) NOT NULL,
  27. `modified` int(11) NOT NULL,
  28. `private` int(11) NOT NULL,
  29. PRIMARY KEY (`id`),
  30. UNIQUE KEY `remote_id` (`remote_id`)
  31. );
  32. CREATE TABLE `bx_persons_pictures_resized` (
  33. `id` int(11) NOT NULL AUTO_INCREMENT,
  34. `profile_id` int(10) unsigned NOT NULL,
  35. `remote_id` varchar(255) NOT NULL,
  36. `path` varchar(255) NOT NULL,
  37. `file_name` varchar(255) NOT NULL,
  38. `mime_type` varchar(128) NOT NULL,
  39. `ext` varchar(32) NOT NULL,
  40. `size` int(11) NOT NULL,
  41. `added` int(11) NOT NULL,
  42. `modified` int(11) NOT NULL,
  43. `private` int(11) NOT NULL,
  44. PRIMARY KEY (`id`),
  45. UNIQUE KEY `remote_id` (`remote_id`)
  46. );
  47. -- TABLE: VIEWS
  48. CREATE TABLE `bx_persons_views_track` (
  49. `object_id` int(11) NOT NULL default '0',
  50. `viewer_id` int(11) NOT NULL default '0',
  51. `viewer_nip` int(11) unsigned NOT NULL default '0',
  52. `date` int(11) NOT NULL default '0',
  53. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  54. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  55. -- TABLE: metas
  56. CREATE TABLE `bx_persons_meta_keywords` (
  57. `object_id` int(10) unsigned NOT NULL,
  58. `keyword` varchar(255) NOT NULL,
  59. KEY `object_id` (`object_id`),
  60. KEY `keyword` (`keyword`)
  61. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  62. -- STORAGES & TRANSCODERS
  63. INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
  64. ('bx_persons_pictures', 'Local', '', 360, 2592000, 3, 'bx_persons_pictures', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  65. ('bx_persons_pictures_resized', 'Local', '', 360, 2592000, 3, 'bx_persons_pictures_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
  66. INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES
  67. ('bx_persons_icon', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
  68. ('bx_persons_thumb', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
  69. ('bx_persons_avatar', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
  70. ('bx_persons_picture', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
  71. ('bx_persons_cover', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0'),
  72. ('bx_persons_cover_thumb', 'bx_persons_pictures_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_persons_pictures";}', 'no', '1', '2592000', '0');
  73. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  74. ('bx_persons_icon', 'Resize', 'a:3:{s:1:"w";s:2:"32";s:1:"h";s:2:"32";s:13:"square_resize";s:1:"1";}', '0'),
  75. ('bx_persons_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"48";s:1:"h";s:2:"48";s:13:"square_resize";s:1:"1";}', '0'),
  76. ('bx_persons_avatar', 'Resize', 'a:3:{s:1:"w";s:2:"96";s:1:"h";s:2:"96";s:13:"square_resize";s:1:"1";}', '0'),
  77. ('bx_persons_picture', 'Resize', 'a:3:{s:1:"w";s:4:"1024";s:1:"h";s:4:"1024";s:13:"square_resize";s:1:"0";}', '0'),
  78. ('bx_persons_cover', 'Resize', 'a:1:{s:1:"w";s:4:"1024";}', '0'),
  79. ('bx_persons_cover_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"48";s:1:"h";s:2:"48";s:13:"square_resize";s:1:"1";}', '0');
  80. -- FORMS
  81. INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  82. ('bx_person', 'bx_persons', '_bx_persons_form_profile', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_persons_data', 'id', '', '', 'do_submit', '', 0, 1, 'BxPersonsFormEntry', 'modules/boonex/persons/classes/BxPersonsFormEntry.php');
  83. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  84. ('bx_person', 'bx_person_add', 'bx_persons', 0, '_bx_persons_form_profile_display_add'),
  85. ('bx_person', 'bx_person_delete', 'bx_persons', 0, '_bx_persons_form_profile_display_delete'),
  86. ('bx_person', 'bx_person_edit', 'bx_persons', 0, '_bx_persons_form_profile_display_edit'),
  87. ('bx_person', 'bx_person_edit_cover', 'bx_persons', 0, '_bx_persons_form_profile_display_edit_cover'),
  88. ('bx_person', 'bx_person_view', 'bx_persons', 1, '_bx_persons_form_profile_display_view');
  89. INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
  90. ('bx_person', 'bx_persons', 'allow_view_to', 3, '', 0, 'custom', '_bx_persons_form_profile_input_sys_allow_view_to', '_bx_persons_form_profile_input_allow_view_to', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  91. ('bx_person', 'bx_persons', 'cover', '', '', 0, 'file', '_bx_persons_form_profile_input_sys_cover', '_bx_persons_form_profile_input_cover', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  92. ('bx_person', 'bx_persons', 'cover_preview', '', '', 0, 'custom', '_bx_persons_form_profile_input_sys_cover_preview', '_bx_persons_form_profile_input_cover_preview', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  93. ('bx_person', 'bx_persons', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_persons_form_profile_input_sys_delete_confirm', '_bx_persons_form_profile_input_delete_confirm', '_bx_persons_form_profile_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_persons_form_profile_input_delete_confirm_error', '', '', 1, 0),
  94. ('bx_person', 'bx_persons', 'do_submit', '_bx_persons_form_profile_input_submit', '', 0, 'submit', '_bx_persons_form_profile_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  95. ('bx_person', 'bx_persons', 'description', '', '', 0, 'textarea', '_bx_persons_form_profile_input_sys_desc', '_bx_persons_form_profile_input_desc', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 1),
  96. ('bx_person', 'bx_persons', 'fullname', '', '', 0, 'text', '_bx_persons_form_profile_input_sys_fullname', '_bx_persons_form_profile_input_fullname', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_persons_form_profile_input_fullname_err', 'Xss', '', 1, 0),
  97. ('bx_person', 'bx_persons', 'picture', '', '', 0, 'file', '_bx_persons_form_profile_input_sys_picture', '_bx_persons_form_profile_input_picture', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_persons_form_profile_input_picture_err', 'Int', '', 1, 0),
  98. ('bx_person', 'bx_persons', 'picture_preview', '', '', 0, 'custom', '_bx_persons_form_profile_input_sys_picture_preview', '_bx_persons_form_profile_input_picture_preview', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  99. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  100. ('bx_person_add', 'cover_preview', 2147483647, 0, 1),
  101. ('bx_person_add', 'picture_preview', 2147483647, 0, 2),
  102. ('bx_person_add', 'delete_confirm', 2147483647, 0, 3),
  103. ('bx_person_add', 'cover', 2147483647, 0, 4),
  104. ('bx_person_add', 'picture', 2147483647, 1, 5),
  105. ('bx_person_add', 'fullname', 2147483647, 1, 6),
  106. ('bx_person_add', 'description', 2147483647, 1, 8),
  107. ('bx_person_add', 'allow_view_to', 2147483647, 1, 9),
  108. ('bx_person_add', 'do_submit', 2147483647, 1, 10),
  109. ('bx_person_delete', 'cover', 2147483647, 0, 0),
  110. ('bx_person_delete', 'cover_preview', 2147483647, 0, 0),
  111. ('bx_person_delete', 'picture', 2147483647, 0, 0),
  112. ('bx_person_delete', 'delete_confirm', 2147483647, 1, 0),
  113. ('bx_person_delete', 'picture_preview', 2147483647, 0, 0),
  114. ('bx_person_delete', 'do_submit', 2147483647, 1, 1),
  115. ('bx_person_delete', 'fullname', 2147483647, 0, 2),
  116. ('bx_person_edit', 'cover_preview', 2147483647, 0, 1),
  117. ('bx_person_edit', 'delete_confirm', 2147483647, 0, 2),
  118. ('bx_person_edit', 'cover', 2147483647, 0, 3),
  119. ('bx_person_edit', 'picture_preview', 2147483647, 1, 4),
  120. ('bx_person_edit', 'picture', 2147483647, 1, 5),
  121. ('bx_person_edit', 'fullname', 2147483647, 1, 6),
  122. ('bx_person_edit', 'description', 2147483647, 1, 7),
  123. ('bx_person_edit', 'allow_view_to', 2147483647, 1, 8),
  124. ('bx_person_edit', 'do_submit', 2147483647, 1, 9),
  125. ('bx_person_edit_cover', 'delete_confirm', 2147483647, 0, 1),
  126. ('bx_person_edit_cover', 'fullname', 2147483647, 0, 2),
  127. ('bx_person_edit_cover', 'picture', 2147483647, 0, 3),
  128. ('bx_person_edit_cover', 'picture_preview', 2147483647, 0, 4),
  129. ('bx_person_edit_cover', 'cover_preview', 2147483647, 1, 6),
  130. ('bx_person_edit_cover', 'cover', 2147483647, 1, 7),
  131. ('bx_person_edit_cover', 'do_submit', 2147483647, 1, 8),
  132. ('bx_person_view', 'cover_preview', 2147483647, 0, 1),
  133. ('bx_person_view', 'picture_preview', 2147483647, 0, 2),
  134. ('bx_person_view', 'delete_confirm', 2147483647, 0, 3),
  135. ('bx_person_view', 'picture', 2147483647, 0, 4),
  136. ('bx_person_view', 'cover', 2147483647, 0, 5),
  137. ('bx_person_view', 'do_submit', 2147483647, 0, 6),
  138. ('bx_person_view', 'fullname', 2147483647, 1, 7),
  139. ('bx_person_view', 'description', 2147483647, 1, 8);
  140. -- STUDIO PAGE & WIDGET
  141. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  142. (3, 'bx_persons', '_bx_persons', '_bx_persons', 'bx_persons@modules/boonex/persons/|std-pi.png');
  143. SET @iPageId = LAST_INSERT_ID();
  144. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  145. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  146. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  147. (@iPageId, 'bx_persons', '{url_studio}module.php?name=bx_persons', '', 'bx_persons@modules/boonex/persons/|std-wi.png', '_bx_persons', '', '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";}');
  148. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  149. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));