install.sql 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. -- TABLE: entries
  2. CREATE TABLE IF NOT EXISTS `bx_directory_entries` (
  3. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  4. `author` int(11) NOT NULL,
  5. `added` int(11) NOT NULL,
  6. `changed` int(11) NOT NULL,
  7. `category` int(11) NOT NULL,
  8. `thumb` int(11) NOT NULL,
  9. `title` varchar(255) NOT NULL,
  10. `price` varchar(255) NOT NULL,
  11. `year` varchar(255) NOT NULL,
  12. `text` mediumtext NOT NULL,
  13. `views` int(11) NOT NULL default '0',
  14. `rate` float NOT NULL default '0',
  15. `votes` int(11) NOT NULL default '0',
  16. `rrate` float NOT NULL default '0',
  17. `rvotes` int(11) NOT NULL default '0',
  18. `score` int(11) NOT NULL default '0',
  19. `sc_up` int(11) NOT NULL default '0',
  20. `sc_down` int(11) NOT NULL default '0',
  21. `favorites` int(11) NOT NULL default '0',
  22. `comments` int(11) NOT NULL default '0',
  23. `reports` int(11) NOT NULL default '0',
  24. `featured` int(11) NOT NULL default '0',
  25. `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
  26. `status` enum('active','awaiting','hidden') NOT NULL DEFAULT 'active',
  27. `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
  28. PRIMARY KEY (`id`),
  29. FULLTEXT KEY `title_text` (`title`,`text`)
  30. );
  31. -- TABLE: types of categories
  32. CREATE TABLE IF NOT EXISTS `bx_directory_categories_types` (
  33. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  34. `name` varchar(64) NOT NULL DEFAULT '',
  35. `title` varchar(255) NOT NULL DEFAULT '',
  36. `display_add` varchar(255) NOT NULL DEFAULT '',
  37. `display_edit` varchar(255) NOT NULL DEFAULT '',
  38. `display_view` varchar(255) NOT NULL DEFAULT '',
  39. PRIMARY KEY (`id`),
  40. UNIQUE KEY `name` (`name`)
  41. );
  42. INSERT INTO `bx_directory_categories_types` (`id`, `name`, `title`, `display_add`, `display_edit`, `display_view`) VALUES
  43. (1, 'price', '_bx_directory_cat_type_price', 'bx_directory_entry_price_add', 'bx_directory_entry_price_edit', 'bx_directory_entry_price_view'),
  44. (2, 'price_year', '_bx_directory_cat_type_price_year', 'bx_directory_entry_price_year_add', 'bx_directory_entry_price_year_edit', 'bx_directory_entry_price_year_view');
  45. -- TABLE: categories
  46. CREATE TABLE IF NOT EXISTS `bx_directory_categories` (
  47. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  48. `parent_id` int(11) unsigned NOT NULL DEFAULT '0',
  49. `level` tinyint(11) unsigned NOT NULL DEFAULT '0',
  50. `type` int(11) NOT NULL DEFAULT '0',
  51. `name` varchar(64) NOT NULL DEFAULT '',
  52. `title` varchar(255) NOT NULL DEFAULT '',
  53. `text` text NOT NULL,
  54. `icon` varchar(255) NOT NULL DEFAULT '',
  55. `items` int(11) NOT NULL DEFAULT '0',
  56. `active` tinyint(4) NOT NULL DEFAULT '1',
  57. `order` int(11) NOT NULL DEFAULT '0',
  58. PRIMARY KEY (`id`),
  59. UNIQUE KEY `name` (`name`),
  60. FULLTEXT KEY `title_text` (`title`,`text`)
  61. );
  62. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  63. (0, 0, 1, 'job', '_bx_directory_cat_title_job', '', 'user-md', 1, 1);
  64. SET @iParentId = LAST_INSERT_ID();
  65. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  66. (@iParentId, 1, 1, 'job_finance', '_bx_directory_cat_title_accounting_finance', '', '', 1, 1),
  67. (@iParentId, 1, 1, 'job_education', '_bx_directory_cat_title_education_nonprofit', '', '', 1, 2),
  68. (@iParentId, 1, 1, 'job_legal', '_bx_directory_cat_title_government_legal', '', '', 1, 3),
  69. (@iParentId, 1, 1, 'job_programming', '_bx_directory_cat_title_programming_web_design', '', '', 1, 4);
  70. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  71. (0, 0, 2, 'music', '_bx_directory_cat_title_music', '', 'music', 1, 2);
  72. SET @iParentId = LAST_INSERT_ID();
  73. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  74. (@iParentId, 1, 2, 'music_isale', '_bx_directory_cat_title_instrument_sale', '', '', 1, 1),
  75. (@iParentId, 1, 2, 'music_iwanted', '_bx_directory_cat_title_instrument_wanted', '', '', 1, 2);
  76. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  77. (0, 0, 1, 'housing', '_bx_directory_cat_title_housing', '', 'home', 1, 3);
  78. SET @iParentId = LAST_INSERT_ID();
  79. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  80. (@iParentId, 1, 1, 'housing_apartments', '_bx_directory_cat_title_apartments_housing', '', '', 1, 1),
  81. (@iParentId, 1, 1, 'housing_office', '_bx_directory_cat_title_office_commercial', '', '', 1, 2),
  82. (@iParentId, 1, 1, 'housing_re_sale', '_bx_directory_cat_title_real_estate_sale', '', '', 1, 3),
  83. (@iParentId, 1, 1, 'housing_roommate', '_bx_directory_cat_title_roommate', '', '', 1, 4),
  84. (@iParentId, 1, 1, 'housing_temp_rental', '_bx_directory_cat_title_temporary_rental', '', '', 1, 5);
  85. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  86. (0, 0, 1, 'service', '_bx_directory_cat_title_service', '', 'wrench', 1, 4);
  87. SET @iParentId = LAST_INSERT_ID();
  88. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  89. (@iParentId, 1, 1, 'service_automotive', '_bx_directory_cat_title_automotive', '', '', 1, 1),
  90. (@iParentId, 1, 1, 'service_educational', '_bx_directory_cat_title_educational', '', '', 1, 2),
  91. (@iParentId, 1, 1, 'service_financial', '_bx_directory_cat_title_financial', '', '', 1, 3),
  92. (@iParentId, 1, 1, 'service_labor', '_bx_directory_cat_title_labor_move', '', '', 1, 4),
  93. (@iParentId, 1, 1, 'service_legal', '_bx_directory_cat_title_legal', '', '', 1, 5);
  94. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  95. (0, 0, 1, 'casting', '_bx_directory_cat_title_casting', '', 'eye', 1, 5);
  96. SET @iParentId = LAST_INSERT_ID();
  97. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  98. (@iParentId, 1, 1, 'casting_acting', '_bx_directory_cat_title_acting', '', '', 1, 1),
  99. (@iParentId, 1, 1, 'casting_dance', '_bx_directory_cat_title_dance', '', '', 1, 2),
  100. (@iParentId, 1, 1, 'casting_modeling', '_bx_directory_cat_title_modeling', '', '', 1, 3),
  101. (@iParentId, 1, 1, 'casting_musician', '_bx_directory_cat_title_musician', '', '', 1, 4),
  102. (@iParentId, 1, 1, 'casting_rshow', '_bx_directory_cat_title_reality_show', '', '', 1, 5);
  103. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  104. (0, 0, 2, 'personal', '_bx_directory_cat_title_personal', '', 'user', 1, 6);
  105. SET @iParentId = LAST_INSERT_ID();
  106. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  107. (@iParentId, 1, 2, 'personal_mw', '_bx_directory_cat_title_men_women', '', '', 1, 1),
  108. (@iParentId, 1, 2, 'personal_wm', '_bx_directory_cat_title_women_men', '', '', 1, 2),
  109. (@iParentId, 1, 2, 'personal_missed', '_bx_directory_cat_title_missed_connection', '', '', 1, 3);
  110. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  111. (0, 0, 2, 'sale', '_bx_directory_cat_title_sale', '', 'shopping-cart', 1, 7);
  112. SET @iParentId = LAST_INSERT_ID();
  113. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  114. (@iParentId, 1, 2, 'sale_barter', '_bx_directory_cat_title_barter', '', '', 1, 1),
  115. (@iParentId, 1, 2, 'sale_clothing', '_bx_directory_cat_title_clothing', '', '', 1, 1),
  116. (@iParentId, 1, 2, 'sale_collectible', '_bx_directory_cat_title_collectible', '', '', 1, 1);
  117. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  118. (0, 0, 2, 'sale_car', '_bx_directory_cat_title_sale_car', '', 'truck', 1, 8);
  119. SET @iParentId = LAST_INSERT_ID();
  120. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  121. (@iParentId, 1, 2, 'sale_car_part', '_bx_directory_cat_title_auto_part', '', '', 1, 1),
  122. (@iParentId, 1, 2, 'sale_car_auto', '_bx_directory_cat_title_auto_truck', '', '', 1, 2),
  123. (@iParentId, 1, 2, 'sale_car_motorcycle', '_bx_directory_cat_title_motorcycle', '', '', 1, 3);
  124. -- TABLE: storages & transcoders
  125. CREATE TABLE IF NOT EXISTS `bx_directory_covers` (
  126. `id` int(11) NOT NULL AUTO_INCREMENT,
  127. `profile_id` int(10) unsigned NOT NULL,
  128. `remote_id` varchar(128) NOT NULL,
  129. `path` varchar(255) NOT NULL,
  130. `file_name` varchar(255) NOT NULL,
  131. `mime_type` varchar(128) NOT NULL,
  132. `ext` varchar(32) NOT NULL,
  133. `size` int(11) NOT NULL,
  134. `added` int(11) NOT NULL,
  135. `modified` int(11) NOT NULL,
  136. `private` int(11) NOT NULL,
  137. PRIMARY KEY (`id`),
  138. UNIQUE KEY `remote_id` (`remote_id`)
  139. );
  140. CREATE TABLE IF NOT EXISTS `bx_directory_files` (
  141. `id` int(11) NOT NULL AUTO_INCREMENT,
  142. `profile_id` int(10) unsigned NOT NULL,
  143. `remote_id` varchar(128) NOT NULL,
  144. `path` varchar(255) NOT NULL,
  145. `file_name` varchar(255) NOT NULL,
  146. `mime_type` varchar(128) NOT NULL,
  147. `ext` varchar(32) NOT NULL,
  148. `size` int(11) NOT NULL,
  149. `added` int(11) NOT NULL,
  150. `modified` int(11) NOT NULL,
  151. `private` int(11) NOT NULL,
  152. PRIMARY KEY (`id`),
  153. UNIQUE KEY `remote_id` (`remote_id`)
  154. );
  155. CREATE TABLE IF NOT EXISTS `bx_directory_photos` (
  156. `id` int(11) NOT NULL AUTO_INCREMENT,
  157. `profile_id` int(10) unsigned NOT NULL,
  158. `remote_id` varchar(128) NOT NULL,
  159. `path` varchar(255) NOT NULL,
  160. `file_name` varchar(255) NOT NULL,
  161. `mime_type` varchar(128) NOT NULL,
  162. `ext` varchar(32) NOT NULL,
  163. `size` int(11) NOT NULL,
  164. `added` int(11) NOT NULL,
  165. `modified` int(11) NOT NULL,
  166. `private` int(11) NOT NULL,
  167. PRIMARY KEY (`id`),
  168. UNIQUE KEY `remote_id` (`remote_id`)
  169. );
  170. CREATE TABLE IF NOT EXISTS `bx_directory_photos_resized` (
  171. `id` int(11) NOT NULL AUTO_INCREMENT,
  172. `profile_id` int(10) unsigned NOT NULL,
  173. `remote_id` varchar(128) NOT NULL,
  174. `path` varchar(255) NOT NULL,
  175. `file_name` varchar(255) NOT NULL,
  176. `mime_type` varchar(128) NOT NULL,
  177. `ext` varchar(32) NOT NULL,
  178. `size` int(11) NOT NULL,
  179. `added` int(11) NOT NULL,
  180. `modified` int(11) NOT NULL,
  181. `private` int(11) NOT NULL,
  182. PRIMARY KEY (`id`),
  183. UNIQUE KEY `remote_id` (`remote_id`)
  184. );
  185. CREATE TABLE IF NOT EXISTS `bx_directory_videos` (
  186. `id` int(11) NOT NULL AUTO_INCREMENT,
  187. `profile_id` int(10) unsigned NOT NULL,
  188. `remote_id` varchar(128) NOT NULL,
  189. `path` varchar(255) NOT NULL,
  190. `file_name` varchar(255) NOT NULL,
  191. `mime_type` varchar(128) NOT NULL,
  192. `ext` varchar(32) NOT NULL,
  193. `size` int(11) NOT NULL,
  194. `added` int(11) NOT NULL,
  195. `modified` int(11) NOT NULL,
  196. `private` int(11) NOT NULL,
  197. PRIMARY KEY (`id`),
  198. UNIQUE KEY `remote_id` (`remote_id`)
  199. );
  200. CREATE TABLE IF NOT EXISTS `bx_directory_videos_resized` (
  201. `id` int(11) NOT NULL AUTO_INCREMENT,
  202. `profile_id` int(10) unsigned NOT NULL,
  203. `remote_id` varchar(128) NOT NULL,
  204. `path` varchar(255) NOT NULL,
  205. `file_name` varchar(255) NOT NULL,
  206. `mime_type` varchar(128) NOT NULL,
  207. `ext` varchar(32) NOT NULL,
  208. `size` int(11) NOT NULL,
  209. `added` int(11) NOT NULL,
  210. `modified` int(11) NOT NULL,
  211. `private` int(11) NOT NULL,
  212. PRIMARY KEY (`id`),
  213. UNIQUE KEY `remote_id` (`remote_id`)
  214. );
  215. -- TABLE: comments
  216. CREATE TABLE IF NOT EXISTS `bx_directory_cmts` (
  217. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  218. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  219. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  220. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  221. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  222. `cmt_level` int(11) NOT NULL DEFAULT '0',
  223. `cmt_text` text NOT NULL,
  224. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  225. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  226. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  227. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  228. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  229. PRIMARY KEY (`cmt_id`),
  230. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  231. FULLTEXT KEY `search_fields` (`cmt_text`)
  232. );
  233. -- TABLE: votes
  234. CREATE TABLE IF NOT EXISTS `bx_directory_votes` (
  235. `object_id` int(11) NOT NULL default '0',
  236. `count` int(11) NOT NULL default '0',
  237. `sum` int(11) NOT NULL default '0',
  238. UNIQUE KEY `object_id` (`object_id`)
  239. );
  240. CREATE TABLE IF NOT EXISTS `bx_directory_votes_track` (
  241. `id` int(11) NOT NULL AUTO_INCREMENT,
  242. `object_id` int(11) NOT NULL default '0',
  243. `author_id` int(11) NOT NULL default '0',
  244. `author_nip` int(11) unsigned NOT NULL default '0',
  245. `value` tinyint(4) NOT NULL default '0',
  246. `date` int(11) NOT NULL default '0',
  247. PRIMARY KEY (`id`),
  248. KEY `vote` (`object_id`, `author_nip`)
  249. );
  250. CREATE TABLE IF NOT EXISTS `bx_directory_reactions` (
  251. `object_id` int(11) NOT NULL default '0',
  252. `reaction` varchar(32) NOT NULL default '',
  253. `count` int(11) NOT NULL default '0',
  254. `sum` int(11) NOT NULL default '0',
  255. UNIQUE KEY `reaction` (`object_id`, `reaction`)
  256. );
  257. CREATE TABLE IF NOT EXISTS `bx_directory_reactions_track` (
  258. `id` int(11) NOT NULL AUTO_INCREMENT,
  259. `object_id` int(11) NOT NULL default '0',
  260. `author_id` int(11) NOT NULL default '0',
  261. `author_nip` int(11) unsigned NOT NULL default '0',
  262. `reaction` varchar(32) NOT NULL default '',
  263. `value` tinyint(4) NOT NULL default '0',
  264. `date` int(11) NOT NULL default '0',
  265. PRIMARY KEY (`id`),
  266. KEY `vote` (`object_id`, `author_nip`)
  267. );
  268. -- TABLE: views
  269. CREATE TABLE IF NOT EXISTS `bx_directory_views_track` (
  270. `object_id` int(11) NOT NULL default '0',
  271. `viewer_id` int(11) NOT NULL default '0',
  272. `viewer_nip` int(11) unsigned NOT NULL default '0',
  273. `date` int(11) NOT NULL default '0',
  274. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  275. );
  276. -- TABLE: metas
  277. CREATE TABLE IF NOT EXISTS `bx_directory_meta_keywords` (
  278. `object_id` int(10) unsigned NOT NULL,
  279. `keyword` varchar(255) NOT NULL,
  280. KEY `object_id` (`object_id`),
  281. KEY `keyword` (`keyword`)
  282. );
  283. CREATE TABLE IF NOT EXISTS `bx_directory_meta_mentions` (
  284. `object_id` int(10) unsigned NOT NULL,
  285. `profile_id` int(10) unsigned NOT NULL,
  286. KEY `object_id` (`object_id`),
  287. KEY `profile_id` (`profile_id`)
  288. );
  289. CREATE TABLE IF NOT EXISTS `bx_directory_meta_locations` (
  290. `object_id` int(10) unsigned NOT NULL,
  291. `lat` double NOT NULL,
  292. `lng` double NOT NULL,
  293. `country` varchar(2) NOT NULL,
  294. `state` varchar(255) NOT NULL,
  295. `city` varchar(255) NOT NULL,
  296. `zip` varchar(255) NOT NULL,
  297. `street` varchar(255) NOT NULL,
  298. `street_number` varchar(255) NOT NULL,
  299. PRIMARY KEY (`object_id`),
  300. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  301. );
  302. -- TABLE: reports
  303. CREATE TABLE IF NOT EXISTS `bx_directory_reports` (
  304. `object_id` int(11) NOT NULL default '0',
  305. `count` int(11) NOT NULL default '0',
  306. UNIQUE KEY `object_id` (`object_id`)
  307. );
  308. CREATE TABLE IF NOT EXISTS `bx_directory_reports_track` (
  309. `id` int(11) NOT NULL AUTO_INCREMENT,
  310. `object_id` int(11) NOT NULL default '0',
  311. `author_id` int(11) NOT NULL default '0',
  312. `author_nip` int(11) unsigned NOT NULL default '0',
  313. `type` varchar(32) NOT NULL default '',
  314. `text` text NOT NULL default '',
  315. `date` int(11) NOT NULL default '0',
  316. PRIMARY KEY (`id`),
  317. KEY `report` (`object_id`, `author_nip`)
  318. );
  319. -- TABLE: favorites
  320. CREATE TABLE IF NOT EXISTS `bx_directory_favorites_track` (
  321. `object_id` int(11) NOT NULL default '0',
  322. `author_id` int(11) NOT NULL default '0',
  323. `date` int(11) NOT NULL default '0',
  324. KEY `id` (`object_id`,`author_id`)
  325. );
  326. -- TABLE: scores
  327. CREATE TABLE IF NOT EXISTS `bx_directory_scores` (
  328. `object_id` int(11) NOT NULL default '0',
  329. `count_up` int(11) NOT NULL default '0',
  330. `count_down` int(11) NOT NULL default '0',
  331. UNIQUE KEY `object_id` (`object_id`)
  332. );
  333. CREATE TABLE IF NOT EXISTS `bx_directory_scores_track` (
  334. `id` int(11) NOT NULL AUTO_INCREMENT,
  335. `object_id` int(11) NOT NULL default '0',
  336. `author_id` int(11) NOT NULL default '0',
  337. `author_nip` int(11) unsigned NOT NULL default '0',
  338. `type` varchar(8) NOT NULL default '',
  339. `date` int(11) NOT NULL default '0',
  340. PRIMARY KEY (`id`),
  341. KEY `vote` (`object_id`, `author_nip`)
  342. );
  343. -- TABLE: polls
  344. CREATE TABLE IF NOT EXISTS `bx_directory_polls` (
  345. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  346. `author_id` int(11) NOT NULL default '0',
  347. `content_id` int(11) NOT NULL default '0',
  348. `text` text NOT NULL,
  349. PRIMARY KEY (`id`),
  350. FULLTEXT KEY `search_fields` (`text`)
  351. );
  352. CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers` (
  353. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  354. `poll_id` int(11) unsigned NOT NULL default '0',
  355. `title` varchar(255) NOT NULL,
  356. `rate` float NOT NULL default '0',
  357. `votes` int(11) NOT NULL default '0',
  358. `order` int(11) NOT NULL default '0',
  359. PRIMARY KEY (`id`),
  360. FULLTEXT KEY `title` (`title`)
  361. );
  362. CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers_votes` (
  363. `object_id` int(11) NOT NULL default '0',
  364. `count` int(11) NOT NULL default '0',
  365. `sum` int(11) NOT NULL default '0',
  366. UNIQUE KEY `object_id` (`object_id`)
  367. );
  368. CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers_votes_track` (
  369. `id` int(11) NOT NULL AUTO_INCREMENT,
  370. `object_id` int(11) NOT NULL default '0',
  371. `author_id` int(11) NOT NULL default '0',
  372. `author_nip` int(11) unsigned NOT NULL default '0',
  373. `value` tinyint(4) NOT NULL default '0',
  374. `date` int(11) NOT NULL default '0',
  375. PRIMARY KEY (`id`),
  376. KEY `vote` (`object_id`, `author_nip`)
  377. );
  378. -- STORAGES & TRANSCODERS
  379. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  380. 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
  381. ('bx_directory_covers', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_covers', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  382. ('bx_directory_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  383. ('bx_directory_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  384. ('bx_directory_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_videos', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0),
  385. ('bx_directory_videos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_videos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png,avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0),
  386. ('bx_directory_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_files', 'deny-allow', '', 'action,apk,app,bat,bin,cmd,com,command,cpl,csh,exe,gadget,inf,ins,inx,ipa,isu,job,jse,ksh,lnk,msc,msi,msp,mst,osx,out,paf,pif,prg,ps1,reg,rgs,run,sct,shb,shs,u3p,vb,vbe,vbs,vbscript,workflow,ws,wsf', 0, 0, 0, 0, 0, 0);
  387. 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
  388. ('bx_directory_preview', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
  389. ('bx_directory_gallery', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
  390. ('bx_directory_cover', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
  391. ('bx_directory_preview_photos', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_photos";}', 'no', '1', '2592000', '0', '', ''),
  392. ('bx_directory_gallery_photos', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_photos";}', 'no', '1', '2592000', '0', '', ''),
  393. ('bx_directory_videos_poster', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  394. ('bx_directory_videos_poster_preview', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  395. ('bx_directory_videos_mp4', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  396. ('bx_directory_videos_mp4_hd', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  397. ('bx_directory_preview_files', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:18:"bx_directory_files";}', 'no', '1', '2592000', '0', '', ''),
  398. ('bx_directory_gallery_files', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:18:"bx_directory_files";}', 'no', '1', '2592000', '0', '', '');
  399. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  400. ('bx_directory_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
  401. ('bx_directory_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  402. ('bx_directory_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
  403. ('bx_directory_preview_photos', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
  404. ('bx_directory_gallery_photos', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  405. ('bx_directory_videos_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:13:"square_resize";s:1:"1";}', 10),
  406. ('bx_directory_videos_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  407. ('bx_directory_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
  408. ('bx_directory_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
  409. ('bx_directory_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),
  410. ('bx_directory_preview_files', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
  411. ('bx_directory_gallery_files', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
  412. -- FORMS: category
  413. INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  414. ('bx_directory_category', 'bx_directory', '_bx_directory_form_category', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_directory_categories', 'id', '', '', 'a:1:{i:0;s:9:"do_submit";}', '', 0, 1, 'BxDirFormCategory', 'modules/boonex/directory/classes/BxDirFormCategory.php');
  415. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  416. ('bx_directory_category', 'bx_directory_category_add', 'bx_directory', 0, '_bx_directory_form_category_display_add'),
  417. ('bx_directory_category', 'bx_directory_category_delete', 'bx_directory', 0, '_bx_directory_form_category_display_delete'),
  418. ('bx_directory_category', 'bx_directory_category_edit', 'bx_directory', 0, '_bx_directory_form_category_display_edit');
  419. 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
  420. ('bx_directory_category', 'bx_directory', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_directory_form_category_input_sys_delete_confirm', '_bx_directory_form_category_input_delete_confirm', '_bx_directory_form_category_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_directory_form_category_input_delete_confirm_error', '', '', 1, 0),
  421. ('bx_directory_category', 'bx_directory', 'parent_id', '', '', 0, 'select', '_bx_directory_form_category_input_sys_parent_id', '_bx_directory_form_category_input_parent_id', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  422. ('bx_directory_category', 'bx_directory', 'title', '', '', 0, 'text_translatable', '_bx_directory_form_category_input_sys_title', '_bx_directory_form_category_input_title', '', 1, 0, 0, '', '', '', 'AvailTranslatable', 'a:1:{i:0;s:5:"title";}', '_bx_directory_form_category_input_title_err', 'Xss', '', 1, 0),
  423. ('bx_directory_category', 'bx_directory', 'text', '', '', 0, 'textarea_translatable', '_bx_directory_form_category_input_sys_text', '_bx_directory_form_category_input_text', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
  424. ('bx_directory_category', 'bx_directory', 'type', '', '', 0, 'select', '_bx_directory_form_category_input_sys_type', '_bx_directory_form_category_input_type', '_bx_directory_form_category_input_type_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_directory_form_category_input_type_err', 'Int', '', 0, 0),
  425. ('bx_directory_category', 'bx_directory', 'type_clone', 'on', '', 0, 'switcher', '_bx_directory_form_category_input_sys_type_clone', '_bx_directory_form_category_input_type_clone', '', 0, 0, 0, 'a:1:{s:8:"onchange";s:33:"oBxDirStudio.onChangeClone(this);";}', '', '', '', '', '', '', '', 0, 0),
  426. ('bx_directory_category', 'bx_directory', 'type_title', '', '', 0, 'text_translatable', '_bx_directory_form_category_input_sys_type_title', '_bx_directory_form_category_input_type_title', '', 0, 0, 0, 'a:1:{s:8:"disabled";s:8:"disabled";}', 'a:1:{s:5:"style";s:13:"display:none;";}', '', '', '', '', '', '', 0, 0),
  427. ('bx_directory_category', 'bx_directory', 'icon', '', '', 0, 'text', '_bx_directory_form_category_input_sys_icon', '_bx_directory_form_category_input_icon', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  428. ('bx_directory_category', 'bx_directory', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  429. ('bx_directory_category', 'bx_directory', 'do_submit', '_bx_directory_form_category_input_do_submit', '', 0, 'submit', '_bx_directory_form_category_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  430. ('bx_directory_category', 'bx_directory', 'do_cancel', '_bx_directory_form_category_input_do_cancel', '', 0, 'button', '_bx_directory_form_category_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";}', '', '', '', '', '', '', '', 1, 0);
  431. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  432. ('bx_directory_category_add', 'parent_id', 2147483647, 1, 1),
  433. ('bx_directory_category_add', 'type', 2147483647, 1, 2),
  434. ('bx_directory_category_add', 'type_clone', 2147483647, 1, 3),
  435. ('bx_directory_category_add', 'type_title', 2147483647, 1, 4),
  436. ('bx_directory_category_add', 'title', 2147483647, 1, 5),
  437. ('bx_directory_category_add', 'text', 2147483647, 1, 6),
  438. ('bx_directory_category_add', 'icon', 2147483647, 1, 7),
  439. ('bx_directory_category_add', 'controls', 2147483647, 1, 8),
  440. ('bx_directory_category_add', 'do_submit', 2147483647, 1, 9),
  441. ('bx_directory_category_add', 'do_cancel', 2147483647, 1, 10),
  442. ('bx_directory_category_delete', 'delete_confirm', 2147483647, 1, 1),
  443. ('bx_directory_category_delete', 'do_submit', 2147483647, 1, 2),
  444. ('bx_directory_category_edit', 'parent_id', 2147483647, 1, 1),
  445. ('bx_directory_category_edit', 'title', 2147483647, 1, 2),
  446. ('bx_directory_category_edit', 'text', 2147483647, 1, 3),
  447. ('bx_directory_category_edit', 'icon', 2147483647, 1, 4),
  448. ('bx_directory_category_edit', 'controls', 2147483647, 1, 5),
  449. ('bx_directory_category_edit', 'do_submit', 2147483647, 1, 6),
  450. ('bx_directory_category_edit', 'do_cancel', 2147483647, 1, 7);
  451. -- FORMS: entry (ad)
  452. INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  453. ('bx_directory', 'bx_directory', '_bx_directory_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_directory_entries', 'id', '', '', 'a:1:{i:0;s:9:"do_submit";}', '', 0, 1, 'BxDirFormEntry', 'modules/boonex/directory/classes/BxDirFormEntry.php');
  454. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  455. ('bx_directory', 'bx_directory_entry_add', 'bx_directory', 0, '_bx_directory_form_entry_display_add'),
  456. ('bx_directory', 'bx_directory_entry_delete', 'bx_directory', 0, '_bx_directory_form_entry_display_delete'),
  457. ('bx_directory', 'bx_directory_entry_price_add', 'bx_directory', 0, '_bx_directory_form_entry_price_display_add'),
  458. ('bx_directory', 'bx_directory_entry_price_edit', 'bx_directory', 0, '_bx_directory_form_entry_price_display_edit'),
  459. ('bx_directory', 'bx_directory_entry_price_view', 'bx_directory', 1, '_bx_directory_form_entry_price_display_view'),
  460. ('bx_directory', 'bx_directory_entry_price_year_add', 'bx_directory', 0, '_bx_directory_form_entry_price_year_display_add'),
  461. ('bx_directory', 'bx_directory_entry_price_year_edit', 'bx_directory', 0, '_bx_directory_form_entry_price_year_display_edit'),
  462. ('bx_directory', 'bx_directory_entry_price_year_view', 'bx_directory', 1, '_bx_directory_form_entry_price_year_display_view');
  463. 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
  464. ('bx_directory', 'bx_directory', 'allow_view_to', '', '', 0, 'custom', '_bx_directory_form_entry_input_sys_allow_view_to', '_bx_directory_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  465. ('bx_directory', 'bx_directory', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_directory_form_entry_input_sys_delete_confirm', '_bx_directory_form_entry_input_delete_confirm', '_bx_directory_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_directory_form_entry_input_delete_confirm_error', '', '', 1, 0),
  466. ('bx_directory', 'bx_directory', 'do_submit', '_bx_directory_form_entry_input_do_submit', '', 0, 'submit', '_bx_directory_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  467. ('bx_directory', 'bx_directory', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  468. ('bx_directory', 'bx_directory', 'covers', 'a:1:{i:0;s:18:"bx_directory_html5";}', 'a:2:{s:19:"bx_directory_simple";s:26:"_sys_uploader_simple_title";s:18:"bx_directory_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_directory_form_entry_input_sys_covers', '_bx_directory_form_entry_input_covers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  469. ('bx_directory', 'bx_directory', 'pictures', 'a:1:{i:0;s:25:"bx_directory_photos_html5";}', 'a:2:{s:26:"bx_directory_photos_simple";s:26:"_sys_uploader_simple_title";s:25:"bx_directory_photos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_directory_form_entry_input_sys_pictures', '_bx_directory_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  470. ('bx_directory', 'bx_directory', 'videos', 'a:1:{i:0;s:25:"bx_directory_videos_html5";}', 'a:2:{s:26:"bx_directory_videos_simple";s:26:"_sys_uploader_simple_title";s:25:"bx_directory_videos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_directory_form_entry_input_sys_videos', '_bx_directory_form_entry_input_videos', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  471. ('bx_directory', 'bx_directory', 'files', 'a:1:{i:0;s:24:"bx_directory_files_html5";}', 'a:2:{s:25:"bx_directory_files_simple";s:26:"_sys_uploader_simple_title";s:24:"bx_directory_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_directory_form_entry_input_sys_files', '_bx_directory_form_entry_input_files', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  472. ('bx_directory', 'bx_directory', 'polls', '', '', 0, 'custom', '_bx_directory_form_entry_input_sys_polls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  473. ('bx_directory', 'bx_directory', 'text', '', '', 0, 'textarea', '_bx_directory_form_entry_input_sys_text', '_bx_directory_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_directory_form_entry_input_text_err', 'XssHtml', '', 1, 0),
  474. ('bx_directory', 'bx_directory', 'title', '', '', 0, 'text', '_bx_directory_form_entry_input_sys_title', '_bx_directory_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_directory_form_entry_input_title_err', 'Xss', '', 1, 0),
  475. ('bx_directory', 'bx_directory', 'price', '', '', 0, 'text', '_bx_directory_form_entry_input_sys_price', '_bx_directory_form_entry_input_price', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  476. ('bx_directory', 'bx_directory', 'year', '', '', 0, 'text', '_bx_directory_form_entry_input_sys_year', '_bx_directory_form_entry_input_year', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  477. ('bx_directory', 'bx_directory', 'category', '', '', 0, 'hidden', '_bx_directory_form_entry_input_sys_category', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
  478. ('bx_directory', 'bx_directory', 'category_view', '', '', 0, 'text', '_bx_directory_form_entry_input_sys_category_view', '_bx_directory_form_entry_input_category_view', '', 0, 0, 0, 'a:1:{s:8:"disabled";s:8:"disabled";}', '', '', '', '', '', '', '', 1, 0),
  479. ('bx_directory', 'bx_directory', 'category_select', '', '', 0, 'select', '_bx_directory_form_entry_input_sys_category_select', '_bx_directory_form_entry_input_category_select', '', 1, 0, 0, 'a:1:{s:8:"onchange";s:35:"oBxDirEntry.onChangeCategory(this);";}', '', '', '', '', '', '', '', 0, 0),
  480. ('bx_directory', 'bx_directory', 'added', '', '', 0, 'datetime', '_bx_directory_form_entry_input_sys_date_added', '_bx_directory_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  481. ('bx_directory', 'bx_directory', 'changed', '', '', 0, 'datetime', '_bx_directory_form_entry_input_sys_date_changed', '_bx_directory_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  482. ('bx_directory', 'bx_directory', 'attachments', '', '', 0, 'custom', '_bx_directory_form_entry_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  483. ('bx_directory', 'bx_directory', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  484. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  485. ('bx_directory_entry_add', 'category_select', 2147483647, 1, 1),
  486. ('bx_directory_entry_delete', 'delete_confirm', 2147483647, 1, 1),
  487. ('bx_directory_entry_delete', 'do_submit', 2147483647, 1, 2),
  488. ('bx_directory_entry_price_add', 'category', 2147483647, 1, 1),
  489. ('bx_directory_entry_price_add', 'category_view', 2147483647, 1, 2),
  490. ('bx_directory_entry_price_add', 'title', 2147483647, 1, 3),
  491. ('bx_directory_entry_price_add', 'price', 2147483647, 1, 4),
  492. ('bx_directory_entry_price_add', 'text', 2147483647, 1, 5),
  493. ('bx_directory_entry_price_add', 'attachments', 2147483647, 1, 6),
  494. ('bx_directory_entry_price_add', 'pictures', 2147483647, 1, 7),
  495. ('bx_directory_entry_price_add', 'videos', 2147483647, 1, 8),
  496. ('bx_directory_entry_price_add', 'files', 2147483647, 1, 9),
  497. ('bx_directory_entry_price_add', 'polls', 2147483647, 1, 10),
  498. ('bx_directory_entry_price_add', 'covers', 2147483647, 1, 11),
  499. ('bx_directory_entry_price_add', 'allow_view_to', 2147483647, 1, 12),
  500. ('bx_directory_entry_price_add', 'location', 2147483647, 1, 13),
  501. ('bx_directory_entry_price_add', 'do_submit', 2147483647, 1, 14),
  502. ('bx_directory_entry_price_edit', 'category_view', 2147483647, 1, 1),
  503. ('bx_directory_entry_price_edit', 'title', 2147483647, 1, 2),
  504. ('bx_directory_entry_price_edit', 'price', 2147483647, 1, 3),
  505. ('bx_directory_entry_price_edit', 'text', 2147483647, 1, 4),
  506. ('bx_directory_entry_price_edit', 'attachments', 2147483647, 1, 5),
  507. ('bx_directory_entry_price_edit', 'pictures', 2147483647, 1, 6),
  508. ('bx_directory_entry_price_edit', 'videos', 2147483647, 1, 7),
  509. ('bx_directory_entry_price_edit', 'files', 2147483647, 1, 8),
  510. ('bx_directory_entry_price_edit', 'polls', 2147483647, 1, 9),
  511. ('bx_directory_entry_price_edit', 'covers', 2147483647, 1, 10),
  512. ('bx_directory_entry_price_edit', 'allow_view_to', 2147483647, 1, 11),
  513. ('bx_directory_entry_price_edit', 'location', 2147483647, 1, 12),
  514. ('bx_directory_entry_price_edit', 'do_submit', 2147483647, 1, 13),
  515. ('bx_directory_entry_price_view', 'category_view', 2147483647, 1, 1),
  516. ('bx_directory_entry_price_view', 'price', 2147483647, 1, 2),
  517. ('bx_directory_entry_price_view', 'added', 2147483647, 1, 3),
  518. ('bx_directory_entry_price_view', 'changed', 2147483647, 1, 4),
  519. ('bx_directory_entry_price_year_add', 'category', 2147483647, 1, 1),
  520. ('bx_directory_entry_price_year_add', 'category_view', 2147483647, 1, 2),
  521. ('bx_directory_entry_price_year_add', 'title', 2147483647, 1, 3),
  522. ('bx_directory_entry_price_year_add', 'price', 2147483647, 1, 4),
  523. ('bx_directory_entry_price_year_add', 'year', 2147483647, 1, 5),
  524. ('bx_directory_entry_price_year_add', 'text', 2147483647, 1, 6),
  525. ('bx_directory_entry_price_year_add', 'attachments', 2147483647, 1, 7),
  526. ('bx_directory_entry_price_year_add', 'pictures', 2147483647, 1, 8),
  527. ('bx_directory_entry_price_year_add', 'videos', 2147483647, 1, 9),
  528. ('bx_directory_entry_price_year_add', 'files', 2147483647, 1, 10),
  529. ('bx_directory_entry_price_year_add', 'polls', 2147483647, 1, 11),
  530. ('bx_directory_entry_price_year_add', 'covers', 2147483647, 1, 12),
  531. ('bx_directory_entry_price_year_add', 'allow_view_to', 2147483647, 1, 13),
  532. ('bx_directory_entry_price_year_add', 'location', 2147483647, 1, 14),
  533. ('bx_directory_entry_price_year_add', 'do_submit', 2147483647, 1, 15),
  534. ('bx_directory_entry_price_year_edit', 'category_view', 2147483647, 1, 1),
  535. ('bx_directory_entry_price_year_edit', 'title', 2147483647, 1, 2),
  536. ('bx_directory_entry_price_year_edit', 'price', 2147483647, 1, 3),
  537. ('bx_directory_entry_price_year_edit', 'year', 2147483647, 1, 4),
  538. ('bx_directory_entry_price_year_edit', 'text', 2147483647, 1, 5),
  539. ('bx_directory_entry_price_year_edit', 'attachments', 2147483647, 1, 6),
  540. ('bx_directory_entry_price_year_edit', 'pictures', 2147483647, 1, 7),
  541. ('bx_directory_entry_price_year_edit', 'videos', 2147483647, 1, 8),
  542. ('bx_directory_entry_price_year_edit', 'files', 2147483647, 1, 9),
  543. ('bx_directory_entry_price_year_edit', 'polls', 2147483647, 1, 10),
  544. ('bx_directory_entry_price_year_edit', 'covers', 2147483647, 1, 11),
  545. ('bx_directory_entry_price_year_edit', 'allow_view_to', 2147483647, 1, 12),
  546. ('bx_directory_entry_price_year_edit', 'location', 2147483647, 1, 13),
  547. ('bx_directory_entry_price_year_edit', 'do_submit', 2147483647, 1, 14),
  548. ('bx_directory_entry_price_year_view', 'category_view', 2147483647, 1, 1),
  549. ('bx_directory_entry_price_year_view', 'price', 2147483647, 1, 2),
  550. ('bx_directory_entry_price_year_view', 'year', 2147483647, 1, 3),
  551. ('bx_directory_entry_price_year_view', 'added', 2147483647, 1, 4),
  552. ('bx_directory_entry_price_year_view', 'changed', 2147483647, 1, 5);
  553. -- FORMS: poll
  554. INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  555. ('bx_directory_poll', 'bx_directory', '_bx_directory_form_poll', '', '', 'do_submit', 'bx_directory_polls', 'id', '', '', 'a:1:{s:14:"checker_helper";s:26:"BxDirFormPollCheckerHelper";}', 0, 1, 'BxDirFormPoll', 'modules/boonex/directory/classes/BxDirFormPoll.php');
  556. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  557. ('bx_directory_poll_add', 'bx_directory', 'bx_directory_poll', '_bx_directory_form_poll_display_add', 0);
  558. INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
  559. ('bx_directory_poll', 'bx_directory', 'text', '', '', 0, 'textarea', '_bx_directory_form_poll_input_sys_text', '_bx_directory_form_poll_input_text', '', 1, 0, 3, '', '', '', 'Avail', '', '_bx_directory_form_poll_input_text_err', 'Xss', '', 1, 0),
  560. ('bx_directory_poll', 'bx_directory', 'answers', '', '', 0, 'custom', '_bx_directory_form_poll_input_sys_answers', '_bx_directory_form_poll_input_answers', '', 1, 0, 0, '', '', '', 'AvailAnswers', '', '_bx_directory_form_poll_input_answers_err', '', '', 1, 0),
  561. ('bx_directory_poll', 'bx_directory', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  562. ('bx_directory_poll', 'bx_directory', 'do_submit', '_bx_directory_form_poll_input_do_submit', '', 0, 'submit', '_bx_directory_form_poll_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  563. ('bx_directory_poll', 'bx_directory', 'do_cancel', '_bx_directory_form_poll_input_do_cancel', '', 0, 'button', '_bx_directory_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);
  564. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  565. ('bx_directory_poll_add', 'text', 2147483647, 1, 1),
  566. ('bx_directory_poll_add', 'answers', 2147483647, 1, 2),
  567. ('bx_directory_poll_add', 'controls', 2147483647, 1, 3),
  568. ('bx_directory_poll_add', 'do_submit', 2147483647, 1, 4),
  569. ('bx_directory_poll_add', 'do_cancel', 2147483647, 1, 5);
  570. -- COMMENTS
  571. 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
  572. ('bx_directory', 'bx_directory', 'bx_directory_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-post&id={object_id}', '', 'bx_directory_entries', 'id', 'author', 'title', 'comments', '', '');
  573. -- VOTES
  574. INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  575. ('bx_directory', 'bx_directory_votes', 'bx_directory_votes_track', '604800', '1', '1', '0', '1', 'bx_directory_entries', 'id', 'author', 'rate', 'votes', '', ''),
  576. ('bx_directory_reactions', 'bx_directory_reactions', 'bx_directory_reactions_track', '604800', '1', '1', '1', '1', 'bx_directory_entries', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', ''),
  577. ('bx_directory_poll_answers', 'bx_directory_polls_answers_votes', 'bx_directory_polls_answers_votes_track', '604800', '1', '1', '0', '1', 'bx_directory_polls_answers', 'id', 'author_id', 'rate', 'votes', 'BxDirVotePollAnswers', 'modules/boonex/directory/classes/BxDirVotePollAnswers.php');
  578. -- SCORES
  579. 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
  580. ('bx_directory', 'bx_directory', 'bx_directory_scores', 'bx_directory_scores_track', '604800', '0', 'bx_directory_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
  581. -- REPORTS
  582. INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  583. ('bx_directory', 'bx_directory_reports', 'bx_directory_reports_track', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'reports', '', '');
  584. -- VIEWS
  585. INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  586. ('bx_directory', 'bx_directory_views_track', '86400', '1', 'bx_directory_entries', 'id', 'author', 'views', '', '');
  587. -- FAFORITES
  588. INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  589. ('bx_directory', 'bx_directory_favorites_track', '1', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'favorites', '', '');
  590. -- FEATURED
  591. INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES
  592. ('bx_directory', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'featured', '', '');
  593. -- CONTENT INFO
  594. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  595. ('bx_directory', '_bx_directory', 'bx_directory', 'added', 'edited', 'deleted', '', ''),
  596. ('bx_directory_cmts', '_bx_directory_cmts', 'bx_directory', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  597. INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
  598. ('bx_directory', 'bx_directory_administration', 'id', '', ''),
  599. ('bx_directory', 'bx_directory_common', 'id', '', '');
  600. -- SEARCH EXTENDED
  601. INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
  602. ('bx_directory', 'bx_directory', 'bx_directory', '_bx_directory_search_extended', 1, '', ''),
  603. ('bx_directory_cmts', 'bx_directory_cmts', 'bx_directory', '_bx_directory_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
  604. -- STUDIO: page & widget
  605. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  606. (3, 'bx_directory', '_bx_directory', '_bx_directory', 'bx_directory@modules/boonex/directory/|std-icon.svg');
  607. SET @iPageId = LAST_INSERT_ID();
  608. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  609. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  610. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  611. (@iPageId, 'bx_directory', '{url_studio}module.php?name=bx_directory', '', 'bx_directory@modules/boonex/directory/|std-icon.svg', '_bx_directory', '', '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";}');
  612. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  613. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));