install.sql 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  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. `system` tinyint(4) NOT NULL default '1',
  7. `type` varchar(255) NOT NULL,
  8. `action` varchar(255) NOT NULL,
  9. `object_id` int(11) NOT NULL default '0',
  10. `object_owner_id` int(11) NOT NULL default '0',
  11. `object_privacy_view` varchar(16) NOT NULL default '3',
  12. `object_cf` int(11) NOT NULL default '1',
  13. `content` text NOT NULL,
  14. `source` varchar(32) NOT NULL default '',
  15. `title` varchar(255) NOT NULL,
  16. `description` text NOT NULL,
  17. `location` text NOT NULL,
  18. `views` int(11) unsigned NOT NULL default '0',
  19. `rate` float NOT NULL default '0',
  20. `votes` int(11) unsigned NOT NULL default '0',
  21. `rrate` float NOT NULL default '0',
  22. `rvotes` int(11) NOT NULL default '0',
  23. `score` int(11) NOT NULL default '0',
  24. `sc_up` int(11) NOT NULL default '0',
  25. `sc_down` int(11) NOT NULL default '0',
  26. `comments` int(11) unsigned NOT NULL default '0',
  27. `reports` int(11) unsigned NOT NULL default '0',
  28. `reposts` int(11) unsigned NOT NULL default '0',
  29. `date` int(11) NOT NULL default '0',
  30. `published` int(11) NOT NULL default '0',
  31. `reacted` int(11) NOT NULL default '0',
  32. `status` enum ('active', 'awaiting', 'failed', 'hidden', 'deleted') NOT NULL DEFAULT 'active',
  33. `status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active',
  34. `active` tinyint(4) NOT NULL default '1',
  35. `pinned` int(11) NOT NULL default '0',
  36. `sticked` int(11) NOT NULL default '0',
  37. `promoted` int(11) NOT NULL default '0',
  38. PRIMARY KEY (`id`),
  39. KEY `owner_id` (`owner_id`),
  40. KEY `object_id` (`object_id`),
  41. FULLTEXT KEY `search_fields` (`title`, `description`)
  42. );
  43. CREATE TABLE IF NOT EXISTS `bx_timeline_events_slice` (
  44. `id` int(11) NOT NULL auto_increment,
  45. `owner_id` int(11) NOT NULL default '0',
  46. `system` tinyint(4) NOT NULL default '1',
  47. `type` varchar(255) NOT NULL,
  48. `action` varchar(255) NOT NULL,
  49. `object_id` int(11) NOT NULL default '0',
  50. `object_owner_id` int(11) NOT NULL default '0',
  51. `object_privacy_view` varchar(16) NOT NULL default '3',
  52. `object_cf` int(11) NOT NULL default '1',
  53. `content` text NOT NULL,
  54. `source` varchar(32) NOT NULL default '',
  55. `title` varchar(255) NOT NULL,
  56. `description` text NOT NULL,
  57. `location` text NOT NULL,
  58. `views` int(11) unsigned NOT NULL default '0',
  59. `rate` float NOT NULL default '0',
  60. `votes` int(11) unsigned NOT NULL default '0',
  61. `rrate` float NOT NULL default '0',
  62. `rvotes` int(11) NOT NULL default '0',
  63. `score` int(11) NOT NULL default '0',
  64. `sc_up` int(11) NOT NULL default '0',
  65. `sc_down` int(11) NOT NULL default '0',
  66. `comments` int(11) unsigned NOT NULL default '0',
  67. `reports` int(11) unsigned NOT NULL default '0',
  68. `reposts` int(11) unsigned NOT NULL default '0',
  69. `date` int(11) NOT NULL default '0',
  70. `published` int(11) NOT NULL default '0',
  71. `reacted` int(11) NOT NULL default '0',
  72. `status` enum ('active', 'awaiting', 'failed', 'hidden', 'deleted') NOT NULL DEFAULT 'active',
  73. `status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active',
  74. `active` tinyint(4) NOT NULL default '1',
  75. `pinned` int(11) NOT NULL default '0',
  76. `sticked` int(11) NOT NULL default '0',
  77. `promoted` int(11) NOT NULL default '0',
  78. PRIMARY KEY (`id`),
  79. KEY `owner_id` (`owner_id`),
  80. KEY `object_id` (`object_id`),
  81. FULLTEXT KEY `search_fields` (`title`, `description`)
  82. );
  83. CREATE TABLE IF NOT EXISTS `bx_timeline_events2users` (
  84. `id` int(11) NOT NULL auto_increment,
  85. `user_id` int(11) NOT NULL DEFAULT '0',
  86. `event_id` int(11) NOT NULL DEFAULT '0',
  87. PRIMARY KEY (`id`),
  88. UNIQUE `view` (`user_id`, `event_id`)
  89. );
  90. CREATE TABLE IF NOT EXISTS `bx_timeline_ef_photos` (
  91. `event_id` int(11) NOT NULL DEFAULT '0',
  92. PRIMARY KEY (`event_id`)
  93. );
  94. CREATE TABLE IF NOT EXISTS `bx_timeline_ef_videos` (
  95. `event_id` int(11) NOT NULL DEFAULT '0',
  96. PRIMARY KEY (`event_id`)
  97. );
  98. CREATE TABLE IF NOT EXISTS `bx_timeline_ef_files` (
  99. `event_id` int(11) NOT NULL DEFAULT '0',
  100. PRIMARY KEY (`event_id`)
  101. );
  102. CREATE TABLE IF NOT EXISTS `bx_timeline_handlers` (
  103. `id` int(11) NOT NULL auto_increment,
  104. `group` varchar(64) NOT NULL default '',
  105. `type` enum('insert','update','delete') NOT NULL DEFAULT 'insert',
  106. `alert_unit` varchar(64) NOT NULL default '',
  107. `alert_action` varchar(64) NOT NULL default '',
  108. `content` text NOT NULL,
  109. `privacy` varchar(64) NOT NULL default '',
  110. PRIMARY KEY (`id`),
  111. UNIQUE `alert` (`alert_unit`, `alert_action`)
  112. );
  113. INSERT INTO `bx_timeline_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  114. ('common_post', 'insert', 'timeline_common_post', '', ''),
  115. ('common_repost', 'insert', 'timeline_common_repost', '', ''),
  116. ('profile', 'delete', 'profile', 'delete', ''),
  117. ('comment', 'insert', 'comment', 'added', 'a:5:{s:11:"module_name";s:6:"system";s:13:"module_method";s:17:"get_timeline_post";s:12:"module_class";s:17:"TemplCmtsServices";s:9:"groupable";i:0;s:8:"group_by";s:0:"";}'),
  118. ('comment', 'update', 'comment', 'edited', ''),
  119. ('comment', 'delete', 'comment', 'deleted', '');
  120. -- TABLE: mute
  121. CREATE TABLE IF NOT EXISTS `bx_timeline_mute` (
  122. `id` int(11) NOT NULL AUTO_INCREMENT,
  123. `initiator` int(11) NOT NULL,
  124. `content` int(11) NOT NULL,
  125. `mutual` tinyint(4) NOT NULL,
  126. `added` int(10) unsigned NOT NULL,
  127. PRIMARY KEY (`id`),
  128. UNIQUE KEY `initiator` (`initiator`,`content`),
  129. KEY `content` (`content`)
  130. );
  131. -- TABLES: STORAGES, TRANSCODERS, UPLOADERS
  132. CREATE TABLE IF NOT EXISTS `bx_timeline_photos` (
  133. `id` int(11) NOT NULL AUTO_INCREMENT,
  134. `profile_id` int(10) unsigned NOT NULL,
  135. `remote_id` varchar(128) NOT NULL,
  136. `path` varchar(255) NOT NULL,
  137. `file_name` varchar(255) NOT NULL,
  138. `mime_type` varchar(128) NOT NULL,
  139. `ext` varchar(32) NOT NULL,
  140. `size` bigint(20) NOT NULL,
  141. `added` int(11) NOT NULL,
  142. `modified` int(11) NOT NULL,
  143. `private` int(11) NOT NULL,
  144. PRIMARY KEY (`id`),
  145. UNIQUE KEY `remote_id` (`remote_id`)
  146. );
  147. CREATE TABLE IF NOT EXISTS `bx_timeline_photos_processed` (
  148. `id` int(11) NOT NULL AUTO_INCREMENT,
  149. `profile_id` int(10) unsigned NOT NULL,
  150. `remote_id` varchar(128) NOT NULL,
  151. `path` varchar(255) NOT NULL,
  152. `file_name` varchar(255) NOT NULL,
  153. `mime_type` varchar(128) NOT NULL,
  154. `ext` varchar(32) NOT NULL,
  155. `size` bigint(20) NOT NULL,
  156. `added` int(11) NOT NULL,
  157. `modified` int(11) NOT NULL,
  158. `private` int(11) NOT NULL,
  159. PRIMARY KEY (`id`),
  160. UNIQUE KEY `remote_id` (`remote_id`)
  161. );
  162. CREATE TABLE IF NOT EXISTS `bx_timeline_photos2events` (
  163. `id` int(11) NOT NULL AUTO_INCREMENT,
  164. `event_id` int(11) NOT NULL DEFAULT '0',
  165. `media_id` int(11) NOT NULL DEFAULT '0',
  166. PRIMARY KEY (`id`),
  167. UNIQUE KEY `media` (`event_id`, `media_id`)
  168. );
  169. CREATE TABLE IF NOT EXISTS `bx_timeline_videos` (
  170. `id` int(11) NOT NULL AUTO_INCREMENT,
  171. `profile_id` int(10) unsigned NOT NULL,
  172. `remote_id` varchar(128) NOT NULL,
  173. `path` varchar(255) NOT NULL,
  174. `file_name` varchar(255) NOT NULL,
  175. `mime_type` varchar(128) NOT NULL,
  176. `ext` varchar(32) NOT NULL,
  177. `size` bigint(20) NOT NULL,
  178. `dimensions` varchar(12) NOT NULL,
  179. `added` int(11) NOT NULL,
  180. `modified` int(11) NOT NULL,
  181. `private` int(11) NOT NULL,
  182. PRIMARY KEY (`id`),
  183. UNIQUE KEY `remote_id` (`remote_id`)
  184. );
  185. CREATE TABLE IF NOT EXISTS `bx_timeline_videos_processed` (
  186. `id` int(11) NOT NULL AUTO_INCREMENT,
  187. `profile_id` int(10) unsigned NOT NULL,
  188. `remote_id` varchar(128) NOT NULL,
  189. `path` varchar(255) NOT NULL,
  190. `file_name` varchar(255) NOT NULL,
  191. `mime_type` varchar(128) NOT NULL,
  192. `ext` varchar(32) NOT NULL,
  193. `size` bigint(20) NOT NULL,
  194. `added` int(11) NOT NULL,
  195. `modified` int(11) NOT NULL,
  196. `private` int(11) NOT NULL,
  197. PRIMARY KEY (`id`),
  198. UNIQUE KEY `remote_id` (`remote_id`)
  199. );
  200. CREATE TABLE IF NOT EXISTS `bx_timeline_videos2events` (
  201. `id` int(11) NOT NULL AUTO_INCREMENT,
  202. `event_id` int(11) NOT NULL DEFAULT '0',
  203. `media_id` int(11) NOT NULL DEFAULT '0',
  204. PRIMARY KEY (`id`),
  205. UNIQUE KEY `media` (`event_id`, `media_id`)
  206. );
  207. CREATE TABLE IF NOT EXISTS `bx_timeline_files` (
  208. `id` int(11) NOT NULL AUTO_INCREMENT,
  209. `profile_id` int(10) unsigned NOT NULL,
  210. `remote_id` varchar(128) NOT NULL,
  211. `path` varchar(255) NOT NULL,
  212. `file_name` varchar(255) NOT NULL,
  213. `mime_type` varchar(128) NOT NULL,
  214. `ext` varchar(32) NOT NULL,
  215. `size` bigint(20) NOT NULL,
  216. `added` int(11) NOT NULL,
  217. `modified` int(11) NOT NULL,
  218. `private` int(11) NOT NULL,
  219. PRIMARY KEY (`id`),
  220. UNIQUE KEY `remote_id` (`remote_id`)
  221. );
  222. CREATE TABLE IF NOT EXISTS `bx_timeline_files2events` (
  223. `id` int(11) NOT NULL AUTO_INCREMENT,
  224. `event_id` int(11) NOT NULL DEFAULT '0',
  225. `media_id` int(11) NOT NULL DEFAULT '0',
  226. PRIMARY KEY (`id`),
  227. UNIQUE KEY `media` (`event_id`, `media_id`)
  228. );
  229. -- TABLES: LINKS
  230. CREATE TABLE IF NOT EXISTS `bx_timeline_links` (
  231. `id` int(11) NOT NULL AUTO_INCREMENT,
  232. `profile_id` int(10) unsigned NOT NULL,
  233. `media_id` int(11) NOT NULL DEFAULT '0',
  234. `url` varchar(255) NOT NULL,
  235. `title` varchar(255) NOT NULL,
  236. `text` text NOT NULL,
  237. `added` int(11) NOT NULL,
  238. PRIMARY KEY (`id`),
  239. KEY `profile_id` (`profile_id`)
  240. );
  241. CREATE TABLE IF NOT EXISTS `bx_timeline_links2events` (
  242. `id` int(11) NOT NULL AUTO_INCREMENT,
  243. `event_id` int(11) NOT NULL DEFAULT '0',
  244. `link_id` int(11) NOT NULL DEFAULT '0',
  245. PRIMARY KEY (`id`),
  246. UNIQUE KEY `link` (`link_id`, `event_id`)
  247. );
  248. -- TABLES: REPOSTS
  249. CREATE TABLE IF NOT EXISTS `bx_timeline_reposts_track` (
  250. `id` int(11) NOT NULL AUTO_INCREMENT,
  251. `event_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. `reposted_id` int(11) NOT NULL default '0',
  255. `date` int(11) NOT NULL default '0',
  256. `active` tinyint(4) NOT NULL default '1',
  257. PRIMARY KEY (`id`),
  258. UNIQUE KEY `event_id` (`event_id`),
  259. KEY `repost` (`reposted_id`, `author_nip`)
  260. );
  261. -- TABLES: COMMENTS
  262. CREATE TABLE IF NOT EXISTS `bx_timeline_comments` (
  263. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  264. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  265. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  266. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  267. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  268. `cmt_level` int(11) NOT NULL DEFAULT '0',
  269. `cmt_text` text NOT NULL,
  270. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  271. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  272. `cmt_pinned` int(11) NOT NULL default '0',
  273. `cmt_cf` int(11) NOT NULL default '1',
  274. PRIMARY KEY (`cmt_id`),
  275. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  276. FULLTEXT KEY `search_fields` (`cmt_text`)
  277. );
  278. CREATE TABLE IF NOT EXISTS `bx_timeline_cmts_notes` (
  279. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  280. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  281. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  282. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  283. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  284. `cmt_level` int(11) NOT NULL DEFAULT '0',
  285. `cmt_text` text NOT NULL,
  286. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  287. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  288. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  289. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  290. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  291. `cmt_pinned` int(11) NOT NULL default '0',
  292. PRIMARY KEY (`cmt_id`),
  293. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  294. FULLTEXT KEY `search_fields` (`cmt_text`)
  295. );
  296. -- TABLE: views
  297. CREATE TABLE IF NOT EXISTS `bx_timeline_views_track` (
  298. `id` int(11) NOT NULL AUTO_INCREMENT,
  299. `object_id` int(11) NOT NULL default '0',
  300. `viewer_id` int(11) NOT NULL default '0',
  301. `viewer_nip` int(11) unsigned NOT NULL default '0',
  302. `date` int(11) NOT NULL default '0',
  303. PRIMARY KEY (`id`),
  304. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  305. );
  306. -- TABLES: VOTES
  307. CREATE TABLE IF NOT EXISTS `bx_timeline_votes` (
  308. `id` int(11) NOT NULL AUTO_INCREMENT,
  309. `object_id` int(11) NOT NULL default '0',
  310. `count` int(11) NOT NULL default '0',
  311. `sum` int(11) NOT NULL default '0',
  312. PRIMARY KEY (`id`),
  313. UNIQUE KEY `object_id` (`object_id`)
  314. );
  315. CREATE TABLE IF NOT EXISTS `bx_timeline_votes_track` (
  316. `id` int(11) NOT NULL AUTO_INCREMENT,
  317. `object_id` int(11) NOT NULL default '0',
  318. `author_id` int(11) NOT NULL default '0',
  319. `author_nip` int(11) unsigned NOT NULL default '0',
  320. `value` tinyint(4) NOT NULL default '0',
  321. `date` int(11) NOT NULL default '0',
  322. PRIMARY KEY (`id`),
  323. KEY `vote` (`object_id`, `author_nip`)
  324. );
  325. CREATE TABLE IF NOT EXISTS `bx_timeline_reactions` (
  326. `id` int(11) NOT NULL AUTO_INCREMENT,
  327. `object_id` int(11) NOT NULL default '0',
  328. `reaction` varchar(32) NOT NULL default '',
  329. `count` int(11) NOT NULL default '0',
  330. `sum` int(11) NOT NULL default '0',
  331. PRIMARY KEY (`id`),
  332. UNIQUE KEY `reaction` (`object_id`, `reaction`)
  333. );
  334. CREATE TABLE IF NOT EXISTS `bx_timeline_reactions_track` (
  335. `id` int(11) NOT NULL AUTO_INCREMENT,
  336. `object_id` int(11) NOT NULL default '0',
  337. `author_id` int(11) NOT NULL default '0',
  338. `author_nip` int(11) unsigned NOT NULL default '0',
  339. `reaction` varchar(32) NOT NULL default '',
  340. `value` tinyint(4) NOT NULL default '0',
  341. `date` int(11) NOT NULL default '0',
  342. PRIMARY KEY (`id`),
  343. KEY `vote` (`object_id`, `author_nip`)
  344. );
  345. -- TABLE: metas
  346. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_keywords` (
  347. `id` int(11) NOT NULL AUTO_INCREMENT,
  348. `object_id` int(10) unsigned NOT NULL,
  349. `keyword` varchar(255) NOT NULL,
  350. PRIMARY KEY (`id`),
  351. KEY `object_id` (`object_id`),
  352. KEY `keyword` (`keyword`)
  353. );
  354. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_locations` (
  355. `object_id` int(10) unsigned NOT NULL,
  356. `lat` double NOT NULL,
  357. `lng` double NOT NULL,
  358. `country` varchar(2) NOT NULL,
  359. `state` varchar(255) NOT NULL,
  360. `city` varchar(255) NOT NULL,
  361. `zip` varchar(255) NOT NULL,
  362. `street` varchar(255) NOT NULL,
  363. `street_number` varchar(255) NOT NULL,
  364. PRIMARY KEY (`object_id`),
  365. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  366. );
  367. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_mentions` (
  368. `id` int(11) NOT NULL AUTO_INCREMENT,
  369. `object_id` int(10) unsigned NOT NULL,
  370. `profile_id` int(10) unsigned NOT NULL,
  371. PRIMARY KEY (`id`),
  372. KEY `object_id` (`object_id`),
  373. KEY `profile_id` (`profile_id`)
  374. );
  375. -- TABLE: reports
  376. CREATE TABLE IF NOT EXISTS `bx_timeline_reports` (
  377. `id` int(11) NOT NULL AUTO_INCREMENT,
  378. `object_id` int(11) NOT NULL default '0',
  379. `count` int(11) NOT NULL default '0',
  380. PRIMARY KEY (`id`),
  381. UNIQUE KEY `object_id` (`object_id`)
  382. );
  383. CREATE TABLE IF NOT EXISTS `bx_timeline_reports_track` (
  384. `id` int(11) NOT NULL AUTO_INCREMENT,
  385. `object_id` int(11) NOT NULL default '0',
  386. `author_id` int(11) NOT NULL default '0',
  387. `author_nip` int(11) unsigned NOT NULL default '0',
  388. `type` varchar(32) NOT NULL default '',
  389. `text` text NOT NULL default '',
  390. `date` int(11) NOT NULL default '0',
  391. `checked_by` int(11) NOT NULL default '0',
  392. `status` tinyint(11) NOT NULL default '0',
  393. PRIMARY KEY (`id`),
  394. KEY `report` (`object_id`, `author_nip`)
  395. );
  396. -- TABLE: hot track
  397. CREATE TABLE IF NOT EXISTS `bx_timeline_hot_track` (
  398. `id` int(11) NOT NULL AUTO_INCREMENT,
  399. `event_id` int(11) NOT NULL default '0',
  400. `value` int(11) NOT NULL default '0',
  401. PRIMARY KEY (`id`),
  402. UNIQUE KEY `event_id` (`event_id`)
  403. );
  404. -- TABLE: scores
  405. CREATE TABLE IF NOT EXISTS `bx_timeline_scores` (
  406. `id` int(11) NOT NULL AUTO_INCREMENT,
  407. `object_id` int(11) NOT NULL default '0',
  408. `count_up` int(11) NOT NULL default '0',
  409. `count_down` int(11) NOT NULL default '0',
  410. PRIMARY KEY (`id`),
  411. UNIQUE KEY `object_id` (`object_id`)
  412. );
  413. CREATE TABLE IF NOT EXISTS `bx_timeline_scores_track` (
  414. `id` int(11) NOT NULL AUTO_INCREMENT,
  415. `object_id` int(11) NOT NULL default '0',
  416. `author_id` int(11) NOT NULL default '0',
  417. `author_nip` int(11) unsigned NOT NULL default '0',
  418. `type` varchar(8) NOT NULL default '',
  419. `date` int(11) NOT NULL default '0',
  420. PRIMARY KEY (`id`),
  421. KEY `vote` (`object_id`, `author_nip`)
  422. );
  423. -- STORAGES, TRANSCODERS, UPLOADERS
  424. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  425. INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
  426. ('bx_timeline_html5_photo', 1, 'BxTimelineUploaderHTML5Attach', 'modules/boonex/timeline/classes/BxTimelineUploaderHTML5Attach.php'),
  427. ('bx_timeline_html5_video', 1, 'BxTimelineUploaderHTML5Attach', 'modules/boonex/timeline/classes/BxTimelineUploaderHTML5Attach.php'),
  428. ('bx_timeline_record_video', 1, 'BxTimelineUploaderRecordVideoAttach', 'modules/boonex/timeline/classes/BxTimelineUploaderRecordVideoAttach.php'),
  429. ('bx_timeline_html5_file', 1, 'BxTimelineUploaderHTML5Attach', 'modules/boonex/timeline/classes/BxTimelineUploaderHTML5Attach.php');
  430. 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
  431. ('bx_timeline_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_photos', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0),
  432. ('bx_timeline_photos_processed', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_photos_processed', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0),
  433. ('bx_timeline_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_videos', 'allow-deny', '{imagevideo}', '', 0, 0, 0, 0, 0, 0),
  434. ('bx_timeline_videos_processed', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_videos_processed', 'allow-deny', '{imagevideo}', '', 0, 0, 0, 0, 0, 0),
  435. ('bx_timeline_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_files', 'deny-allow', '', 'jpg,jpeg,jpe,gif,png,{dangerous}', 0, 0, 0, 0, 0, 0);
  436. 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
  437. ('bx_timeline_photos_preview', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  438. ('bx_timeline_photos_view', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  439. ('bx_timeline_photos_medium', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  440. ('bx_timeline_photos_big', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  441. ('bx_timeline_videos_photo_preview', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '1', '2592000', '0', '', ''),
  442. ('bx_timeline_videos_photo_view', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '1', '2592000', '0', '', ''),
  443. ('bx_timeline_videos_photo_big', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '1', '2592000', '0', '', ''),
  444. ('bx_timeline_videos_poster_preview', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  445. ('bx_timeline_videos_poster_view', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  446. ('bx_timeline_videos_poster_big', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  447. ('bx_timeline_videos_mp4', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  448. ('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', ''),
  449. ('bx_timeline_proxy_preview', 'bx_timeline_videos_processed', 'Proxy', 'a:4:{s:6:"object";s:18:"bx_timeline_videos";s:5:"image";s:32:"bx_timeline_videos_photo_preview";s:12:"video_poster";s:33:"bx_timeline_videos_poster_preview";s:5:"video";a:4:{i:0;s:22:"bx_timeline_videos_mp4";i:1;s:25:"bx_timeline_videos_mp4_hd";i:2;s:30:"bx_timeline_videos_poster_view";i:3;s:29:"bx_timeline_videos_poster_big";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', ''),
  450. ('bx_timeline_proxy_view', 'bx_timeline_videos_processed', 'Proxy', 'a:4:{s:6:"object";s:18:"bx_timeline_videos";s:5:"image";s:29:"bx_timeline_videos_photo_view";s:12:"video_poster";s:30:"bx_timeline_videos_poster_view";s:5:"video";a:2:{i:0;s:22:"bx_timeline_videos_mp4";i:1;s:25:"bx_timeline_videos_mp4_hd";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', ''),
  451. ('bx_timeline_proxy_big', 'bx_timeline_videos_processed', 'Proxy', 'a:4:{s:6:"object";s:18:"bx_timeline_videos";s:5:"image";s:28:"bx_timeline_videos_photo_big";s:12:"video_poster";s:29:"bx_timeline_videos_poster_big";s:5:"video";a:2:{i:0;s:22:"bx_timeline_videos_mp4";i:1;s:25:"bx_timeline_videos_mp4_hd";}}', 'no', 0, 0, 0, 'BxDolTranscoderProxy', '');
  452. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  453. ('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'),
  454. ('bx_timeline_photos_view', 'Resize', 'a:1:{s:1:"w";s:3:"300";}', '0'),
  455. ('bx_timeline_photos_medium', 'Resize', 'a:1:{s:1:"w";s:3:"600";}', '0'),
  456. ('bx_timeline_photos_big', 'Resize', 'a:2:{s:1:"w";s:4:"1000";s:1:"h";s:4:"1000";}', '0'),
  457. ('bx_timeline_videos_photo_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"300";s:13:"square_resize";s:1:"1";}', '0'),
  458. ('bx_timeline_videos_photo_view', 'Resize', 'a:1:{s:1:"w";s:3:"480";}', '0'),
  459. ('bx_timeline_videos_photo_big', 'Resize', 'a:2:{s:1:"w";s:4:"1000";s:1:"h";s:4:"1000";}', '0'),
  460. ('bx_timeline_videos_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  461. ('bx_timeline_videos_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"300";s:13:"square_resize";s:1:"1";}', 10),
  462. ('bx_timeline_videos_poster_view', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  463. ('bx_timeline_videos_poster_big', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  464. ('bx_timeline_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
  465. ('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);
  466. -- Forms -> Post
  467. 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
  468. ('bx_timeline_post', @sName, '_bx_timeline_form_post', '', 'a:1:{s:8:"onsubmit";s:46:"return {js_object_post}.onFormPostSubmit(this)";}', 'tlb_do_submit', 'bx_timeline_events', 'id', '', '', '', 0, 1, 'BxTimelineFormPost', 'modules/boonex/timeline/classes/BxTimelineFormPost.php');
  469. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  470. ('bx_timeline_post_add', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add', 0),
  471. ('bx_timeline_post_add_public', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add_public', 0),
  472. ('bx_timeline_post_add_profile', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add_profile', 0),
  473. ('bx_timeline_post_edit', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_edit', 0),
  474. ('bx_timeline_post_view', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_view', 1);
  475. 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
  476. ('bx_timeline_post', @sName, 'type', 'post', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_type', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  477. ('bx_timeline_post', @sName, 'action', '', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_action', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  478. ('bx_timeline_post', @sName, 'owner_id', '0', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_owner_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  479. ('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),
  480. ('bx_timeline_post', @sName, 'anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  481. ('bx_timeline_post', @sName, 'date', '', '', 0, 'datetime', '_bx_timeline_form_post_input_sys_date', '_bx_timeline_form_post_input_date', '', 0, 0, 0, '', '', '', '', '', '', 'DateTimeTs', '', 1, 0),
  482. ('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, '', '', '', '', '', '', 'DateTimeTs', '', 1, 0),
  483. ('bx_timeline_post', @sName, 'object_cf', '1', '#!sys_content_filter', 0, 'select', '_sys_form_entry_input_sys_cf', '_sys_form_entry_input_cf', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  484. ('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),
  485. ('bx_timeline_post', @sName, 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  486. ('bx_timeline_post', @sName, 'link', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_link', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  487. ('bx_timeline_post', @sName, 'photo', 'a:1:{i:0;s:23:"bx_timeline_html5_photo";}', 'a:1:{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),
  488. ('bx_timeline_post', @sName, 'video', 'a:2:{i:0;s:23:"bx_timeline_html5_video";i:1;s:24:"bx_timeline_record_video";}', 'a:2:{s:23:"bx_timeline_html5_video";s:25:"_sys_uploader_html5_title";s:24:"bx_timeline_record_video";s:32:"_sys_uploader_record_video_title";}', 0, 'files', '_bx_timeline_form_post_input_sys_video', '_bx_timeline_form_post_input_video', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  489. ('bx_timeline_post', @sName, 'file', 'a:1:{i:0;s:22:"bx_timeline_html5_file";}', 'a:1:{s:22:"bx_timeline_html5_file";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_timeline_form_post_input_sys_files', '_bx_timeline_form_post_input_files', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  490. ('bx_timeline_post', @sName, 'attachments', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  491. ('bx_timeline_post', @sName, 'controls', '', 'tlb_do_submit,tlb_do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  492. ('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),
  493. ('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);
  494. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  495. ('bx_timeline_post_add', 'type', 2147483647, 1, 1),
  496. ('bx_timeline_post_add', 'action', 2147483647, 1, 2),
  497. ('bx_timeline_post_add', 'owner_id', 2147483647, 1, 3),
  498. ('bx_timeline_post_add', 'text', 2147483647, 1, 4),
  499. ('bx_timeline_post_add', 'attachments', 2147483647, 1, 5),
  500. ('bx_timeline_post_add', 'link', 2147483647, 1, 6),
  501. ('bx_timeline_post_add', 'photo', 2147483647, 1, 7),
  502. ('bx_timeline_post_add', 'video', 2147483647, 1, 8),
  503. ('bx_timeline_post_add', 'file', 2147483647, 1, 9),
  504. ('bx_timeline_post_add', 'object_privacy_view', 2147483647, 1, 10),
  505. ('bx_timeline_post_add', 'object_cf', 2147483647, 1, 11),
  506. ('bx_timeline_post_add', 'published', 192, 0, 12),
  507. ('bx_timeline_post_add', 'location', 2147483647, 1, 13),
  508. ('bx_timeline_post_add', 'tlb_do_submit', 2147483647, 1, 14),
  509. ('bx_timeline_post_add_public', 'type', 2147483647, 1, 1),
  510. ('bx_timeline_post_add_public', 'action', 2147483647, 1, 2),
  511. ('bx_timeline_post_add_public', 'owner_id', 2147483647, 1, 3),
  512. ('bx_timeline_post_add_public', 'text', 2147483647, 1, 4),
  513. ('bx_timeline_post_add_public', 'attachments', 2147483647, 1, 5),
  514. ('bx_timeline_post_add_public', 'link', 2147483647, 1, 6),
  515. ('bx_timeline_post_add_public', 'photo', 2147483647, 1, 7),
  516. ('bx_timeline_post_add_public', 'video', 2147483647, 1, 8),
  517. ('bx_timeline_post_add_public', 'file', 2147483647, 1, 9),
  518. ('bx_timeline_post_add_public', 'object_privacy_view', 2147483647, 1, 10),
  519. ('bx_timeline_post_add_public', 'object_cf', 2147483647, 1, 11),
  520. ('bx_timeline_post_add_public', 'published', 192, 0, 12),
  521. ('bx_timeline_post_add_public', 'location', 2147483647, 1, 13),
  522. ('bx_timeline_post_add_public', 'tlb_do_submit', 2147483647, 1, 14),
  523. ('bx_timeline_post_add_profile', 'type', 2147483647, 1, 1),
  524. ('bx_timeline_post_add_profile', 'action', 2147483647, 1, 2),
  525. ('bx_timeline_post_add_profile', 'owner_id', 2147483647, 1, 3),
  526. ('bx_timeline_post_add_profile', 'text', 2147483647, 1, 4),
  527. ('bx_timeline_post_add_profile', 'attachments', 2147483647, 1, 5),
  528. ('bx_timeline_post_add_profile', 'link', 2147483647, 1, 6),
  529. ('bx_timeline_post_add_profile', 'photo', 2147483647, 1, 7),
  530. ('bx_timeline_post_add_profile', 'video', 2147483647, 1, 8),
  531. ('bx_timeline_post_add_profile', 'file', 2147483647, 1, 9),
  532. ('bx_timeline_post_add_profile', 'object_privacy_view', 2147483647, 1, 10),
  533. ('bx_timeline_post_add_profile', 'object_cf', 2147483647, 1, 11),
  534. ('bx_timeline_post_add_profile', 'published', 192, 0, 12),
  535. ('bx_timeline_post_add_profile', 'location', 2147483647, 1, 13),
  536. ('bx_timeline_post_add_profile', 'tlb_do_submit', 2147483647, 1, 14),
  537. ('bx_timeline_post_edit', 'type', 2147483647, 1, 1),
  538. ('bx_timeline_post_edit', 'action', 2147483647, 1, 2),
  539. ('bx_timeline_post_edit', 'owner_id', 2147483647, 1, 3),
  540. ('bx_timeline_post_edit', 'text', 2147483647, 1, 4),
  541. ('bx_timeline_post_edit', 'attachments', 2147483647, 1, 5),
  542. ('bx_timeline_post_edit', 'link', 2147483647, 1, 6),
  543. ('bx_timeline_post_edit', 'photo', 2147483647, 1, 7),
  544. ('bx_timeline_post_edit', 'video', 2147483647, 1, 8),
  545. ('bx_timeline_post_edit', 'file', 2147483647, 1, 9),
  546. ('bx_timeline_post_edit', 'object_privacy_view', 2147483647, 1, 10),
  547. ('bx_timeline_post_edit', 'object_cf', 2147483647, 1, 11),
  548. ('bx_timeline_post_edit', 'published', 192, 0, 12),
  549. ('bx_timeline_post_edit', 'location', 2147483647, 1, 13),
  550. ('bx_timeline_post_edit', 'controls', 2147483647, 1, 14),
  551. ('bx_timeline_post_edit', 'tlb_do_submit', 2147483647, 1, 15),
  552. ('bx_timeline_post_edit', 'tlb_do_cancel', 2147483647, 1, 16);
  553. -- Forms -> Attach link
  554. 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
  555. ('bx_timeline_attach_link', @sName, '_bx_timeline_form_attach_link', '', '', 'do_submit', 'bx_timeline_links', 'id', '', '', '', 0, 1, '', '');
  556. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  557. ('bx_timeline_attach_link_add', @sName, 'bx_timeline_attach_link', '_bx_timeline_form_attach_link_display_add', 0);
  558. 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
  559. ('bx_timeline_attach_link', @sName, 'event_id', '0', '', 0, 'hidden', '_bx_timeline_form_attach_link_input_sys_event_id', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  560. ('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),
  561. ('bx_timeline_attach_link', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  562. ('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),
  563. ('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);
  564. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  565. ('bx_timeline_attach_link_add', 'event_id', 2147483647, 1, 1),
  566. ('bx_timeline_attach_link_add', 'url', 2147483647, 1, 2),
  567. ('bx_timeline_attach_link_add', 'controls', 2147483647, 1, 3),
  568. ('bx_timeline_attach_link_add', 'do_submit', 2147483647, 1, 4),
  569. ('bx_timeline_attach_link_add', 'do_cancel', 2147483647, 1, 5);
  570. -- Forms -> Repost To
  571. 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
  572. ('bx_timeline_repost', @sName, '_bx_timeline_form_repost', '', '', 'do_submit', '', '', '', '', '', 0, 1, 'BxTimelineFormRepost', 'modules/boonex/timeline/classes/BxTimelineFormRepost.php');
  573. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  574. ('bx_timeline_repost_with', @sName, 'bx_timeline_repost', '_bx_timeline_form_repost_display_with', 0),
  575. ('bx_timeline_repost_to', @sName, 'bx_timeline_repost', '_bx_timeline_form_repost_display_to', 0);
  576. 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
  577. ('bx_timeline_repost', @sName, 'reposter_id', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_reposter_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
  578. ('bx_timeline_repost', @sName, 'owner_id', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_owner_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
  579. ('bx_timeline_repost', @sName, 'type', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_type', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  580. ('bx_timeline_repost', @sName, 'action', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_action', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  581. ('bx_timeline_repost', @sName, 'object_id', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_object_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
  582. ('bx_timeline_repost', @sName, 'search', '', '', 0, 'custom', '_bx_timeline_form_repost_input_sys_search', '_bx_timeline_form_repost_input_search', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  583. ('bx_timeline_repost', @sName, 'list', '', '', 0, 'custom', '_bx_timeline_form_repost_input_sys_list', '_bx_timeline_form_repost_input_list', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  584. ('bx_timeline_repost', @sName, 'text', '', '', 0, 'textarea', '_bx_timeline_form_repost_input_sys_text', '_bx_timeline_form_repost_input_text', '', 0, 0, 0, 'a:1:{s:12:"autocomplete";s:3:"off";}', '', '', '', '', '', 'XssHtml', '', 1, 0),
  585. ('bx_timeline_repost', @sName, 'reposted', '', '', 0, 'custom', '_bx_timeline_form_repost_input_sys_reposted', '_bx_timeline_form_repost_input_reposted', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  586. ('bx_timeline_repost', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  587. ('bx_timeline_repost', @sName, 'do_submit', '_bx_timeline_form_repost_input_do_submit', '', 0, 'submit', '_bx_timeline_form_repost_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  588. ('bx_timeline_repost', @sName, 'do_cancel', '_bx_timeline_form_repost_input_do_cancel', '', 0, 'button', '_bx_timeline_form_repost_input_sys_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);
  589. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  590. ('bx_timeline_repost_with', 'reposter_id', 2147483647, 1, 1),
  591. ('bx_timeline_repost_with', 'owner_id', 2147483647, 1, 2),
  592. ('bx_timeline_repost_with', 'type', 2147483647, 1, 3),
  593. ('bx_timeline_repost_with', 'action', 2147483647, 1, 4),
  594. ('bx_timeline_repost_with', 'object_id', 2147483647, 1, 5),
  595. ('bx_timeline_repost_with', 'text', 2147483647, 1, 6),
  596. ('bx_timeline_repost_with', 'reposted', 2147483647, 1, 7),
  597. ('bx_timeline_repost_with', 'controls', 2147483647, 1, 8),
  598. ('bx_timeline_repost_with', 'do_submit', 2147483647, 1, 9),
  599. ('bx_timeline_repost_with', 'do_cancel', 2147483647, 1, 10),
  600. ('bx_timeline_repost_to', 'reposter_id', 2147483647, 1, 1),
  601. ('bx_timeline_repost_to', 'type', 2147483647, 1, 2),
  602. ('bx_timeline_repost_to', 'action', 2147483647, 1, 3),
  603. ('bx_timeline_repost_to', 'object_id', 2147483647, 1, 4),
  604. ('bx_timeline_repost_to', 'search', 2147483647, 1, 5),
  605. ('bx_timeline_repost_to', 'list', 2147483647, 1, 6),
  606. ('bx_timeline_repost_to', 'controls', 2147483647, 1, 7),
  607. ('bx_timeline_repost_to', 'do_submit', 2147483647, 1, 8),
  608. ('bx_timeline_repost_to', 'do_cancel', 2147483647, 1, 9);
  609. -- COMMENTS
  610. 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
  611. ('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', 'BxTimelineCmts', 'modules/boonex/timeline/classes/BxTimelineCmts.php'),
  612. ('bx_timeline_notes', 'bx_timeline', 'bx_timeline_cmts_notes', 1, 5000, 1000, 0, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-post&id={object_id}', '', 'bx_timeline_events', 'id', 'object_owner_id', 'title', '', 'BxTemplCmtsNotes', '');
  613. -- VIEWS
  614. INSERT INTO `sys_objects_view` (`name`, `module`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  615. ('bx_timeline', 'bx_timeline', 'bx_timeline_views_track', '86400', '1', 'bx_timeline_events', 'id', 'object_id', 'views', '', '');
  616. -- VOTES
  617. INSERT INTO `sys_objects_vote`(`Name`, `Module`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  618. ('bx_timeline', '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'),
  619. ('bx_timeline_reactions', 'bx_timeline', 'bx_timeline_reactions', 'bx_timeline_reactions_track', '604800', '1', '1', '1', '1', 'bx_timeline_events', 'id', 'object_id', 'rrate', 'rvotes', 'BxTemplVoteReactions', '');
  620. -- SCORES
  621. 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
  622. ('bx_timeline', 'bx_timeline', 'bx_timeline_scores', 'bx_timeline_scores_track', '604800', '0', 'bx_timeline_events', 'id', 'object_id', 'score', 'sc_up', 'sc_down', '', '');
  623. -- REPORTS
  624. 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
  625. ('bx_timeline', 'bx_timeline', 'bx_timeline_reports', 'bx_timeline_reports_track', '1', 'page.php?i=item&id={object_id}', 'bx_timeline_notes', 'bx_timeline_events', 'id', 'owner_id', 'reports', 'BxTimelineReport', 'modules/boonex/timeline/classes/BxTimelineReport.php');
  626. -- CONTENT INFO
  627. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  628. ('bx_timeline', '_bx_timeline', 'bx_timeline', 'post_common', '', 'delete', '', ''),
  629. ('bx_timeline_cmts', '_bx_timeline_cmts', 'bx_timeline', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  630. -- STUDIO PAGE & WIDGET
  631. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  632. (3, 'bx_timeline', '_bx_timeline', '_bx_timeline', 'bx_timeline@modules/boonex/timeline/|std-icon.svg');
  633. SET @iPageId = LAST_INSERT_ID();
  634. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  635. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  636. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  637. (@iPageId, 'bx_timeline', 'extensions', '{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";}');
  638. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  639. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));