install.sql 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. -- TABLE: entries
  2. CREATE TABLE IF NOT EXISTS `bx_stories_entries` (
  3. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  4. `author` int(11) unsigned NOT NULL,
  5. `added` int(11) NOT NULL,
  6. `changed` int(11) NOT NULL,
  7. `expired` int(11) NOT NULL,
  8. `thumb` int(11) NOT NULL,
  9. `title` varchar(255) NOT NULL,
  10. `text` text NOT NULL,
  11. `labels` text NOT NULL,
  12. `location` text NOT NULL,
  13. `views` int(11) NOT NULL default '0',
  14. `rate` float NOT NULL default '0',
  15. `votes` int(11) NOT NULL default '0',
  16. `rrate` float NOT NULL default '0',
  17. `rvotes` int(11) NOT NULL default '0',
  18. `score` int(11) NOT NULL default '0',
  19. `sc_up` int(11) NOT NULL default '0',
  20. `sc_down` int(11) NOT NULL default '0',
  21. `favorites` int(11) NOT NULL default '0',
  22. `comments` int(11) NOT NULL default '0',
  23. `reports` int(11) NOT NULL default '0',
  24. `featured` int(11) NOT NULL default '0',
  25. `cf` int(11) NOT NULL default '1',
  26. `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
  27. `status` enum('active','awaiting','failed','hidden') NOT NULL DEFAULT 'active',
  28. `status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active',
  29. PRIMARY KEY (`id`),
  30. FULLTEXT KEY `title_text` (`title`,`text`)
  31. );
  32. CREATE TABLE IF NOT EXISTS `bx_stories_entries_media` (
  33. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  34. `content_id` int(11) unsigned NOT NULL,
  35. `file_id` int(11) NOT NULL,
  36. `author` int(10) unsigned NOT NULL,
  37. `title` varchar(255) NOT NULL,
  38. `cf` int(11) NOT NULL default '1',
  39. `data` text NOT NULL,
  40. `order` int(11) NOT NULL,
  41. PRIMARY KEY (`id`),
  42. UNIQUE KEY `file_content` (`file_id`,`content_id`),
  43. KEY `content_id` (`content_id`),
  44. FULLTEXT KEY `search_fields` (`title`)
  45. );
  46. -- TABLE: storages & transcoders
  47. CREATE TABLE IF NOT EXISTS `bx_stories_files` (
  48. `id` int(11) NOT NULL AUTO_INCREMENT,
  49. `profile_id` int(11) unsigned NOT NULL,
  50. `remote_id` varchar(128) NOT NULL,
  51. `path` varchar(255) NOT NULL,
  52. `file_name` varchar(255) NOT NULL,
  53. `mime_type` varchar(128) NOT NULL,
  54. `ext` varchar(32) NOT NULL,
  55. `size` bigint(20) NOT NULL,
  56. `dimensions` varchar(12) NOT NULL,
  57. `duration` int(11) NOT NULL,
  58. `added` int(11) NOT NULL,
  59. `modified` int(11) NOT NULL,
  60. `private` int(11) NOT NULL,
  61. PRIMARY KEY (`id`),
  62. UNIQUE KEY `remote_id` (`remote_id`)
  63. );
  64. CREATE TABLE IF NOT EXISTS `bx_stories_photos_resized` (
  65. `id` int(11) NOT NULL AUTO_INCREMENT,
  66. `profile_id` int(11) unsigned NOT NULL,
  67. `remote_id` varchar(128) NOT NULL,
  68. `path` varchar(255) NOT NULL,
  69. `file_name` varchar(255) NOT NULL,
  70. `mime_type` varchar(128) NOT NULL,
  71. `ext` varchar(32) NOT NULL,
  72. `size` bigint(20) NOT NULL,
  73. `added` int(11) NOT NULL,
  74. `modified` int(11) NOT NULL,
  75. `private` int(11) NOT NULL,
  76. PRIMARY KEY (`id`),
  77. UNIQUE KEY `remote_id` (`remote_id`)
  78. );
  79. -- TABLE: comments
  80. CREATE TABLE IF NOT EXISTS `bx_stories_cmts` (
  81. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  82. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  83. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  84. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  85. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  86. `cmt_level` int(11) NOT NULL DEFAULT '0',
  87. `cmt_text` text NOT NULL,
  88. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  89. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  90. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  91. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  92. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  93. `cmt_pinned` int(11) NOT NULL default '0',
  94. `cmt_cf` int(11) NOT NULL default '1',
  95. PRIMARY KEY (`cmt_id`),
  96. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  97. FULLTEXT KEY `search_fields` (`cmt_text`)
  98. );
  99. CREATE TABLE IF NOT EXISTS `bx_stories_cmts_notes` (
  100. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  101. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  102. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  103. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  104. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  105. `cmt_level` int(11) NOT NULL DEFAULT '0',
  106. `cmt_text` text NOT NULL,
  107. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  108. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  109. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  110. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  111. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  112. `cmt_pinned` int(11) NOT NULL default '0',
  113. PRIMARY KEY (`cmt_id`),
  114. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  115. FULLTEXT KEY `search_fields` (`cmt_text`)
  116. );
  117. -- TABLE: votes
  118. CREATE TABLE IF NOT EXISTS `bx_stories_votes` (
  119. `id` int(11) NOT NULL AUTO_INCREMENT,
  120. `object_id` int(11) NOT NULL default '0',
  121. `count` int(11) NOT NULL default '0',
  122. `sum` int(11) NOT NULL default '0',
  123. PRIMARY KEY (`id`),
  124. UNIQUE KEY `object_id` (`object_id`)
  125. );
  126. CREATE TABLE IF NOT EXISTS `bx_stories_votes_track` (
  127. `id` int(11) NOT NULL AUTO_INCREMENT,
  128. `object_id` int(11) NOT NULL default '0',
  129. `author_id` int(11) NOT NULL default '0',
  130. `author_nip` int(11) unsigned NOT NULL default '0',
  131. `value` tinyint(4) NOT NULL default '0',
  132. `date` int(11) NOT NULL default '0',
  133. PRIMARY KEY (`id`),
  134. KEY `vote` (`object_id`, `author_nip`)
  135. );
  136. CREATE TABLE IF NOT EXISTS `bx_stories_reactions` (
  137. `id` int(11) NOT NULL AUTO_INCREMENT,
  138. `object_id` int(11) NOT NULL default '0',
  139. `reaction` varchar(32) NOT NULL default '',
  140. `count` int(11) NOT NULL default '0',
  141. `sum` int(11) NOT NULL default '0',
  142. PRIMARY KEY (`id`),
  143. UNIQUE KEY `reaction` (`object_id`, `reaction`)
  144. );
  145. CREATE TABLE IF NOT EXISTS `bx_stories_reactions_track` (
  146. `id` int(11) NOT NULL AUTO_INCREMENT,
  147. `object_id` int(11) NOT NULL default '0',
  148. `author_id` int(11) NOT NULL default '0',
  149. `author_nip` int(11) unsigned NOT NULL default '0',
  150. `reaction` varchar(32) NOT NULL default '',
  151. `value` tinyint(4) NOT NULL default '0',
  152. `date` int(11) NOT NULL default '0',
  153. PRIMARY KEY (`id`),
  154. KEY `vote` (`object_id`, `author_nip`)
  155. );
  156. -- TABLE: views
  157. CREATE TABLE IF NOT EXISTS `bx_stories_views_track` (
  158. `id` int(11) NOT NULL AUTO_INCREMENT,
  159. `object_id` int(11) NOT NULL default '0',
  160. `viewer_id` int(11) NOT NULL default '0',
  161. `viewer_nip` int(11) unsigned NOT NULL default '0',
  162. `date` int(11) NOT NULL default '0',
  163. PRIMARY KEY (`id`),
  164. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  165. );
  166. -- TABLE: metas
  167. CREATE TABLE IF NOT EXISTS `bx_stories_meta_keywords` (
  168. `id` int(11) NOT NULL AUTO_INCREMENT,
  169. `object_id` int(10) unsigned NOT NULL,
  170. `keyword` varchar(255) NOT NULL,
  171. PRIMARY KEY (`id`),
  172. KEY `object_id` (`object_id`),
  173. KEY `keyword` (`keyword`)
  174. );
  175. CREATE TABLE IF NOT EXISTS `bx_stories_meta_mentions` (
  176. `id` int(11) NOT NULL AUTO_INCREMENT,
  177. `object_id` int(10) unsigned NOT NULL,
  178. `profile_id` int(10) unsigned NOT NULL,
  179. PRIMARY KEY (`id`),
  180. KEY `object_id` (`object_id`),
  181. KEY `profile_id` (`profile_id`)
  182. );
  183. -- TABLE: reports
  184. CREATE TABLE IF NOT EXISTS `bx_stories_reports` (
  185. `id` int(11) NOT NULL AUTO_INCREMENT,
  186. `object_id` int(11) NOT NULL default '0',
  187. `count` int(11) NOT NULL default '0',
  188. PRIMARY KEY (`id`),
  189. UNIQUE KEY `object_id` (`object_id`)
  190. );
  191. CREATE TABLE IF NOT EXISTS `bx_stories_reports_track` (
  192. `id` int(11) NOT NULL AUTO_INCREMENT,
  193. `object_id` int(11) NOT NULL default '0',
  194. `author_id` int(11) NOT NULL default '0',
  195. `author_nip` int(11) unsigned NOT NULL default '0',
  196. `type` varchar(32) NOT NULL default '',
  197. `text` text NOT NULL default '',
  198. `date` int(11) NOT NULL default '0',
  199. `checked_by` int(11) NOT NULL default '0',
  200. `status` tinyint(11) NOT NULL default '0',
  201. PRIMARY KEY (`id`),
  202. KEY `report` (`object_id`, `author_nip`)
  203. );
  204. -- TABLE: scores
  205. CREATE TABLE IF NOT EXISTS `bx_stories_scores` (
  206. `id` int(11) NOT NULL AUTO_INCREMENT,
  207. `object_id` int(11) NOT NULL default '0',
  208. `count_up` int(11) NOT NULL default '0',
  209. `count_down` int(11) NOT NULL default '0',
  210. PRIMARY KEY (`id`),
  211. UNIQUE KEY `object_id` (`object_id`)
  212. );
  213. CREATE TABLE IF NOT EXISTS `bx_stories_scores_track` (
  214. `id` int(11) NOT NULL AUTO_INCREMENT,
  215. `object_id` int(11) NOT NULL default '0',
  216. `author_id` int(11) NOT NULL default '0',
  217. `author_nip` int(11) unsigned NOT NULL default '0',
  218. `type` varchar(8) NOT NULL default '',
  219. `date` int(11) NOT NULL default '0',
  220. PRIMARY KEY (`id`),
  221. KEY `vote` (`object_id`, `author_nip`)
  222. );
  223. -- STORAGES & TRANSCODERS
  224. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  225. 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
  226. ('bx_stories_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_stories_files', 'allow-deny', '{imagevideo}', '', 0, 0, 0, 0, 0, 0),
  227. ('bx_stories_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_stories_photos_resized', 'allow-deny', '{imagevideo}', '', 0, 0, 0, 0, 0, 0);
  228. INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`, `override_class_name`, `override_class_file`) VALUES
  229. ('bx_stories_preview', 'bx_stories_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stories_files";}', 'no', '1', '2592000', '0', '', ''),
  230. ('bx_stories_browse', 'bx_stories_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stories_files";}', 'no', '1', '2592000', '0', '', ''),
  231. ('bx_stories_big', 'bx_stories_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stories_files";}', 'no', '1', '2592000', '0', '', ''),
  232. ('bx_stories_video_poster_browse', 'bx_stories_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stories_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  233. ('bx_stories_video_poster_preview', 'bx_stories_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stories_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  234. ('bx_stories_video_poster_big', 'bx_stories_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stories_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  235. ('bx_stories_video_mp4', 'bx_stories_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stories_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  236. ('bx_stories_video_mp4_hd', 'bx_stories_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_stories_files";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  237. ('bx_stories_proxy_preview', 'bx_stories_photos_resized', 'Proxy', 'a:4:{s:6:"object";s:16:"bx_stories_files";s:5:"image";s:18:"bx_stories_preview";s:12:"video_poster";s:31:"bx_stories_video_poster_preview";s:5:"video";a:4:{i:0;s:20:"bx_stories_video_mp4";i:1;s:23:"bx_stories_video_mp4_hd";i:2;s:30:"bx_stories_video_poster_browse";i:3;s:27:"bx_stories_video_poster_big";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', ''),
  238. ('bx_stories_proxy_browse', 'bx_stories_photos_resized', 'Proxy', 'a:4:{s:6:"object";s:16:"bx_stories_files";s:5:"image";s:17:"bx_stories_browse";s:12:"video_poster";s:30:"bx_stories_video_poster_browse";s:5:"video";a:2:{i:0;s:20:"bx_stories_video_mp4";i:1;s:23:"bx_stories_video_mp4_hd";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', ''),
  239. ('bx_stories_proxy_cover', 'bx_stories_photos_resized', 'Proxy', 'a:4:{s:6:"object";s:16:"bx_stories_files";s:5:"image";s:14:"bx_stories_big";s:12:"video_poster";s:27:"bx_stories_video_poster_big";s:5:"video";a:2:{i:0;s:20:"bx_stories_video_mp4";i:1;s:23:"bx_stories_video_mp4_hd";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', '');
  240. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  241. ('bx_stories_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"300";s:13:"square_resize";s:1:"1";}', '0'),
  242. ('bx_stories_browse', 'Resize', 'a:1:{s:1:"h";s:3:"180";}', '0'),
  243. ('bx_stories_big', 'Resize', 'a:2:{s:1:"w";s:4:"1280";s:1:"h";s:4:"1280";}', '0'),
  244. ('bx_stories_video_poster_browse', 'Poster', 'a:2:{s:1:"h";s:3:"180";s:10:"force_type";s:3:"jpg";}', 0),
  245. ('bx_stories_video_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  246. ('bx_stories_video_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"300";s:13:"square_resize";s:1:"1";}', 10),
  247. ('bx_stories_video_poster_big', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  248. ('bx_stories_video_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"mp4";}', 0),
  249. ('bx_stories_video_mp4_hd', 'Mp4', 'a:3:{s:1:"h";s:3:"720";s:13:"video_bitrate";s:4:"1536";s:10:"force_type";s:3:"mp4";}', 0);
  250. -- FORMS
  251. 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
  252. ('bx_stories', 'bx_stories', '_bx_stories_form_entry', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_stories_entries', 'id', '', '', 'do_submit', '', 0, 1, 'BxStoriesFormEntry', 'modules/boonex/stories/classes/BxStoriesFormEntry.php');
  253. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  254. ('bx_stories', 'bx_stories_entry_add', 'bx_stories', 0, '_bx_stories_form_entry_display_add'),
  255. ('bx_stories', 'bx_stories_entry_edit', 'bx_stories', 0, '_bx_stories_form_entry_display_edit'),
  256. ('bx_stories', 'bx_stories_entry_delete', 'bx_stories', 0, '_bx_stories_form_entry_display_delete'),
  257. ('bx_stories', 'bx_stories_entry_view', 'bx_stories', 1, '_bx_stories_form_entry_display_view');
  258. 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
  259. ('bx_stories', 'bx_stories', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_stories_form_entry_input_sys_delete_confirm', '_bx_stories_form_entry_input_delete_confirm', '_bx_stories_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_stories_form_entry_input_delete_confirm_error', '', '', 1, 0),
  260. ('bx_stories', 'bx_stories', 'do_submit', '_bx_stories_form_entry_input_do_submit', '', 0, 'submit', '_bx_stories_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  261. ('bx_stories', 'bx_stories', 'title', '', '', 0, 'text', '_bx_stories_form_entry_input_sys_title', '_bx_stories_form_entry_input_title', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_stories_form_entry_input_title_err', 'Xss', '', 1, 0),
  262. ('bx_stories', 'bx_stories', 'text', '', '', 0, 'textarea', '_bx_stories_form_entry_input_sys_text', '_bx_stories_form_entry_input_text', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
  263. ('bx_stories', 'bx_stories', 'pictures', 'a:1:{i:0;s:16:"bx_stories_html5";}', 'a:3:{s:16:"bx_stories_html5";s:25:"_sys_uploader_html5_title";s:23:"bx_stories_record_video";s:32:"_sys_uploader_record_video_title";s:15:"bx_stories_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_stories_form_entry_input_sys_pictures', '_bx_stories_form_entry_input_pictures', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_stories_form_entry_input_pictures_err', '', '', 1, 0),
  264. ('bx_stories', 'bx_stories', 'cf', '1', '#!sys_content_filter', 0, 'select', '_sys_form_entry_input_sys_cf', '_sys_form_entry_input_cf', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  265. ('bx_stories', 'bx_stories', 'allow_view_to', '', '', 0, 'custom', '_bx_stories_form_entry_input_sys_allow_view_to', '_bx_stories_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  266. ('bx_stories', 'bx_stories', 'added', '', '', 0, 'datetime', '_bx_stories_form_entry_input_sys_date_added', '_bx_stories_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  267. ('bx_stories', 'bx_stories', 'changed', '', '', 0, 'datetime', '_bx_stories_form_entry_input_sys_date_changed', '_bx_stories_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  268. ('bx_stories', 'bx_stories', 'expired', '', '', 0, 'datetime', '_bx_stories_form_entry_input_sys_date_expired', '_bx_stories_form_entry_input_date_expired', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  269. ('bx_stories', 'bx_stories', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  270. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  271. ('bx_stories_entry_add', 'pictures', 2147483647, 1, 1),
  272. ('bx_stories_entry_add', 'allow_view_to', 2147483647, 1, 2),
  273. ('bx_stories_entry_add', 'do_submit', 2147483647, 1, 3),
  274. ('bx_stories_entry_edit', 'pictures', 2147483647, 1, 1),
  275. ('bx_stories_entry_edit', 'allow_view_to', 2147483647, 1, 2),
  276. ('bx_stories_entry_edit', 'do_submit', 2147483647, 1, 3),
  277. ('bx_stories_entry_view', 'added', 2147483647, 1, 1),
  278. ('bx_stories_entry_view', 'changed', 2147483647, 1, 2),
  279. ('bx_stories_entry_view', 'expired', 2147483647, 1, 3),
  280. ('bx_stories_entry_delete', 'delete_confirm', 2147483647, 1, 1),
  281. ('bx_stories_entry_delete', 'do_submit', 2147483647, 1, 2);
  282. 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
  283. ('bx_stories_media', 'bx_stories', '_bx_stories_form_media', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_stories_entries_media', 'id', '', '', 'do_submit', '', 0, 1, 'BxStoriesFormMedia', 'modules/boonex/stories/classes/BxStoriesFormMedia.php');
  284. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  285. ('bx_stories_media', 'bx_stories_media_edit', 'bx_stories', 0, '_bx_stories_form_media_display_edit');
  286. 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
  287. ('bx_stories_media', 'bx_stories', 'title', '', '', 0, 'text', '_bx_stories_form_media_input_sys_title', '_bx_stories_form_media_input_title', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  288. ('bx_stories_media', 'bx_stories', 'content_id', '', '', 0, 'select', '_bx_stories_form_media_input_sys_content_id', '_bx_stories_form_media_input_content_id', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  289. ('bx_stories_media', 'bx_stories', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  290. ('bx_stories_media', 'bx_stories', 'do_submit', '_bx_stories_form_media_input_do_submit', '', 0, 'submit', '_bx_stories_form_media_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  291. ('bx_stories_media', 'bx_stories', 'do_cancel', '_bx_stories_form_media_input_do_cancel', '', 0, 'button', '_bx_stories_form_media_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
  292. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  293. ('bx_stories_media_edit', 'title', 2147483647, 1, 1),
  294. ('bx_stories_media_edit', 'controls', 2147483647, 1, 2),
  295. ('bx_stories_media_edit', 'do_submit', 2147483647, 1, 3),
  296. ('bx_stories_media_edit', 'do_cancel', 2147483647, 1, 4);
  297. -- COMMENTS
  298. INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
  299. ('bx_stories', 'bx_stories', 'bx_stories_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-story&id={object_id}', '', 'bx_stories_entries', 'id', 'author', 'title', 'comments', '', ''),
  300. ('bx_stories_notes', 'bx_stories', 'bx_stories_cmts_notes', 1, 5000, 1000, 0, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-post&id={object_id}', '', 'bx_stories_entries', 'id', 'author', 'title', '', 'BxTemplCmtsNotes', '');
  301. -- VOTES
  302. INSERT INTO `sys_objects_vote` (`Name`, `Module`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  303. ('bx_stories', 'bx_stories', 'bx_stories_votes', 'bx_stories_votes_track', '604800', '1', '1', '0', '1', 'bx_stories_entries', 'id', 'author', 'rate', 'votes', '', ''),
  304. ('bx_stories_reactions', 'bx_stories', 'bx_stories_reactions', 'bx_stories_reactions_track', '604800', '1', '1', '1', '1', 'bx_stories_entries', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', '');
  305. -- SCORES
  306. INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES
  307. ('bx_stories', 'bx_stories', 'bx_stories_scores', 'bx_stories_scores_track', '604800', '0', 'bx_stories_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
  308. -- REPORTS
  309. INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `is_on`, `base_url`, `object_comment`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  310. ('bx_stories', 'bx_stories', 'bx_stories_reports', 'bx_stories_reports_track', '1', 'page.php?i=view-story&id={object_id}', 'bx_stories_notes', 'bx_stories_entries', 'id', 'author', 'reports', '', '');
  311. -- VIEWS
  312. INSERT INTO `sys_objects_view` (`name`, `module`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  313. ('bx_stories', 'bx_stories', 'bx_stories_views_track', '86400', '1', 'bx_stories_entries', 'id', '', 'views', '', '');
  314. -- CONTENT INFO
  315. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  316. ('bx_stories', '_bx_stories', 'bx_stories', 'added', 'edited', 'deleted', '', ''),
  317. ('bx_stories_cmts', '_bx_stories_cmts', 'bx_stories', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  318. INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
  319. ('bx_stories', 'bx_stories_administration', 'id', '', ''),
  320. ('bx_stories', 'bx_stories_common', 'id', '', '');
  321. -- SEARCH EXTENDED
  322. INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
  323. ('bx_stories', 'bx_stories', 'bx_stories', '_bx_stories_search_extended', 1, '', ''),
  324. ('bx_stories_cmts', 'bx_stories_cmts', 'bx_stories', '_bx_stories_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
  325. -- STUDIO: page & widget
  326. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  327. (3, 'bx_stories', '_bx_stories', '_bx_stories', 'bx_stories@modules/boonex/stories/|std-icon.svg');
  328. SET @iPageId = LAST_INSERT_ID();
  329. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  330. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  331. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  332. (@iPageId, 'bx_stories', 'content', '{url_studio}module.php?name=bx_stories', '', 'bx_stories@modules/boonex/stories/|std-icon.svg', '_bx_stories', '', '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";}');
  333. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  334. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));