1
0

install.sql 47 KB

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