install.sql 47 KB

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