install.sql 28 KB

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