install.sql 26 KB

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