install.sql 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. SET @sName = 'bx_timeline';
  2. -- TABLES
  3. CREATE TABLE IF NOT EXISTS `bx_timeline_events` (
  4. `id` int(11) NOT NULL auto_increment,
  5. `owner_id` int(11) NOT NULL default '0',
  6. `type` varchar(255) NOT NULL,
  7. `action` varchar(255) NOT NULL,
  8. `object_id` int(11) NOT NULL default '0',
  9. `object_privacy_view` varchar(16) NOT NULL default '3',
  10. `content` text NOT NULL,
  11. `title` varchar(255) NOT NULL,
  12. `description` text NOT NULL,
  13. `views` int(11) unsigned NOT NULL default '0',
  14. `rate` float NOT NULL default '0',
  15. `votes` int(11) unsigned 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. `comments` int(11) unsigned NOT NULL default '0',
  22. `reports` int(11) unsigned NOT NULL default '0',
  23. `reposts` int(11) unsigned NOT NULL default '0',
  24. `date` int(11) NOT NULL default '0',
  25. `published` int(11) NOT NULL default '0',
  26. `status` enum ('active', 'awaiting', 'failed', 'hidden', 'deleted') NOT NULL DEFAULT 'active',
  27. `active` tinyint(4) NOT NULL default '1',
  28. `pinned` int(11) NOT NULL default '0',
  29. `sticked` int(11) NOT NULL default '0',
  30. `promoted` int(11) NOT NULL default '0',
  31. PRIMARY KEY (`id`),
  32. KEY `owner_id` (`owner_id`),
  33. KEY `object_id` (`object_id`),
  34. FULLTEXT KEY `search_fields` (`title`, `description`)
  35. );
  36. CREATE TABLE IF NOT EXISTS `bx_timeline_handlers` (
  37. `id` int(11) NOT NULL auto_increment,
  38. `group` varchar(64) NOT NULL default '',
  39. `type` enum('insert','update','delete') NOT NULL DEFAULT 'insert',
  40. `alert_unit` varchar(64) NOT NULL default '',
  41. `alert_action` varchar(64) NOT NULL default '',
  42. `content` text NOT NULL,
  43. `privacy` varchar(64) NOT NULL default '',
  44. PRIMARY KEY (`id`),
  45. UNIQUE `handler` (`group`, `type`),
  46. UNIQUE `alert` (`alert_unit`, `alert_action`)
  47. );
  48. INSERT INTO `bx_timeline_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  49. ('common_post', 'insert', 'timeline_common_post', '', ''),
  50. ('common_repost', 'insert', 'timeline_common_repost', '', ''),
  51. ('profile', 'delete', 'profile', 'delete', '');
  52. CREATE TABLE IF NOT EXISTS `bx_timeline_cache` (
  53. `type` varchar(32) NOT NULL default '',
  54. `context_id` int(11) NOT NULL default '0',
  55. `profile_id` int(11) NOT NULL default '0',
  56. `event_id` int(11) NOT NULL default '0',
  57. `date` int(11) NOT NULL default '0',
  58. PRIMARY KEY `item` (`type`, `context_id`, `profile_id`, `event_id`)
  59. );
  60. -- TABLES: STORAGES, TRANSCODERS, UPLOADERS
  61. CREATE TABLE IF NOT EXISTS `bx_timeline_photos` (
  62. `id` int(11) NOT NULL AUTO_INCREMENT,
  63. `profile_id` int(10) unsigned NOT NULL,
  64. `remote_id` varchar(128) NOT NULL,
  65. `path` varchar(255) NOT NULL,
  66. `file_name` varchar(255) NOT NULL,
  67. `mime_type` varchar(128) NOT NULL,
  68. `ext` varchar(32) NOT NULL,
  69. `size` int(11) NOT NULL,
  70. `added` int(11) NOT NULL,
  71. `modified` int(11) NOT NULL,
  72. `private` int(11) NOT NULL,
  73. PRIMARY KEY (`id`),
  74. UNIQUE KEY `remote_id` (`remote_id`)
  75. );
  76. CREATE TABLE IF NOT EXISTS `bx_timeline_photos_processed` (
  77. `id` int(11) NOT NULL AUTO_INCREMENT,
  78. `profile_id` int(10) unsigned NOT NULL,
  79. `remote_id` varchar(128) NOT NULL,
  80. `path` varchar(255) NOT NULL,
  81. `file_name` varchar(255) NOT NULL,
  82. `mime_type` varchar(128) NOT NULL,
  83. `ext` varchar(32) NOT NULL,
  84. `size` int(11) NOT NULL,
  85. `added` int(11) NOT NULL,
  86. `modified` int(11) NOT NULL,
  87. `private` int(11) NOT NULL,
  88. PRIMARY KEY (`id`),
  89. UNIQUE KEY `remote_id` (`remote_id`)
  90. );
  91. CREATE TABLE IF NOT EXISTS `bx_timeline_photos2events` (
  92. `id` int(11) NOT NULL AUTO_INCREMENT,
  93. `event_id` int(11) NOT NULL DEFAULT '0',
  94. `media_id` int(11) NOT NULL DEFAULT '0',
  95. PRIMARY KEY (`id`),
  96. UNIQUE KEY `media` (`event_id`, `media_id`)
  97. );
  98. CREATE TABLE IF NOT EXISTS `bx_timeline_videos` (
  99. `id` int(11) NOT NULL AUTO_INCREMENT,
  100. `profile_id` int(10) unsigned NOT NULL,
  101. `remote_id` varchar(128) NOT NULL,
  102. `path` varchar(255) NOT NULL,
  103. `file_name` varchar(255) NOT NULL,
  104. `mime_type` varchar(128) NOT NULL,
  105. `ext` varchar(32) NOT NULL,
  106. `size` int(11) NOT NULL,
  107. `added` int(11) NOT NULL,
  108. `modified` int(11) NOT NULL,
  109. `private` int(11) NOT NULL,
  110. PRIMARY KEY (`id`),
  111. UNIQUE KEY `remote_id` (`remote_id`)
  112. );
  113. CREATE TABLE IF NOT EXISTS `bx_timeline_videos_processed` (
  114. `id` int(11) NOT NULL AUTO_INCREMENT,
  115. `profile_id` int(10) unsigned NOT NULL,
  116. `remote_id` varchar(128) NOT NULL,
  117. `path` varchar(255) NOT NULL,
  118. `file_name` varchar(255) NOT NULL,
  119. `mime_type` varchar(128) NOT NULL,
  120. `ext` varchar(32) NOT NULL,
  121. `size` int(11) NOT NULL,
  122. `added` int(11) NOT NULL,
  123. `modified` int(11) NOT NULL,
  124. `private` int(11) NOT NULL,
  125. PRIMARY KEY (`id`),
  126. UNIQUE KEY `remote_id` (`remote_id`)
  127. );
  128. CREATE TABLE IF NOT EXISTS `bx_timeline_videos2events` (
  129. `id` int(11) NOT NULL AUTO_INCREMENT,
  130. `event_id` int(11) NOT NULL DEFAULT '0',
  131. `media_id` int(11) NOT NULL DEFAULT '0',
  132. PRIMARY KEY (`id`),
  133. UNIQUE KEY `media` (`event_id`, `media_id`)
  134. );
  135. -- TABLES: LINKS
  136. CREATE TABLE IF NOT EXISTS `bx_timeline_links` (
  137. `id` int(11) NOT NULL AUTO_INCREMENT,
  138. `profile_id` int(10) unsigned NOT NULL,
  139. `media_id` int(11) NOT NULL DEFAULT '0',
  140. `url` varchar(255) NOT NULL,
  141. `title` varchar(255) NOT NULL,
  142. `text` text NOT NULL,
  143. `added` int(11) NOT NULL,
  144. PRIMARY KEY (`id`),
  145. KEY `profile_id` (`profile_id`)
  146. );
  147. CREATE TABLE IF NOT EXISTS `bx_timeline_links2events` (
  148. `id` int(11) NOT NULL AUTO_INCREMENT,
  149. `event_id` int(11) NOT NULL DEFAULT '0',
  150. `link_id` int(11) NOT NULL DEFAULT '0',
  151. PRIMARY KEY (`id`),
  152. UNIQUE KEY `link` (`link_id`, `event_id`)
  153. );
  154. -- TABLES: REPOSTS
  155. CREATE TABLE IF NOT EXISTS `bx_timeline_reposts_track` (
  156. `event_id` int(11) NOT NULL default '0',
  157. `author_id` int(11) NOT NULL default '0',
  158. `author_nip` int(11) unsigned NOT NULL default '0',
  159. `reposted_id` int(11) NOT NULL default '0',
  160. `date` int(11) NOT NULL default '0',
  161. UNIQUE KEY `event_id` (`event_id`),
  162. KEY `repost` (`reposted_id`, `author_nip`)
  163. );
  164. -- TABLES: COMMENTS
  165. CREATE TABLE IF NOT EXISTS `bx_timeline_comments` (
  166. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  167. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  168. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  169. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  170. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  171. `cmt_level` int(11) NOT NULL DEFAULT '0',
  172. `cmt_text` text NOT NULL,
  173. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  174. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  175. PRIMARY KEY (`cmt_id`),
  176. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  177. FULLTEXT KEY `search_fields` (`cmt_text`)
  178. );
  179. -- TABLE: views
  180. CREATE TABLE IF NOT EXISTS `bx_timeline_views_track` (
  181. `object_id` int(11) NOT NULL default '0',
  182. `viewer_id` int(11) NOT NULL default '0',
  183. `viewer_nip` int(11) unsigned NOT NULL default '0',
  184. `date` int(11) NOT NULL default '0',
  185. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  186. );
  187. -- TABLES: VOTES
  188. CREATE TABLE IF NOT EXISTS `bx_timeline_votes` (
  189. `object_id` int(11) NOT NULL default '0',
  190. `count` int(11) NOT NULL default '0',
  191. `sum` int(11) NOT NULL default '0',
  192. UNIQUE KEY `object_id` (`object_id`)
  193. );
  194. CREATE TABLE IF NOT EXISTS `bx_timeline_votes_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. `value` tinyint(4) NOT NULL default '0',
  200. `date` int(11) NOT NULL default '0',
  201. PRIMARY KEY (`id`),
  202. KEY `vote` (`object_id`, `author_nip`)
  203. );
  204. CREATE TABLE IF NOT EXISTS `bx_timeline_reactions` (
  205. `object_id` int(11) NOT NULL default '0',
  206. `reaction` varchar(32) NOT NULL default '',
  207. `count` int(11) NOT NULL default '0',
  208. `sum` int(11) NOT NULL default '0',
  209. UNIQUE KEY `reaction` (`object_id`, `reaction`)
  210. );
  211. CREATE TABLE IF NOT EXISTS `bx_timeline_reactions_track` (
  212. `id` int(11) NOT NULL AUTO_INCREMENT,
  213. `object_id` int(11) NOT NULL default '0',
  214. `author_id` int(11) NOT NULL default '0',
  215. `author_nip` int(11) unsigned NOT NULL default '0',
  216. `reaction` varchar(32) NOT NULL default '',
  217. `value` tinyint(4) NOT NULL default '0',
  218. `date` int(11) NOT NULL default '0',
  219. PRIMARY KEY (`id`),
  220. KEY `vote` (`object_id`, `author_nip`)
  221. );
  222. -- TABLE: metas
  223. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_keywords` (
  224. `object_id` int(10) unsigned NOT NULL,
  225. `keyword` varchar(255) NOT NULL,
  226. KEY `object_id` (`object_id`),
  227. KEY `keyword` (`keyword`)
  228. );
  229. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_locations` (
  230. `object_id` int(10) unsigned NOT NULL,
  231. `lat` double NOT NULL,
  232. `lng` double NOT NULL,
  233. `country` varchar(2) NOT NULL,
  234. `state` varchar(255) NOT NULL,
  235. `city` varchar(255) NOT NULL,
  236. `zip` varchar(255) NOT NULL,
  237. `street` varchar(255) NOT NULL,
  238. `street_number` varchar(255) NOT NULL,
  239. PRIMARY KEY (`object_id`),
  240. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  241. );
  242. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_mentions` (
  243. `object_id` int(10) unsigned NOT NULL,
  244. `profile_id` int(10) unsigned NOT NULL,
  245. KEY `object_id` (`object_id`),
  246. KEY `profile_id` (`profile_id`)
  247. );
  248. -- TABLE: reports
  249. CREATE TABLE IF NOT EXISTS `bx_timeline_reports` (
  250. `object_id` int(11) NOT NULL default '0',
  251. `count` int(11) NOT NULL default '0',
  252. UNIQUE KEY `object_id` (`object_id`)
  253. );
  254. CREATE TABLE IF NOT EXISTS `bx_timeline_reports_track` (
  255. `id` int(11) NOT NULL AUTO_INCREMENT,
  256. `object_id` int(11) NOT NULL default '0',
  257. `author_id` int(11) NOT NULL default '0',
  258. `author_nip` int(11) unsigned NOT NULL default '0',
  259. `type` varchar(32) NOT NULL default '',
  260. `text` text NOT NULL default '',
  261. `date` int(11) NOT NULL default '0',
  262. PRIMARY KEY (`id`),
  263. KEY `report` (`object_id`, `author_nip`)
  264. );
  265. -- TABLE: hot track
  266. CREATE TABLE IF NOT EXISTS `bx_timeline_hot_track` (
  267. `id` int(11) NOT NULL AUTO_INCREMENT,
  268. `event_id` int(11) NOT NULL default '0',
  269. `value` int(11) NOT NULL default '0',
  270. PRIMARY KEY (`id`),
  271. UNIQUE KEY `event_id` (`event_id`)
  272. );
  273. -- TABLE: scores
  274. CREATE TABLE IF NOT EXISTS `bx_timeline_scores` (
  275. `object_id` int(11) NOT NULL default '0',
  276. `count_up` int(11) NOT NULL default '0',
  277. `count_down` int(11) NOT NULL default '0',
  278. UNIQUE KEY `object_id` (`object_id`)
  279. );
  280. CREATE TABLE IF NOT EXISTS `bx_timeline_scores_track` (
  281. `id` int(11) NOT NULL AUTO_INCREMENT,
  282. `object_id` int(11) NOT NULL default '0',
  283. `author_id` int(11) NOT NULL default '0',
  284. `author_nip` int(11) unsigned NOT NULL default '0',
  285. `type` varchar(8) NOT NULL default '',
  286. `date` int(11) NOT NULL default '0',
  287. PRIMARY KEY (`id`),
  288. KEY `vote` (`object_id`, `author_nip`)
  289. );
  290. -- STORAGES, TRANSCODERS, UPLOADERS
  291. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  292. INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
  293. ('bx_timeline_simple_photo', 1, 'BxTimelineUploaderSimpleAttach', 'modules/boonex/timeline/classes/BxTimelineUploaderSimpleAttach.php'),
  294. ('bx_timeline_simple_video', 1, 'BxTimelineUploaderSimpleAttach', 'modules/boonex/timeline/classes/BxTimelineUploaderSimpleAttach.php'),
  295. ('bx_timeline_html5_photo', 1, 'BxTimelineUploaderHTML5Attach', 'modules/boonex/timeline/classes/BxTimelineUploaderHTML5Attach.php'),
  296. ('bx_timeline_html5_video', 1, 'BxTimelineUploaderHTML5Attach', 'modules/boonex/timeline/classes/BxTimelineUploaderHTML5Attach.php');
  297. 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
  298. ('bx_timeline_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  299. ('bx_timeline_photos_processed', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_photos_processed', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  300. ('bx_timeline_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_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),
  301. ('bx_timeline_videos_processed', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_videos_processed', '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);
  302. 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
  303. ('bx_timeline_photos_preview', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  304. ('bx_timeline_photos_view', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  305. ('bx_timeline_photos_medium', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  306. ('bx_timeline_photos_big', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  307. ('bx_timeline_videos_poster', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  308. ('bx_timeline_videos_mp4', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  309. ('bx_timeline_videos_mp4_hd', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', '');
  310. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  311. ('bx_timeline_photos_preview', 'Resize', 'a:3:{s:1:"w";s:3:"100";s:1:"h";s:3:"100";s:13:"square_resize";s:1:"1";}', '0'),
  312. ('bx_timeline_photos_view', 'Resize', 'a:1:{s:1:"w";s:3:"300";}', '0'),
  313. ('bx_timeline_photos_medium', 'Resize', 'a:1:{s:1:"w";s:3:"600";}', '0'),
  314. ('bx_timeline_photos_big', 'Resize', 'a:2:{s:1:"w";s:4:"1200";s:1:"h";s:4:"1200";}', '0'),
  315. ('bx_timeline_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
  316. ('bx_timeline_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
  317. ('bx_timeline_videos_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);
  318. -- Forms -> Post
  319. INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  320. ('bx_timeline_post', @sName, '_bx_timeline_form_post', '', '', 'tlb_do_submit', 'bx_timeline_events', 'id', '', '', '', 0, 1, 'BxTimelineFormPost', 'modules/boonex/timeline/classes/BxTimelineFormPost.php');
  321. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  322. ('bx_timeline_post_add', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add', 0),
  323. ('bx_timeline_post_add_public', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add_public', 0),
  324. ('bx_timeline_post_add_profile', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add_profile', 0),
  325. ('bx_timeline_post_edit', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_edit', 0);
  326. 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
  327. ('bx_timeline_post', @sName, 'type', 'post', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_type', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  328. ('bx_timeline_post', @sName, 'action', '', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_action', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  329. ('bx_timeline_post', @sName, 'owner_id', '0', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_owner_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  330. ('bx_timeline_post', @sName, 'text', '', '', 0, 'textarea', '_bx_timeline_form_post_input_sys_text', '_bx_timeline_form_post_input_text', '', 0, 0, 3, 'a:1:{s:12:"autocomplete";s:3:"off";}', '', '', '', '', '', 'XssHtml', '', 1, 0),
  331. ('bx_timeline_post', @sName, 'anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  332. ('bx_timeline_post', @sName, 'date', '', '', 0, 'datetime', '_bx_timeline_form_post_input_sys_date', '_bx_timeline_form_post_input_date', '', 0, 0, 0, '', '', '', '', '', '', 'DateTimeUtc', '', 1, 0),
  333. ('bx_timeline_post', @sName, 'published', '', '', 0, 'datetime', '_bx_timeline_form_post_input_sys_date_published', '_bx_timeline_form_post_input_date_published', '_bx_timeline_form_post_input_date_published_info', 0, 0, 0, '', '', '', '', '', '', 'DateTimeUtc', '', 1, 0),
  334. ('bx_timeline_post', @sName, 'object_privacy_view', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_object_privacy_view', '_bx_timeline_form_post_input_object_privacy_view', '', 1, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  335. ('bx_timeline_post', @sName, 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  336. ('bx_timeline_post', @sName, 'link', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_link', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  337. ('bx_timeline_post', @sName, 'photo', 'a:1:{i:0;s:23:"bx_timeline_html5_photo";}', 'a:2:{s:24:"bx_timeline_simple_photo";s:26:"_sys_uploader_simple_title";s:23:"bx_timeline_html5_photo";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_timeline_form_post_input_sys_photo', '_bx_timeline_form_post_input_photo', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  338. ('bx_timeline_post', @sName, 'video', 'a:1:{i:0;s:23:"bx_timeline_html5_video";}', 'a:2:{s:24:"bx_timeline_simple_video";s:26:"_sys_uploader_simple_title";s:23:"bx_timeline_html5_video";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_timeline_form_post_input_sys_video', '_bx_timeline_form_post_input_video', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  339. ('bx_timeline_post', @sName, 'attachments', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  340. ('bx_timeline_post', @sName, 'controls', '', 'tlb_do_submit,tlb_do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  341. ('bx_timeline_post', @sName, 'tlb_do_submit', '_bx_timeline_form_post_input_do_submit', '', 0, 'submit', '_bx_timeline_form_post_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  342. ('bx_timeline_post', @sName, 'tlb_do_cancel', '_bx_timeline_form_post_input_do_cancel', '', 0, 'button', '_bx_timeline_form_post_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:51:"{js_object_view}.editPostCancel(this, {content_id})";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
  343. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  344. ('bx_timeline_post_add', 'type', 2147483647, 1, 0),
  345. ('bx_timeline_post_add', 'action', 2147483647, 1, 1),
  346. ('bx_timeline_post_add', 'text', 2147483647, 1, 2),
  347. ('bx_timeline_post_add', 'attachments', 2147483647, 1, 3),
  348. ('bx_timeline_post_add', 'owner_id', 2147483647, 1, 4),
  349. ('bx_timeline_post_add', 'object_privacy_view', 2147483647, 1, 5),
  350. ('bx_timeline_post_add', 'published', 192, 1, 6),
  351. ('bx_timeline_post_add', 'location', 2147483647, 1, 7),
  352. ('bx_timeline_post_add', 'link', 2147483647, 1, 8),
  353. ('bx_timeline_post_add', 'photo', 2147483647, 1, 9),
  354. ('bx_timeline_post_add', 'video', 2147483647, 1, 10),
  355. ('bx_timeline_post_add', 'tlb_do_submit', 2147483647, 1, 11),
  356. ('bx_timeline_post_add_public', 'type', 2147483647, 1, 0),
  357. ('bx_timeline_post_add_public', 'action', 2147483647, 1, 1),
  358. ('bx_timeline_post_add_public', 'owner_id', 2147483647, 1, 2),
  359. ('bx_timeline_post_add_public', 'text', 2147483647, 1, 3),
  360. ('bx_timeline_post_add_public', 'attachments', 2147483647, 1, 4),
  361. ('bx_timeline_post_add_public', 'object_privacy_view', 2147483647, 1, 5),
  362. ('bx_timeline_post_add_public', 'published', 192, 1, 6),
  363. ('bx_timeline_post_add_public', 'location', 2147483647, 1, 7),
  364. ('bx_timeline_post_add_public', 'link', 2147483647, 1, 8),
  365. ('bx_timeline_post_add_public', 'photo', 2147483647, 1, 9),
  366. ('bx_timeline_post_add_public', 'video', 2147483647, 1, 10),
  367. ('bx_timeline_post_add_public', 'tlb_do_submit', 2147483647, 1, 11),
  368. ('bx_timeline_post_add_profile', 'type', 2147483647, 1, 0),
  369. ('bx_timeline_post_add_profile', 'action', 2147483647, 1, 1),
  370. ('bx_timeline_post_add_profile', 'owner_id', 2147483647, 1, 2),
  371. ('bx_timeline_post_add_profile', 'text', 2147483647, 1, 3),
  372. ('bx_timeline_post_add_profile', 'attachments', 2147483647, 1, 4),
  373. ('bx_timeline_post_add_profile', 'object_privacy_view', 2147483647, 1, 5),
  374. ('bx_timeline_post_add_profile', 'published', 192, 1, 6),
  375. ('bx_timeline_post_add_profile', 'location', 2147483647, 1, 7),
  376. ('bx_timeline_post_add_profile', 'link', 2147483647, 1, 8),
  377. ('bx_timeline_post_add_profile', 'photo', 2147483647, 1, 9),
  378. ('bx_timeline_post_add_profile', 'video', 2147483647, 1, 10),
  379. ('bx_timeline_post_add_profile', 'tlb_do_submit', 2147483647, 1, 11),
  380. ('bx_timeline_post_edit', 'type', 2147483647, 1, 1),
  381. ('bx_timeline_post_edit', 'action', 2147483647, 1, 2),
  382. ('bx_timeline_post_edit', 'owner_id', 2147483647, 1, 3),
  383. ('bx_timeline_post_edit', 'text', 2147483647, 1, 4),
  384. ('bx_timeline_post_edit', 'published', 192, 1, 5),
  385. ('bx_timeline_post_edit', 'location', 2147483647, 1, 6),
  386. ('bx_timeline_post_edit', 'controls', 2147483647, 1, 7),
  387. ('bx_timeline_post_edit', 'tlb_do_submit', 2147483647, 1, 8),
  388. ('bx_timeline_post_edit', 'tlb_do_cancel', 2147483647, 1, 9);
  389. -- Forms -> Attach link
  390. INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  391. ('bx_timeline_attach_link', @sName, '_bx_timeline_form_attach_link', '', '', 'do_submit', 'bx_timeline_links', 'id', '', '', '', 0, 1, '', '');
  392. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  393. ('bx_timeline_attach_link_add', @sName, 'bx_timeline_attach_link', '_bx_timeline_form_attach_link_display_add', 0);
  394. 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
  395. ('bx_timeline_attach_link', @sName, 'url', '', '', 0, 'text', '_bx_timeline_form_attach_link_input_sys_url', '_bx_timeline_form_attach_link_input_url', '', 0, 0, 0, '', '', '', 'Preg', 'a:1:{s:4:"preg";s:0:"";}', '_bx_timeline_form_attach_link_input_url_err', '', '', 0, 0),
  396. ('bx_timeline_attach_link', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  397. ('bx_timeline_attach_link', @sName, 'do_submit', '_bx_timeline_form_attach_link_input_do_submit', '', 0, 'submit', '_bx_timeline_form_attach_link_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  398. ('bx_timeline_attach_link', @sName, 'do_cancel', '_bx_timeline_form_attach_link_input_do_cancel', '', 0, 'button', '_bx_timeline_form_attach_link_input_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);
  399. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  400. ('bx_timeline_attach_link_add', 'url', 2147483647, 1, 1),
  401. ('bx_timeline_attach_link_add', 'controls', 2147483647, 1, 2),
  402. ('bx_timeline_attach_link_add', 'do_submit', 2147483647, 1, 3),
  403. ('bx_timeline_attach_link_add', 'do_cancel', 2147483647, 1, 4);
  404. -- COMMENTS
  405. 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
  406. ('bx_timeline', 'bx_timeline', 'bx_timeline_comments', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=item&id={object_id}', '', 'bx_timeline_events', 'id', 'object_id', 'title', 'comments', '', '');
  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_timeline', 'bx_timeline_views_track', '86400', '1', 'bx_timeline_events', 'id', 'object_id', 'views', '', '');
  410. -- VOTES
  411. INSERT INTO `sys_objects_vote`(`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  412. ('bx_timeline', 'bx_timeline_votes', 'bx_timeline_votes_track', '604800', '1', '1', '0', '1', 'bx_timeline_events', 'id', 'object_id', 'rate', 'votes', 'BxTimelineVoteLikes', 'modules/boonex/timeline/classes/BxTimelineVoteLikes.php'),
  413. ('bx_timeline_reactions', 'bx_timeline_reactions', 'bx_timeline_reactions_track', '604800', '1', '1', '1', '1', 'bx_timeline_events', 'id', 'object_id', 'rrate', 'rvotes', 'BxTemplVoteReactions', '');
  414. -- SCORES
  415. 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
  416. ('bx_timeline', 'bx_timeline', 'bx_timeline_scores', 'bx_timeline_scores_track', '604800', '0', 'bx_timeline_events', 'id', 'object_id', 'score', 'sc_up', 'sc_down', '', '');
  417. -- REPORTS
  418. 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
  419. ('bx_timeline', 'bx_timeline_reports', 'bx_timeline_reports_track', '1', 'page.php?i=item&id={object_id}', 'bx_timeline_events', 'id', 'owner_id', 'reports', 'BxTimelineReport', 'modules/boonex/timeline/classes/BxTimelineReport.php');
  420. -- CONTENT INFO
  421. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  422. ('bx_timeline', '_bx_timeline', 'bx_timeline', 'post_common', '', 'delete', '', ''),
  423. ('bx_timeline_cmts', '_bx_timeline_cmts', 'bx_timeline', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  424. -- STUDIO PAGE & WIDGET
  425. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  426. (3, 'bx_timeline', '_bx_timeline', '_bx_timeline', 'bx_timeline@modules/boonex/timeline/|std-icon.svg');
  427. SET @iPageId = LAST_INSERT_ID();
  428. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  429. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  430. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  431. (@iPageId, 'bx_timeline', '{url_studio}module.php?name=bx_timeline', '', 'bx_timeline@modules/boonex/timeline/|std-icon.svg', '_bx_timeline', '', '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";}');
  432. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  433. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));