install.sql 46 KB

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