install.sql 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  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. `reviews` int(11) NOT NULL default '0',
  24. `reviews_avg` float NOT NULL default '0',
  25. `reports` int(11) NOT NULL default '0',
  26. `featured` int(11) NOT NULL default '0',
  27. `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
  28. `status` enum('active','awaiting','hidden') NOT NULL DEFAULT 'active',
  29. `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
  30. PRIMARY KEY (`id`),
  31. FULLTEXT KEY `title_text` (`title`,`text`)
  32. );
  33. -- TABLE: types of categories
  34. CREATE TABLE IF NOT EXISTS `bx_directory_categories_types` (
  35. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  36. `name` varchar(64) NOT NULL DEFAULT '',
  37. `title` varchar(255) NOT NULL DEFAULT '',
  38. `display_add` varchar(255) NOT NULL DEFAULT '',
  39. `display_edit` varchar(255) NOT NULL DEFAULT '',
  40. `display_view` varchar(255) NOT NULL DEFAULT '',
  41. PRIMARY KEY (`id`),
  42. UNIQUE KEY `name` (`name`)
  43. );
  44. INSERT INTO `bx_directory_categories_types` (`id`, `name`, `title`, `display_add`, `display_edit`, `display_view`) VALUES
  45. (1, 'price', '_bx_directory_cat_type_price', 'bx_directory_entry_price_add', 'bx_directory_entry_price_edit', 'bx_directory_entry_price_view'),
  46. (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');
  47. -- TABLE: categories
  48. CREATE TABLE IF NOT EXISTS `bx_directory_categories` (
  49. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  50. `parent_id` int(11) unsigned NOT NULL DEFAULT '0',
  51. `level` tinyint(11) unsigned NOT NULL DEFAULT '0',
  52. `type` int(11) NOT NULL DEFAULT '0',
  53. `name` varchar(64) NOT NULL DEFAULT '',
  54. `title` varchar(255) NOT NULL DEFAULT '',
  55. `text` text NOT NULL,
  56. `icon` varchar(255) NOT NULL DEFAULT '',
  57. `items` int(11) NOT NULL DEFAULT '0',
  58. `active` tinyint(4) NOT NULL DEFAULT '1',
  59. `order` int(11) NOT NULL DEFAULT '0',
  60. PRIMARY KEY (`id`),
  61. UNIQUE KEY `name` (`name`),
  62. FULLTEXT KEY `title_text` (`title`,`text`)
  63. );
  64. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  65. (0, 0, 1, 'job', '_bx_directory_cat_title_job', '', 'user-md', 1, 1);
  66. SET @iParentId = LAST_INSERT_ID();
  67. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  68. (@iParentId, 1, 1, 'job_finance', '_bx_directory_cat_title_accounting_finance', '', '', 1, 1),
  69. (@iParentId, 1, 1, 'job_education', '_bx_directory_cat_title_education_nonprofit', '', '', 1, 2),
  70. (@iParentId, 1, 1, 'job_legal', '_bx_directory_cat_title_government_legal', '', '', 1, 3),
  71. (@iParentId, 1, 1, 'job_programming', '_bx_directory_cat_title_programming_web_design', '', '', 1, 4);
  72. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  73. (0, 0, 2, 'music', '_bx_directory_cat_title_music', '', 'music', 1, 2);
  74. SET @iParentId = LAST_INSERT_ID();
  75. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  76. (@iParentId, 1, 2, 'music_isale', '_bx_directory_cat_title_instrument_sale', '', '', 1, 1),
  77. (@iParentId, 1, 2, 'music_iwanted', '_bx_directory_cat_title_instrument_wanted', '', '', 1, 2);
  78. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  79. (0, 0, 1, 'housing', '_bx_directory_cat_title_housing', '', 'home', 1, 3);
  80. SET @iParentId = LAST_INSERT_ID();
  81. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  82. (@iParentId, 1, 1, 'housing_apartments', '_bx_directory_cat_title_apartments_housing', '', '', 1, 1),
  83. (@iParentId, 1, 1, 'housing_office', '_bx_directory_cat_title_office_commercial', '', '', 1, 2),
  84. (@iParentId, 1, 1, 'housing_re_sale', '_bx_directory_cat_title_real_estate_sale', '', '', 1, 3),
  85. (@iParentId, 1, 1, 'housing_roommate', '_bx_directory_cat_title_roommate', '', '', 1, 4),
  86. (@iParentId, 1, 1, 'housing_temp_rental', '_bx_directory_cat_title_temporary_rental', '', '', 1, 5);
  87. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  88. (0, 0, 1, 'service', '_bx_directory_cat_title_service', '', 'wrench', 1, 4);
  89. SET @iParentId = LAST_INSERT_ID();
  90. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  91. (@iParentId, 1, 1, 'service_automotive', '_bx_directory_cat_title_automotive', '', '', 1, 1),
  92. (@iParentId, 1, 1, 'service_educational', '_bx_directory_cat_title_educational', '', '', 1, 2),
  93. (@iParentId, 1, 1, 'service_financial', '_bx_directory_cat_title_financial', '', '', 1, 3),
  94. (@iParentId, 1, 1, 'service_labor', '_bx_directory_cat_title_labor_move', '', '', 1, 4),
  95. (@iParentId, 1, 1, 'service_legal', '_bx_directory_cat_title_legal', '', '', 1, 5);
  96. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  97. (0, 0, 1, 'casting', '_bx_directory_cat_title_casting', '', 'eye', 1, 5);
  98. SET @iParentId = LAST_INSERT_ID();
  99. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  100. (@iParentId, 1, 1, 'casting_acting', '_bx_directory_cat_title_acting', '', '', 1, 1),
  101. (@iParentId, 1, 1, 'casting_dance', '_bx_directory_cat_title_dance', '', '', 1, 2),
  102. (@iParentId, 1, 1, 'casting_modeling', '_bx_directory_cat_title_modeling', '', '', 1, 3),
  103. (@iParentId, 1, 1, 'casting_musician', '_bx_directory_cat_title_musician', '', '', 1, 4),
  104. (@iParentId, 1, 1, 'casting_rshow', '_bx_directory_cat_title_reality_show', '', '', 1, 5);
  105. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  106. (0, 0, 2, 'personal', '_bx_directory_cat_title_personal', '', 'user', 1, 6);
  107. SET @iParentId = LAST_INSERT_ID();
  108. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  109. (@iParentId, 1, 2, 'personal_mw', '_bx_directory_cat_title_men_women', '', '', 1, 1),
  110. (@iParentId, 1, 2, 'personal_wm', '_bx_directory_cat_title_women_men', '', '', 1, 2),
  111. (@iParentId, 1, 2, 'personal_missed', '_bx_directory_cat_title_missed_connection', '', '', 1, 3);
  112. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  113. (0, 0, 2, 'sale', '_bx_directory_cat_title_sale', '', 'shopping-cart', 1, 7);
  114. SET @iParentId = LAST_INSERT_ID();
  115. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  116. (@iParentId, 1, 2, 'sale_barter', '_bx_directory_cat_title_barter', '', '', 1, 1),
  117. (@iParentId, 1, 2, 'sale_clothing', '_bx_directory_cat_title_clothing', '', '', 1, 1),
  118. (@iParentId, 1, 2, 'sale_collectible', '_bx_directory_cat_title_collectible', '', '', 1, 1);
  119. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  120. (0, 0, 2, 'sale_car', '_bx_directory_cat_title_sale_car', '', 'truck', 1, 8);
  121. SET @iParentId = LAST_INSERT_ID();
  122. INSERT INTO `bx_directory_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  123. (@iParentId, 1, 2, 'sale_car_part', '_bx_directory_cat_title_auto_part', '', '', 1, 1),
  124. (@iParentId, 1, 2, 'sale_car_auto', '_bx_directory_cat_title_auto_truck', '', '', 1, 2),
  125. (@iParentId, 1, 2, 'sale_car_motorcycle', '_bx_directory_cat_title_motorcycle', '', '', 1, 3);
  126. -- TABLE: storages & transcoders
  127. CREATE TABLE IF NOT EXISTS `bx_directory_covers` (
  128. `id` int(11) NOT NULL AUTO_INCREMENT,
  129. `profile_id` int(10) unsigned NOT NULL,
  130. `remote_id` varchar(128) NOT NULL,
  131. `path` varchar(255) NOT NULL,
  132. `file_name` varchar(255) NOT NULL,
  133. `mime_type` varchar(128) NOT NULL,
  134. `ext` varchar(32) NOT NULL,
  135. `size` int(11) NOT NULL,
  136. `added` int(11) NOT NULL,
  137. `modified` int(11) NOT NULL,
  138. `private` int(11) NOT NULL,
  139. PRIMARY KEY (`id`),
  140. UNIQUE KEY `remote_id` (`remote_id`)
  141. );
  142. CREATE TABLE IF NOT EXISTS `bx_directory_files` (
  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` int(11) NOT NULL,
  151. `added` int(11) NOT NULL,
  152. `modified` int(11) NOT NULL,
  153. `private` int(11) NOT NULL,
  154. PRIMARY KEY (`id`),
  155. UNIQUE KEY `remote_id` (`remote_id`)
  156. );
  157. CREATE TABLE IF NOT EXISTS `bx_directory_photos` (
  158. `id` int(11) NOT NULL AUTO_INCREMENT,
  159. `profile_id` int(10) unsigned NOT NULL,
  160. `remote_id` varchar(128) NOT NULL,
  161. `path` varchar(255) NOT NULL,
  162. `file_name` varchar(255) NOT NULL,
  163. `mime_type` varchar(128) NOT NULL,
  164. `ext` varchar(32) NOT NULL,
  165. `size` int(11) NOT NULL,
  166. `added` int(11) NOT NULL,
  167. `modified` int(11) NOT NULL,
  168. `private` int(11) NOT NULL,
  169. PRIMARY KEY (`id`),
  170. UNIQUE KEY `remote_id` (`remote_id`)
  171. );
  172. CREATE TABLE IF NOT EXISTS `bx_directory_photos_resized` (
  173. `id` int(11) NOT NULL AUTO_INCREMENT,
  174. `profile_id` int(10) unsigned NOT NULL,
  175. `remote_id` varchar(128) NOT NULL,
  176. `path` varchar(255) NOT NULL,
  177. `file_name` varchar(255) NOT NULL,
  178. `mime_type` varchar(128) NOT NULL,
  179. `ext` varchar(32) NOT NULL,
  180. `size` int(11) NOT NULL,
  181. `added` int(11) NOT NULL,
  182. `modified` int(11) NOT NULL,
  183. `private` int(11) NOT NULL,
  184. PRIMARY KEY (`id`),
  185. UNIQUE KEY `remote_id` (`remote_id`)
  186. );
  187. CREATE TABLE IF NOT EXISTS `bx_directory_videos` (
  188. `id` int(11) NOT NULL AUTO_INCREMENT,
  189. `profile_id` int(10) unsigned NOT NULL,
  190. `remote_id` varchar(128) NOT NULL,
  191. `path` varchar(255) NOT NULL,
  192. `file_name` varchar(255) NOT NULL,
  193. `mime_type` varchar(128) NOT NULL,
  194. `ext` varchar(32) NOT NULL,
  195. `size` int(11) NOT NULL,
  196. `added` int(11) NOT NULL,
  197. `modified` int(11) NOT NULL,
  198. `private` int(11) NOT NULL,
  199. PRIMARY KEY (`id`),
  200. UNIQUE KEY `remote_id` (`remote_id`)
  201. );
  202. CREATE TABLE IF NOT EXISTS `bx_directory_videos_resized` (
  203. `id` int(11) NOT NULL AUTO_INCREMENT,
  204. `profile_id` int(10) unsigned NOT NULL,
  205. `remote_id` varchar(128) NOT NULL,
  206. `path` varchar(255) NOT NULL,
  207. `file_name` varchar(255) NOT NULL,
  208. `mime_type` varchar(128) NOT NULL,
  209. `ext` varchar(32) NOT NULL,
  210. `size` int(11) NOT NULL,
  211. `added` int(11) NOT NULL,
  212. `modified` int(11) NOT NULL,
  213. `private` int(11) NOT NULL,
  214. PRIMARY KEY (`id`),
  215. UNIQUE KEY `remote_id` (`remote_id`)
  216. );
  217. -- TABLE: comments
  218. CREATE TABLE IF NOT EXISTS `bx_directory_cmts` (
  219. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  220. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  221. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  222. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  223. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  224. `cmt_level` int(11) NOT NULL DEFAULT '0',
  225. `cmt_text` text NOT NULL,
  226. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  227. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  228. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  229. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  230. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  231. PRIMARY KEY (`cmt_id`),
  232. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  233. FULLTEXT KEY `search_fields` (`cmt_text`)
  234. );
  235. -- TABLE: reviews
  236. CREATE TABLE IF NOT EXISTS `bx_directory_reviews` (
  237. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  238. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  239. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  240. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  241. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  242. `cmt_level` int(11) NOT NULL DEFAULT '0',
  243. `cmt_text` text NOT NULL,
  244. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  245. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  246. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  247. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  248. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  249. PRIMARY KEY (`cmt_id`),
  250. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  251. FULLTEXT KEY `search_fields` (`cmt_text`)
  252. );
  253. -- TABLE: votes
  254. CREATE TABLE IF NOT EXISTS `bx_directory_votes` (
  255. `object_id` int(11) NOT NULL default '0',
  256. `count` int(11) NOT NULL default '0',
  257. `sum` int(11) NOT NULL default '0',
  258. UNIQUE KEY `object_id` (`object_id`)
  259. );
  260. CREATE TABLE IF NOT EXISTS `bx_directory_votes_track` (
  261. `id` int(11) NOT NULL AUTO_INCREMENT,
  262. `object_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. `value` tinyint(4) NOT NULL default '0',
  266. `date` int(11) NOT NULL default '0',
  267. PRIMARY KEY (`id`),
  268. KEY `vote` (`object_id`, `author_nip`)
  269. );
  270. CREATE TABLE IF NOT EXISTS `bx_directory_reactions` (
  271. `object_id` int(11) NOT NULL default '0',
  272. `reaction` varchar(32) NOT NULL default '',
  273. `count` int(11) NOT NULL default '0',
  274. `sum` int(11) NOT NULL default '0',
  275. UNIQUE KEY `reaction` (`object_id`, `reaction`)
  276. );
  277. CREATE TABLE IF NOT EXISTS `bx_directory_reactions_track` (
  278. `id` int(11) NOT NULL AUTO_INCREMENT,
  279. `object_id` int(11) NOT NULL default '0',
  280. `author_id` int(11) NOT NULL default '0',
  281. `author_nip` int(11) unsigned NOT NULL default '0',
  282. `reaction` varchar(32) NOT NULL default '',
  283. `value` tinyint(4) NOT NULL default '0',
  284. `date` int(11) NOT NULL default '0',
  285. PRIMARY KEY (`id`),
  286. KEY `vote` (`object_id`, `author_nip`)
  287. );
  288. -- TABLE: views
  289. CREATE TABLE IF NOT EXISTS `bx_directory_views_track` (
  290. `object_id` int(11) NOT NULL default '0',
  291. `viewer_id` int(11) NOT NULL default '0',
  292. `viewer_nip` int(11) unsigned NOT NULL default '0',
  293. `date` int(11) NOT NULL default '0',
  294. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  295. );
  296. -- TABLE: metas
  297. CREATE TABLE IF NOT EXISTS `bx_directory_meta_keywords` (
  298. `object_id` int(10) unsigned NOT NULL,
  299. `keyword` varchar(255) NOT NULL,
  300. KEY `object_id` (`object_id`),
  301. KEY `keyword` (`keyword`)
  302. );
  303. CREATE TABLE IF NOT EXISTS `bx_directory_meta_mentions` (
  304. `object_id` int(10) unsigned NOT NULL,
  305. `profile_id` int(10) unsigned NOT NULL,
  306. KEY `object_id` (`object_id`),
  307. KEY `profile_id` (`profile_id`)
  308. );
  309. CREATE TABLE IF NOT EXISTS `bx_directory_meta_locations` (
  310. `object_id` int(10) unsigned NOT NULL,
  311. `lat` double NOT NULL,
  312. `lng` double NOT NULL,
  313. `country` varchar(2) NOT NULL,
  314. `state` varchar(255) NOT NULL,
  315. `city` varchar(255) NOT NULL,
  316. `zip` varchar(255) NOT NULL,
  317. `street` varchar(255) NOT NULL,
  318. `street_number` varchar(255) NOT NULL,
  319. PRIMARY KEY (`object_id`),
  320. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  321. );
  322. -- TABLE: reports
  323. CREATE TABLE IF NOT EXISTS `bx_directory_reports` (
  324. `object_id` int(11) NOT NULL default '0',
  325. `count` int(11) NOT NULL default '0',
  326. UNIQUE KEY `object_id` (`object_id`)
  327. );
  328. CREATE TABLE IF NOT EXISTS `bx_directory_reports_track` (
  329. `id` int(11) NOT NULL AUTO_INCREMENT,
  330. `object_id` int(11) NOT NULL default '0',
  331. `author_id` int(11) NOT NULL default '0',
  332. `author_nip` int(11) unsigned NOT NULL default '0',
  333. `type` varchar(32) NOT NULL default '',
  334. `text` text NOT NULL default '',
  335. `date` int(11) NOT NULL default '0',
  336. PRIMARY KEY (`id`),
  337. KEY `report` (`object_id`, `author_nip`)
  338. );
  339. -- TABLE: favorites
  340. CREATE TABLE IF NOT EXISTS `bx_directory_favorites_track` (
  341. `object_id` int(11) NOT NULL default '0',
  342. `author_id` int(11) NOT NULL default '0',
  343. `date` int(11) NOT NULL default '0',
  344. KEY `id` (`object_id`,`author_id`)
  345. );
  346. -- TABLE: scores
  347. CREATE TABLE IF NOT EXISTS `bx_directory_scores` (
  348. `object_id` int(11) NOT NULL default '0',
  349. `count_up` int(11) NOT NULL default '0',
  350. `count_down` int(11) NOT NULL default '0',
  351. UNIQUE KEY `object_id` (`object_id`)
  352. );
  353. CREATE TABLE IF NOT EXISTS `bx_directory_scores_track` (
  354. `id` int(11) NOT NULL AUTO_INCREMENT,
  355. `object_id` int(11) NOT NULL default '0',
  356. `author_id` int(11) NOT NULL default '0',
  357. `author_nip` int(11) unsigned NOT NULL default '0',
  358. `type` varchar(8) NOT NULL default '',
  359. `date` int(11) NOT NULL default '0',
  360. PRIMARY KEY (`id`),
  361. KEY `vote` (`object_id`, `author_nip`)
  362. );
  363. -- TABLE: polls
  364. CREATE TABLE IF NOT EXISTS `bx_directory_polls` (
  365. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  366. `author_id` int(11) NOT NULL default '0',
  367. `content_id` int(11) NOT NULL default '0',
  368. `text` text NOT NULL,
  369. PRIMARY KEY (`id`),
  370. FULLTEXT KEY `search_fields` (`text`)
  371. );
  372. CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers` (
  373. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  374. `poll_id` int(11) unsigned NOT NULL default '0',
  375. `title` varchar(255) NOT NULL,
  376. `rate` float NOT NULL default '0',
  377. `votes` int(11) NOT NULL default '0',
  378. `order` int(11) NOT NULL default '0',
  379. PRIMARY KEY (`id`),
  380. FULLTEXT KEY `title` (`title`)
  381. );
  382. CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers_votes` (
  383. `object_id` int(11) NOT NULL default '0',
  384. `count` int(11) NOT NULL default '0',
  385. `sum` int(11) NOT NULL default '0',
  386. UNIQUE KEY `object_id` (`object_id`)
  387. );
  388. CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers_votes_track` (
  389. `id` int(11) NOT NULL AUTO_INCREMENT,
  390. `object_id` int(11) NOT NULL default '0',
  391. `author_id` int(11) NOT NULL default '0',
  392. `author_nip` int(11) unsigned NOT NULL default '0',
  393. `value` tinyint(4) NOT NULL default '0',
  394. `date` int(11) NOT NULL default '0',
  395. PRIMARY KEY (`id`),
  396. KEY `vote` (`object_id`, `author_nip`)
  397. );
  398. -- STORAGES & TRANSCODERS
  399. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  400. 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
  401. ('bx_directory_covers', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_covers', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  402. ('bx_directory_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  403. ('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),
  404. ('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),
  405. ('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),
  406. ('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);
  407. 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
  408. ('bx_directory_preview', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
  409. ('bx_directory_gallery', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
  410. ('bx_directory_cover', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
  411. ('bx_directory_preview_photos', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_photos";}', 'no', '1', '2592000', '0', '', ''),
  412. ('bx_directory_gallery_photos', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_photos";}', 'no', '1', '2592000', '0', '', ''),
  413. ('bx_directory_videos_poster', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  414. ('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', ''),
  415. ('bx_directory_videos_mp4', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  416. ('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', ''),
  417. ('bx_directory_preview_files', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:18:"bx_directory_files";}', 'no', '1', '2592000', '0', '', ''),
  418. ('bx_directory_gallery_files', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:18:"bx_directory_files";}', 'no', '1', '2592000', '0', '', '');
  419. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  420. ('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'),
  421. ('bx_directory_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  422. ('bx_directory_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
  423. ('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'),
  424. ('bx_directory_gallery_photos', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  425. ('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),
  426. ('bx_directory_videos_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  427. ('bx_directory_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
  428. ('bx_directory_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
  429. ('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),
  430. ('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'),
  431. ('bx_directory_gallery_files', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
  432. -- FORMS: category
  433. 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
  434. ('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');
  435. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  436. ('bx_directory_category', 'bx_directory_category_add', 'bx_directory', 0, '_bx_directory_form_category_display_add'),
  437. ('bx_directory_category', 'bx_directory_category_delete', 'bx_directory', 0, '_bx_directory_form_category_display_delete'),
  438. ('bx_directory_category', 'bx_directory_category_edit', 'bx_directory', 0, '_bx_directory_form_category_display_edit');
  439. 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
  440. ('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),
  441. ('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),
  442. ('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),
  443. ('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),
  444. ('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),
  445. ('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),
  446. ('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),
  447. ('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),
  448. ('bx_directory_category', 'bx_directory', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  449. ('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),
  450. ('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);
  451. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  452. ('bx_directory_category_add', 'parent_id', 2147483647, 1, 1),
  453. ('bx_directory_category_add', 'type', 2147483647, 1, 2),
  454. ('bx_directory_category_add', 'type_clone', 2147483647, 1, 3),
  455. ('bx_directory_category_add', 'type_title', 2147483647, 1, 4),
  456. ('bx_directory_category_add', 'title', 2147483647, 1, 5),
  457. ('bx_directory_category_add', 'text', 2147483647, 1, 6),
  458. ('bx_directory_category_add', 'icon', 2147483647, 1, 7),
  459. ('bx_directory_category_add', 'controls', 2147483647, 1, 8),
  460. ('bx_directory_category_add', 'do_submit', 2147483647, 1, 9),
  461. ('bx_directory_category_add', 'do_cancel', 2147483647, 1, 10),
  462. ('bx_directory_category_delete', 'delete_confirm', 2147483647, 1, 1),
  463. ('bx_directory_category_delete', 'do_submit', 2147483647, 1, 2),
  464. ('bx_directory_category_edit', 'parent_id', 2147483647, 1, 1),
  465. ('bx_directory_category_edit', 'title', 2147483647, 1, 2),
  466. ('bx_directory_category_edit', 'text', 2147483647, 1, 3),
  467. ('bx_directory_category_edit', 'icon', 2147483647, 1, 4),
  468. ('bx_directory_category_edit', 'controls', 2147483647, 1, 5),
  469. ('bx_directory_category_edit', 'do_submit', 2147483647, 1, 6),
  470. ('bx_directory_category_edit', 'do_cancel', 2147483647, 1, 7);
  471. -- FORMS: entry (ad)
  472. 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
  473. ('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');
  474. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  475. ('bx_directory', 'bx_directory_entry_add', 'bx_directory', 0, '_bx_directory_form_entry_display_add'),
  476. ('bx_directory', 'bx_directory_entry_delete', 'bx_directory', 0, '_bx_directory_form_entry_display_delete'),
  477. ('bx_directory', 'bx_directory_entry_price_add', 'bx_directory', 0, '_bx_directory_form_entry_price_display_add'),
  478. ('bx_directory', 'bx_directory_entry_price_edit', 'bx_directory', 0, '_bx_directory_form_entry_price_display_edit'),
  479. ('bx_directory', 'bx_directory_entry_price_view', 'bx_directory', 1, '_bx_directory_form_entry_price_display_view'),
  480. ('bx_directory', 'bx_directory_entry_price_year_add', 'bx_directory', 0, '_bx_directory_form_entry_price_year_display_add'),
  481. ('bx_directory', 'bx_directory_entry_price_year_edit', 'bx_directory', 0, '_bx_directory_form_entry_price_year_display_edit'),
  482. ('bx_directory', 'bx_directory_entry_price_year_view', 'bx_directory', 1, '_bx_directory_form_entry_price_year_display_view');
  483. 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
  484. ('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),
  485. ('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),
  486. ('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),
  487. ('bx_directory', 'bx_directory', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  488. ('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),
  489. ('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),
  490. ('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),
  491. ('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),
  492. ('bx_directory', 'bx_directory', 'polls', '', '', 0, 'custom', '_bx_directory_form_entry_input_sys_polls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  493. ('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),
  494. ('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),
  495. ('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),
  496. ('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),
  497. ('bx_directory', 'bx_directory', 'category', '', '', 0, 'hidden', '_bx_directory_form_entry_input_sys_category', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
  498. ('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),
  499. ('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),
  500. ('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),
  501. ('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),
  502. ('bx_directory', 'bx_directory', 'attachments', '', '', 0, 'custom', '_bx_directory_form_entry_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  503. ('bx_directory', 'bx_directory', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  504. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  505. ('bx_directory_entry_add', 'category_select', 2147483647, 1, 1),
  506. ('bx_directory_entry_delete', 'delete_confirm', 2147483647, 1, 1),
  507. ('bx_directory_entry_delete', 'do_submit', 2147483647, 1, 2),
  508. ('bx_directory_entry_price_add', 'category', 2147483647, 1, 1),
  509. ('bx_directory_entry_price_add', 'category_view', 2147483647, 1, 2),
  510. ('bx_directory_entry_price_add', 'title', 2147483647, 1, 3),
  511. ('bx_directory_entry_price_add', 'price', 2147483647, 1, 4),
  512. ('bx_directory_entry_price_add', 'text', 2147483647, 1, 5),
  513. ('bx_directory_entry_price_add', 'attachments', 2147483647, 1, 6),
  514. ('bx_directory_entry_price_add', 'pictures', 2147483647, 1, 7),
  515. ('bx_directory_entry_price_add', 'videos', 2147483647, 1, 8),
  516. ('bx_directory_entry_price_add', 'files', 2147483647, 1, 9),
  517. ('bx_directory_entry_price_add', 'polls', 2147483647, 1, 10),
  518. ('bx_directory_entry_price_add', 'covers', 2147483647, 1, 11),
  519. ('bx_directory_entry_price_add', 'allow_view_to', 2147483647, 1, 12),
  520. ('bx_directory_entry_price_add', 'location', 2147483647, 1, 13),
  521. ('bx_directory_entry_price_add', 'do_submit', 2147483647, 1, 14),
  522. ('bx_directory_entry_price_edit', 'category_view', 2147483647, 1, 1),
  523. ('bx_directory_entry_price_edit', 'title', 2147483647, 1, 2),
  524. ('bx_directory_entry_price_edit', 'price', 2147483647, 1, 3),
  525. ('bx_directory_entry_price_edit', 'text', 2147483647, 1, 4),
  526. ('bx_directory_entry_price_edit', 'attachments', 2147483647, 1, 5),
  527. ('bx_directory_entry_price_edit', 'pictures', 2147483647, 1, 6),
  528. ('bx_directory_entry_price_edit', 'videos', 2147483647, 1, 7),
  529. ('bx_directory_entry_price_edit', 'files', 2147483647, 1, 8),
  530. ('bx_directory_entry_price_edit', 'polls', 2147483647, 1, 9),
  531. ('bx_directory_entry_price_edit', 'covers', 2147483647, 1, 10),
  532. ('bx_directory_entry_price_edit', 'allow_view_to', 2147483647, 1, 11),
  533. ('bx_directory_entry_price_edit', 'location', 2147483647, 1, 12),
  534. ('bx_directory_entry_price_edit', 'do_submit', 2147483647, 1, 13),
  535. ('bx_directory_entry_price_view', 'category_view', 2147483647, 1, 1),
  536. ('bx_directory_entry_price_view', 'price', 2147483647, 1, 2),
  537. ('bx_directory_entry_price_view', 'added', 2147483647, 1, 3),
  538. ('bx_directory_entry_price_view', 'changed', 2147483647, 1, 4),
  539. ('bx_directory_entry_price_year_add', 'category', 2147483647, 1, 1),
  540. ('bx_directory_entry_price_year_add', 'category_view', 2147483647, 1, 2),
  541. ('bx_directory_entry_price_year_add', 'title', 2147483647, 1, 3),
  542. ('bx_directory_entry_price_year_add', 'price', 2147483647, 1, 4),
  543. ('bx_directory_entry_price_year_add', 'year', 2147483647, 1, 5),
  544. ('bx_directory_entry_price_year_add', 'text', 2147483647, 1, 6),
  545. ('bx_directory_entry_price_year_add', 'attachments', 2147483647, 1, 7),
  546. ('bx_directory_entry_price_year_add', 'pictures', 2147483647, 1, 8),
  547. ('bx_directory_entry_price_year_add', 'videos', 2147483647, 1, 9),
  548. ('bx_directory_entry_price_year_add', 'files', 2147483647, 1, 10),
  549. ('bx_directory_entry_price_year_add', 'polls', 2147483647, 1, 11),
  550. ('bx_directory_entry_price_year_add', 'covers', 2147483647, 1, 12),
  551. ('bx_directory_entry_price_year_add', 'allow_view_to', 2147483647, 1, 13),
  552. ('bx_directory_entry_price_year_add', 'location', 2147483647, 1, 14),
  553. ('bx_directory_entry_price_year_add', 'do_submit', 2147483647, 1, 15),
  554. ('bx_directory_entry_price_year_edit', 'category_view', 2147483647, 1, 1),
  555. ('bx_directory_entry_price_year_edit', 'title', 2147483647, 1, 2),
  556. ('bx_directory_entry_price_year_edit', 'price', 2147483647, 1, 3),
  557. ('bx_directory_entry_price_year_edit', 'year', 2147483647, 1, 4),
  558. ('bx_directory_entry_price_year_edit', 'text', 2147483647, 1, 5),
  559. ('bx_directory_entry_price_year_edit', 'attachments', 2147483647, 1, 6),
  560. ('bx_directory_entry_price_year_edit', 'pictures', 2147483647, 1, 7),
  561. ('bx_directory_entry_price_year_edit', 'videos', 2147483647, 1, 8),
  562. ('bx_directory_entry_price_year_edit', 'files', 2147483647, 1, 9),
  563. ('bx_directory_entry_price_year_edit', 'polls', 2147483647, 1, 10),
  564. ('bx_directory_entry_price_year_edit', 'covers', 2147483647, 1, 11),
  565. ('bx_directory_entry_price_year_edit', 'allow_view_to', 2147483647, 1, 12),
  566. ('bx_directory_entry_price_year_edit', 'location', 2147483647, 1, 13),
  567. ('bx_directory_entry_price_year_edit', 'do_submit', 2147483647, 1, 14),
  568. ('bx_directory_entry_price_year_view', 'category_view', 2147483647, 1, 1),
  569. ('bx_directory_entry_price_year_view', 'price', 2147483647, 1, 2),
  570. ('bx_directory_entry_price_year_view', 'year', 2147483647, 1, 3),
  571. ('bx_directory_entry_price_year_view', 'added', 2147483647, 1, 4),
  572. ('bx_directory_entry_price_year_view', 'changed', 2147483647, 1, 5);
  573. -- FORMS: poll
  574. 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
  575. ('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');
  576. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  577. ('bx_directory_poll_add', 'bx_directory', 'bx_directory_poll', '_bx_directory_form_poll_display_add', 0);
  578. 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
  579. ('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),
  580. ('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),
  581. ('bx_directory_poll', 'bx_directory', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  582. ('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),
  583. ('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);
  584. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  585. ('bx_directory_poll_add', 'text', 2147483647, 1, 1),
  586. ('bx_directory_poll_add', 'answers', 2147483647, 1, 2),
  587. ('bx_directory_poll_add', 'controls', 2147483647, 1, 3),
  588. ('bx_directory_poll_add', 'do_submit', 2147483647, 1, 4),
  589. ('bx_directory_poll_add', 'do_cancel', 2147483647, 1, 5);
  590. -- COMMENTS
  591. 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
  592. ('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', '', ''),
  593. ('bx_directory_reviews', 'bx_directory', 'bx_directory_reviews', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 0, 1, -3, 1, 'cmt', 'page.php?i=view-post&id={object_id}', '', 'bx_directory_entries', 'id', 'author', 'title', 'reviews', 'BxTemplCmtsReviews', '');
  594. -- VOTES
  595. INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  596. ('bx_directory', 'bx_directory_votes', 'bx_directory_votes_track', '604800', '1', '1', '0', '1', 'bx_directory_entries', 'id', 'author', 'rate', 'votes', '', ''),
  597. ('bx_directory_reactions', 'bx_directory_reactions', 'bx_directory_reactions_track', '604800', '1', '1', '1', '1', 'bx_directory_entries', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', ''),
  598. ('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');
  599. -- SCORES
  600. 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
  601. ('bx_directory', 'bx_directory', 'bx_directory_scores', 'bx_directory_scores_track', '604800', '0', 'bx_directory_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
  602. -- REPORTS
  603. 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
  604. ('bx_directory', 'bx_directory_reports', 'bx_directory_reports_track', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'reports', '', '');
  605. -- VIEWS
  606. 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
  607. ('bx_directory', 'bx_directory_views_track', '86400', '1', 'bx_directory_entries', 'id', 'author', 'views', '', '');
  608. -- FAFORITES
  609. 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
  610. ('bx_directory', 'bx_directory_favorites_track', '1', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'favorites', '', '');
  611. -- FEATURED
  612. 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
  613. ('bx_directory', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'featured', '', '');
  614. -- CONTENT INFO
  615. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  616. ('bx_directory', '_bx_directory', 'bx_directory', 'added', 'edited', 'deleted', '', ''),
  617. ('bx_directory_cmts', '_bx_directory_cmts', 'bx_directory', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', ''),
  618. ('bx_directory_reviews', '_bx_directory_reviews', 'bx_directory_reviews', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  619. INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
  620. ('bx_directory', 'bx_directory_administration', 'id', '', ''),
  621. ('bx_directory', 'bx_directory_common', 'id', '', '');
  622. -- SEARCH EXTENDED
  623. INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
  624. ('bx_directory', 'bx_directory', 'bx_directory', '_bx_directory_search_extended', 1, '', ''),
  625. ('bx_directory_cmts', 'bx_directory_cmts', 'bx_directory', '_bx_directory_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', ''),
  626. ('bx_directory_reviews', 'bx_directory_reviews', 'bx_directory', '_bx_directory_search_extended_reviews', 1, 'BxTemplSearchExtendedCmts', '');
  627. -- STUDIO: page & widget
  628. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  629. (3, 'bx_directory', '_bx_directory', '_bx_directory', 'bx_directory@modules/boonex/directory/|std-icon.svg');
  630. SET @iPageId = LAST_INSERT_ID();
  631. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  632. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  633. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  634. (@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";}');
  635. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  636. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));