install.sql 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. -- TABLE: entries
  2. CREATE TABLE IF NOT EXISTS `bx_videos_entries` (
  3. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  4. `author` int(10) unsigned NOT NULL default '0',
  5. `added` int(11) NOT NULL default '0',
  6. `changed` int(11) NOT NULL default '0',
  7. `thumb` int(11) NOT NULL default '0',
  8. `poster` int(11) NOT NULL default '0',
  9. `video` int(11) NOT NULL default '0',
  10. `title` varchar(255) NOT NULL,
  11. `cat` int(11) NOT NULL,
  12. `text` text NOT NULL,
  13. `duration` int(11) NOT NULL,
  14. `views` int(11) NOT NULL default '0',
  15. `rate` float NOT NULL default '0',
  16. `votes` int(11) NOT NULL default '0',
  17. `srate` float NOT NULL default '0',
  18. `svotes` int(11) NOT NULL default '0',
  19. `score` int(11) NOT NULL default '0',
  20. `sc_up` int(11) NOT NULL default '0',
  21. `sc_down` int(11) NOT NULL default '0',
  22. `favorites` int(11) NOT NULL default '0',
  23. `comments` int(11) NOT NULL default '0',
  24. `reports` int(11) NOT NULL default '0',
  25. `featured` int(11) NOT NULL default '0',
  26. `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
  27. `status` enum('active','hidden') NOT NULL DEFAULT 'active',
  28. `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
  29. PRIMARY KEY (`id`),
  30. FULLTEXT KEY `title_text` (`title`,`text`)
  31. );
  32. -- TABLE: storages & transcoders
  33. CREATE TABLE IF NOT EXISTS `bx_videos_photos` (
  34. `id` int(11) NOT NULL AUTO_INCREMENT,
  35. `profile_id` int(10) unsigned NOT NULL,
  36. `remote_id` varchar(128) NOT NULL,
  37. `path` varchar(255) NOT NULL,
  38. `file_name` varchar(255) NOT NULL,
  39. `mime_type` varchar(128) NOT NULL,
  40. `ext` varchar(32) NOT NULL,
  41. `size` int(11) NOT NULL,
  42. `added` int(11) NOT NULL,
  43. `modified` int(11) NOT NULL,
  44. `private` int(11) NOT NULL,
  45. PRIMARY KEY (`id`),
  46. UNIQUE KEY `remote_id` (`remote_id`)
  47. );
  48. CREATE TABLE IF NOT EXISTS `bx_videos_videos` (
  49. `id` int(11) NOT NULL AUTO_INCREMENT,
  50. `profile_id` int(10) unsigned NOT NULL,
  51. `remote_id` varchar(128) NOT NULL,
  52. `path` varchar(255) NOT NULL,
  53. `file_name` varchar(255) NOT NULL,
  54. `mime_type` varchar(128) NOT NULL,
  55. `ext` varchar(32) NOT NULL,
  56. `size` int(11) NOT NULL,
  57. `added` int(11) NOT NULL,
  58. `modified` int(11) NOT NULL,
  59. `private` int(11) NOT NULL,
  60. PRIMARY KEY (`id`),
  61. UNIQUE KEY `remote_id` (`remote_id`)
  62. );
  63. CREATE TABLE IF NOT EXISTS `bx_videos_media_resized` (
  64. `id` int(11) NOT NULL AUTO_INCREMENT,
  65. `profile_id` int(10) unsigned NOT NULL,
  66. `remote_id` varchar(128) NOT NULL,
  67. `path` varchar(255) NOT NULL,
  68. `file_name` varchar(255) NOT NULL,
  69. `mime_type` varchar(128) NOT NULL,
  70. `ext` varchar(32) NOT NULL,
  71. `size` int(11) NOT NULL,
  72. `added` int(11) NOT NULL,
  73. `modified` int(11) NOT NULL,
  74. `private` int(11) NOT NULL,
  75. PRIMARY KEY (`id`),
  76. UNIQUE KEY `remote_id` (`remote_id`)
  77. );
  78. -- TABLE: comments
  79. CREATE TABLE IF NOT EXISTS `bx_videos_cmts` (
  80. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  81. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  82. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  83. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  84. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  85. `cmt_level` int(11) NOT NULL DEFAULT '0',
  86. `cmt_text` text NOT NULL,
  87. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  88. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  89. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  90. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  91. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  92. PRIMARY KEY (`cmt_id`),
  93. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  94. FULLTEXT KEY `search_fields` (`cmt_text`)
  95. );
  96. -- TABLE: votes
  97. CREATE TABLE IF NOT EXISTS `bx_videos_votes` (
  98. `object_id` int(11) NOT NULL default '0',
  99. `count` int(11) NOT NULL default '0',
  100. `sum` int(11) NOT NULL default '0',
  101. UNIQUE KEY `object_id` (`object_id`)
  102. );
  103. CREATE TABLE IF NOT EXISTS `bx_videos_votes_track` (
  104. `id` int(11) NOT NULL AUTO_INCREMENT,
  105. `object_id` int(11) NOT NULL default '0',
  106. `author_id` int(11) NOT NULL default '0',
  107. `author_nip` int(11) unsigned NOT NULL default '0',
  108. `value` tinyint(4) NOT NULL default '0',
  109. `date` int(11) NOT NULL default '0',
  110. PRIMARY KEY (`id`),
  111. KEY `vote` (`object_id`, `author_nip`)
  112. );
  113. CREATE TABLE IF NOT EXISTS `bx_videos_svotes` (
  114. `object_id` int(11) NOT NULL default '0',
  115. `count` int(11) NOT NULL default '0',
  116. `sum` int(11) NOT NULL default '0',
  117. UNIQUE KEY `object_id` (`object_id`)
  118. );
  119. CREATE TABLE IF NOT EXISTS `bx_videos_svotes_track` (
  120. `id` int(11) NOT NULL AUTO_INCREMENT,
  121. `object_id` int(11) NOT NULL default '0',
  122. `author_id` int(11) NOT NULL default '0',
  123. `author_nip` int(11) unsigned NOT NULL default '0',
  124. `value` tinyint(4) NOT NULL default '0',
  125. `date` int(11) NOT NULL default '0',
  126. PRIMARY KEY (`id`),
  127. KEY `vote` (`object_id`, `author_nip`)
  128. );
  129. -- TABLE: views
  130. CREATE TABLE `bx_videos_views_track` (
  131. `object_id` int(11) NOT NULL default '0',
  132. `viewer_id` int(11) NOT NULL default '0',
  133. `viewer_nip` int(11) unsigned NOT NULL default '0',
  134. `date` int(11) NOT NULL default '0',
  135. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  136. );
  137. -- TABLE: metas
  138. CREATE TABLE `bx_videos_meta_keywords` (
  139. `object_id` int(10) unsigned NOT NULL,
  140. `keyword` varchar(255) NOT NULL,
  141. KEY `object_id` (`object_id`),
  142. KEY `keyword` (`keyword`)
  143. );
  144. CREATE TABLE `bx_videos_meta_locations` (
  145. `object_id` int(10) unsigned NOT NULL,
  146. `lat` double NOT NULL,
  147. `lng` double NOT NULL,
  148. `country` varchar(2) NOT NULL,
  149. `state` varchar(255) NOT NULL,
  150. `city` varchar(255) NOT NULL,
  151. `zip` varchar(255) NOT NULL,
  152. `street` varchar(255) NOT NULL,
  153. `street_number` varchar(255) NOT NULL,
  154. PRIMARY KEY (`object_id`),
  155. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  156. );
  157. CREATE TABLE `bx_videos_meta_mentions` (
  158. `object_id` int(10) unsigned NOT NULL,
  159. `profile_id` int(10) unsigned NOT NULL,
  160. KEY `object_id` (`object_id`),
  161. KEY `profile_id` (`profile_id`)
  162. );
  163. -- TABLE: reports
  164. CREATE TABLE IF NOT EXISTS `bx_videos_reports` (
  165. `object_id` int(11) NOT NULL default '0',
  166. `count` int(11) NOT NULL default '0',
  167. UNIQUE KEY `object_id` (`object_id`)
  168. );
  169. CREATE TABLE IF NOT EXISTS `bx_videos_reports_track` (
  170. `id` int(11) NOT NULL AUTO_INCREMENT,
  171. `object_id` int(11) NOT NULL default '0',
  172. `author_id` int(11) NOT NULL default '0',
  173. `author_nip` int(11) unsigned NOT NULL default '0',
  174. `type` varchar(32) NOT NULL default '',
  175. `text` text NOT NULL default '',
  176. `date` int(11) NOT NULL default '0',
  177. PRIMARY KEY (`id`),
  178. KEY `report` (`object_id`, `author_nip`)
  179. );
  180. -- TABLE: favorites
  181. CREATE TABLE `bx_videos_favorites_track` (
  182. `object_id` int(11) NOT NULL default '0',
  183. `author_id` int(11) NOT NULL default '0',
  184. `date` int(11) NOT NULL default '0',
  185. KEY `id` (`object_id`,`author_id`)
  186. );
  187. -- TABLE: scores
  188. CREATE TABLE IF NOT EXISTS `bx_videos_scores` (
  189. `object_id` int(11) NOT NULL default '0',
  190. `count_up` int(11) NOT NULL default '0',
  191. `count_down` int(11) NOT NULL default '0',
  192. UNIQUE KEY `object_id` (`object_id`)
  193. );
  194. CREATE TABLE IF NOT EXISTS `bx_videos_scores_track` (
  195. `id` int(11) NOT NULL AUTO_INCREMENT,
  196. `object_id` int(11) NOT NULL default '0',
  197. `author_id` int(11) NOT NULL default '0',
  198. `author_nip` int(11) unsigned NOT NULL default '0',
  199. `type` varchar(8) NOT NULL default '',
  200. `date` int(11) NOT NULL default '0',
  201. PRIMARY KEY (`id`),
  202. KEY `vote` (`object_id`, `author_nip`)
  203. );
  204. -- STORAGES & TRANSCODERS
  205. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  206. 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
  207. ('bx_videos_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_videos_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  208. ('bx_videos_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_videos_videos', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0),
  209. ('bx_videos_media_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_videos_media_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png,avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0);
  210. 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
  211. ('bx_videos_preview', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_photos";}', 'no', 1, 2592000, 0, '', ''),
  212. ('bx_videos_gallery', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_photos";}', 'no', 1, 2592000, 0, '', ''),
  213. ('bx_videos_cover', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_photos";}', 'no', 1, 2592000, 0, '', ''),
  214. ('bx_videos_poster', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_photos";}', 'no', 1, 2592000, 0, '', ''),
  215. ('bx_videos_video_poster_preview', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  216. ('bx_videos_video_poster_gallery', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  217. ('bx_videos_video_poster_cover', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  218. ('bx_videos_video_mp4', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''),
  219. ('bx_videos_video_mp4_hd', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', '');
  220. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  221. ('bx_videos_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
  222. ('bx_videos_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  223. ('bx_videos_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
  224. ('bx_videos_poster', 'Resize', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  225. ('bx_videos_video_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:13:"square_resize";s:1:"1";}', 10),
  226. ('bx_videos_video_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  227. ('bx_videos_video_poster_gallery', 'Poster', 'a:2:{s:1:"w";s:3:"500";s:10:"force_type";s:3:"jpg";}', 0),
  228. ('bx_videos_video_poster_cover', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  229. ('bx_videos_video_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"mp4";}', 0),
  230. ('bx_videos_video_mp4_hd', 'Mp4', 'a:2:{s:1:"h";s:3:"720";s:10:"force_type";s:3:"mp4";}', 0);
  231. -- FORMS
  232. 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
  233. ('bx_videos', 'bx_videos', '_bx_videos_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_videos_entries', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxVideosFormEntry', 'modules/boonex/videos/classes/BxVideosFormEntry.php');
  234. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  235. ('bx_videos', 'bx_videos_entry_add', 'bx_videos', 0, '_bx_videos_form_entry_display_add'),
  236. ('bx_videos', 'bx_videos_entry_delete', 'bx_videos', 0, '_bx_videos_form_entry_display_delete'),
  237. ('bx_videos', 'bx_videos_entry_edit', 'bx_videos', 0, '_bx_videos_form_entry_display_edit'),
  238. ('bx_videos', 'bx_videos_entry_view', 'bx_videos', 1, '_bx_videos_form_entry_display_view');
  239. 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
  240. ('bx_videos', 'bx_videos', 'allow_view_to', '', '', 0, 'custom', '_bx_videos_form_entry_input_sys_allow_view_to', '_bx_videos_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  241. ('bx_videos', 'bx_videos', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_videos_form_entry_input_sys_delete_confirm', '_bx_videos_form_entry_input_delete_confirm', '_bx_videos_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_videos_form_entry_input_delete_confirm_error', '', '', 1, 0),
  242. ('bx_videos', 'bx_videos', 'do_publish', '_bx_videos_form_entry_input_do_publish', '', 0, 'submit', '_bx_videos_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  243. ('bx_videos', 'bx_videos', 'do_submit', '_bx_videos_form_entry_input_do_submit', '', 0, 'submit', '_bx_videos_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  244. ('bx_videos', 'bx_videos', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  245. ('bx_videos', 'bx_videos', 'videos', 'a:1:{i:0;s:15:"bx_videos_html5";}', 'a:2:{s:16:"bx_videos_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_videos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_videos_form_entry_input_sys_videos', '_bx_videos_form_entry_input_videos', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_videos_form_entry_input_videos_error', '', '', 1, 0),
  246. ('bx_videos', 'bx_videos', 'pictures', 'a:1:{i:0;s:15:"bx_videos_html5";}', 'a:2:{s:16:"bx_videos_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_videos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_videos_form_entry_input_sys_pictures', '_bx_videos_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  247. ('bx_videos', 'bx_videos', 'text', '', '', 0, 'textarea', '_bx_videos_form_entry_input_sys_text', '_bx_videos_form_entry_input_text', '', 0, 0, 3, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
  248. ('bx_videos', 'bx_videos', 'title', '', '', 0, 'text', '_bx_videos_form_entry_input_sys_title', '_bx_videos_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_videos_form_entry_input_title_err', 'Xss', '', 1, 0),
  249. ('bx_videos', 'bx_videos', 'cat', '', '#!bx_videos_cats', 0, 'select', '_bx_videos_form_entry_input_sys_cat', '_bx_videos_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_videos_form_entry_input_cat_err', 'Xss', '', 1, 0),
  250. ('bx_videos', 'bx_videos', 'duration', '', '', 0, 'text', '_bx_videos_form_entry_input_sys_duration', '_bx_videos_form_entry_input_duration', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  251. ('bx_videos', 'bx_videos', 'added', '', '', 0, 'datetime', '_bx_videos_form_entry_input_sys_date_added', '_bx_videos_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  252. ('bx_videos', 'bx_videos', 'changed', '', '', 0, 'datetime', '_bx_videos_form_entry_input_sys_date_changed', '_bx_videos_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  253. ('bx_videos', 'bx_videos', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  254. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  255. ('bx_videos_entry_add', 'title', 2147483647, 1, 1),
  256. ('bx_videos_entry_add', 'cat', 2147483647, 1, 2),
  257. ('bx_videos_entry_add', 'text', 2147483647, 1, 3),
  258. ('bx_videos_entry_add', 'videos', 2147483647, 1, 4),
  259. ('bx_videos_entry_add', 'pictures', 2147483647, 1, 5),
  260. ('bx_videos_entry_add', 'allow_view_to', 2147483647, 1, 6),
  261. ('bx_videos_entry_add', 'location', 2147483647, 1, 7),
  262. ('bx_videos_entry_add', 'do_publish', 2147483647, 1, 8),
  263. ('bx_videos_entry_delete', 'delete_confirm', 2147483647, 1, 1),
  264. ('bx_videos_entry_delete', 'do_submit', 2147483647, 1, 2),
  265. ('bx_videos_entry_edit', 'title', 2147483647, 1, 1),
  266. ('bx_videos_entry_edit', 'cat', 2147483647, 1, 2),
  267. ('bx_videos_entry_edit', 'text', 2147483647, 1, 3),
  268. ('bx_videos_entry_edit', 'videos', 2147483647, 1, 4),
  269. ('bx_videos_entry_edit', 'pictures', 2147483647, 1, 5),
  270. ('bx_videos_entry_edit', 'allow_view_to', 2147483647, 1, 6),
  271. ('bx_videos_entry_edit', 'location', 2147483647, 1, 7),
  272. ('bx_videos_entry_edit', 'do_submit', 2147483647, 1, 8),
  273. ('bx_videos_entry_view', 'duration', 2147483647, 1, 1),
  274. ('bx_videos_entry_view', 'cat', 2147483647, 1, 2),
  275. ('bx_videos_entry_view', 'added', 2147483647, 1, 3),
  276. ('bx_videos_entry_view', 'changed', 2147483647, 1, 4);
  277. -- PRE-VALUES
  278. INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
  279. ('bx_videos_cats', '_bx_videos_pre_lists_cats', 'bx_videos', '0');
  280. INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
  281. ('bx_videos_cats', '', 0, '_sys_please_select', ''),
  282. ('bx_videos_cats', '1', 1, '_bx_videos_cat_animals_and_pets', ''),
  283. ('bx_videos_cats', '2', 2, '_bx_videos_cat_education', ''),
  284. ('bx_videos_cats', '3', 3, '_bx_videos_cat_entertainment', ''),
  285. ('bx_videos_cats', '4', 4, '_bx_videos_cat_film_and_animation', ''),
  286. ('bx_videos_cats', '5', 5, '_bx_videos_cat_music', ''),
  287. ('bx_videos_cats', '6', 6, '_bx_videos_cat_news', ''),
  288. ('bx_videos_cats', '7', 7, '_bx_videos_cat_people_and_blogs', ''),
  289. ('bx_videos_cats', '8', 8, '_bx_videos_cat_sports', ''),
  290. ('bx_videos_cats', '9', 9, '_bx_videos_cat_travel', '');
  291. -- COMMENTS
  292. 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
  293. ('bx_videos', 'bx_videos', 'bx_videos_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-video&id={object_id}', '', 'bx_videos_entries', 'id', 'author', 'title', 'comments', '', '');
  294. -- VOTES
  295. INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  296. ('bx_videos', 'bx_videos_votes', 'bx_videos_votes_track', '604800', '1', '1', '0', '1', 'bx_videos_entries', 'id', 'author', 'rate', 'votes', '', ''),
  297. ('bx_videos_stars', 'bx_videos_svotes', 'bx_videos_svotes_track', '604800', '1', '5', '0', '1', 'bx_videos_entries', 'id', 'author', 'srate', 'svotes', '', '');
  298. -- SCORES
  299. 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
  300. ('bx_videos', 'bx_videos', 'bx_videos_scores', 'bx_videos_scores_track', '604800', '0', 'bx_videos_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
  301. -- REPORTS
  302. INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  303. ('bx_videos', 'bx_videos_reports', 'bx_videos_reports_track', '1', 'page.php?i=view-video&id={object_id}', 'bx_videos_entries', 'id', 'author', 'reports', '', '');
  304. -- VIEWS
  305. INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  306. ('bx_videos', 'bx_videos_views_track', '86400', '1', 'bx_videos_entries', 'id', 'author', 'views', '', '');
  307. -- FAFORITES
  308. INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  309. ('bx_videos', 'bx_videos_favorites_track', '1', '1', '1', 'page.php?i=view-video&id={object_id}', 'bx_videos_entries', 'id', 'author', 'favorites', '', '');
  310. -- FEATURED
  311. INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES
  312. ('bx_videos', '1', '1', 'page.php?i=view-video&id={object_id}', 'bx_videos_entries', 'id', 'author', 'featured', '', '');
  313. -- CONTENT INFO
  314. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  315. ('bx_videos', '_bx_videos', 'bx_videos', 'added', 'edited', 'deleted', '', ''),
  316. ('bx_videos_cmts', '_bx_videos_cmts', 'bx_videos', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  317. INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
  318. ('bx_videos', 'bx_videos_administration', 'id', '', ''),
  319. ('bx_videos', 'bx_videos_common', 'id', '', '');
  320. -- SEARCH EXTENDED
  321. INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
  322. ('bx_videos', 'bx_videos', 'bx_videos', '_bx_videos_search_extended', 1, '', ''),
  323. ('bx_videos_cmts', 'bx_videos_cmts', 'bx_videos', '_bx_videos_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
  324. -- STUDIO: page & widget
  325. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  326. (3, 'bx_videos', '_bx_videos', '_bx_videos', 'bx_videos@modules/boonex/videos/|std-icon.svg');
  327. SET @iPageId = LAST_INSERT_ID();
  328. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  329. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  330. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  331. (@iPageId, 'bx_videos', '{url_studio}module.php?name=bx_videos', '', 'bx_videos@modules/boonex/videos/|std-icon.svg', '_bx_videos', '', '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";}');
  332. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  333. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));