install.sql 24 KB

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