install.sql 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. -- TABLE: entries
  2. CREATE TABLE IF NOT EXISTS `bx_ads_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` float NOT NULL,
  11. `year` int(11) NOT NULL,
  12. `text` mediumtext NOT NULL,
  13. `labels` text NOT NULL,
  14. `location` text NOT NULL,
  15. `views` int(11) NOT NULL default '0',
  16. `rate` float NOT NULL default '0',
  17. `votes` int(11) NOT NULL default '0',
  18. `rrate` float NOT NULL default '0',
  19. `rvotes` int(11) NOT NULL default '0',
  20. `score` int(11) NOT NULL default '0',
  21. `sc_up` int(11) NOT NULL default '0',
  22. `sc_down` int(11) NOT NULL default '0',
  23. `favorites` int(11) NOT NULL default '0',
  24. `comments` int(11) NOT NULL default '0',
  25. `reviews` int(11) NOT NULL default '0',
  26. `reviews_avg` float NOT NULL default '0',
  27. `reports` int(11) NOT NULL default '0',
  28. `featured` int(11) NOT NULL default '0',
  29. `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
  30. `status` enum('active','awaiting','hidden') NOT NULL DEFAULT 'active',
  31. `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
  32. PRIMARY KEY (`id`),
  33. FULLTEXT KEY `title_text` (`title`,`text`)
  34. );
  35. -- TABLE: types of categories
  36. CREATE TABLE IF NOT EXISTS `bx_ads_categories_types` (
  37. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  38. `name` varchar(64) NOT NULL DEFAULT '',
  39. `title` varchar(255) NOT NULL DEFAULT '',
  40. `display_add` varchar(255) NOT NULL DEFAULT '',
  41. `display_edit` varchar(255) NOT NULL DEFAULT '',
  42. `display_view` varchar(255) NOT NULL DEFAULT '',
  43. PRIMARY KEY (`id`),
  44. UNIQUE KEY `name` (`name`)
  45. );
  46. INSERT INTO `bx_ads_categories_types` (`id`, `name`, `title`, `display_add`, `display_edit`, `display_view`) VALUES
  47. (1, 'price', '_bx_ads_cat_type_price', 'bx_ads_entry_price_add', 'bx_ads_entry_price_edit', 'bx_ads_entry_price_view'),
  48. (2, 'price_year', '_bx_ads_cat_type_price_year', 'bx_ads_entry_price_year_add', 'bx_ads_entry_price_year_edit', 'bx_ads_entry_price_year_view');
  49. -- TABLE: categories
  50. CREATE TABLE IF NOT EXISTS `bx_ads_categories` (
  51. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  52. `parent_id` int(11) unsigned NOT NULL DEFAULT '0',
  53. `level` tinyint(11) unsigned NOT NULL DEFAULT '0',
  54. `type` int(11) NOT NULL DEFAULT '0',
  55. `name` varchar(64) NOT NULL DEFAULT '',
  56. `title` varchar(255) NOT NULL DEFAULT '',
  57. `text` text NOT NULL,
  58. `icon` varchar(255) NOT NULL DEFAULT '',
  59. `items` int(11) NOT NULL DEFAULT '0',
  60. `active` tinyint(4) NOT NULL DEFAULT '1',
  61. `order` int(11) NOT NULL DEFAULT '0',
  62. PRIMARY KEY (`id`),
  63. UNIQUE KEY `name` (`name`),
  64. FULLTEXT KEY `title_text` (`title`,`text`)
  65. );
  66. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  67. (0, 0, 1, 'job', '_bx_ads_cat_title_job', '', 'user-md', 1, 1);
  68. SET @iParentId = LAST_INSERT_ID();
  69. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  70. (@iParentId, 1, 1, 'job_finance', '_bx_ads_cat_title_accounting_finance', '', '', 1, 1),
  71. (@iParentId, 1, 1, 'job_education', '_bx_ads_cat_title_education_nonprofit', '', '', 1, 2),
  72. (@iParentId, 1, 1, 'job_legal', '_bx_ads_cat_title_government_legal', '', '', 1, 3),
  73. (@iParentId, 1, 1, 'job_programming', '_bx_ads_cat_title_programming_web_design', '', '', 1, 4);
  74. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  75. (0, 0, 2, 'music', '_bx_ads_cat_title_music', '', 'music', 1, 2);
  76. SET @iParentId = LAST_INSERT_ID();
  77. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  78. (@iParentId, 1, 2, 'music_isale', '_bx_ads_cat_title_instrument_sale', '', '', 1, 1),
  79. (@iParentId, 1, 2, 'music_iwanted', '_bx_ads_cat_title_instrument_wanted', '', '', 1, 2);
  80. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  81. (0, 0, 1, 'housing', '_bx_ads_cat_title_housing', '', 'home', 1, 3);
  82. SET @iParentId = LAST_INSERT_ID();
  83. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  84. (@iParentId, 1, 1, 'housing_apartments', '_bx_ads_cat_title_apartments_housing', '', '', 1, 1),
  85. (@iParentId, 1, 1, 'housing_office', '_bx_ads_cat_title_office_commercial', '', '', 1, 2),
  86. (@iParentId, 1, 1, 'housing_re_sale', '_bx_ads_cat_title_real_estate_sale', '', '', 1, 3),
  87. (@iParentId, 1, 1, 'housing_roommate', '_bx_ads_cat_title_roommate', '', '', 1, 4),
  88. (@iParentId, 1, 1, 'housing_temp_rental', '_bx_ads_cat_title_temporary_rental', '', '', 1, 5);
  89. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  90. (0, 0, 1, 'service', '_bx_ads_cat_title_service', '', 'wrench', 1, 4);
  91. SET @iParentId = LAST_INSERT_ID();
  92. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  93. (@iParentId, 1, 1, 'service_automotive', '_bx_ads_cat_title_automotive', '', '', 1, 1),
  94. (@iParentId, 1, 1, 'service_educational', '_bx_ads_cat_title_educational', '', '', 1, 2),
  95. (@iParentId, 1, 1, 'service_financial', '_bx_ads_cat_title_financial', '', '', 1, 3),
  96. (@iParentId, 1, 1, 'service_labor', '_bx_ads_cat_title_labor_move', '', '', 1, 4),
  97. (@iParentId, 1, 1, 'service_legal', '_bx_ads_cat_title_legal', '', '', 1, 5);
  98. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  99. (0, 0, 1, 'casting', '_bx_ads_cat_title_casting', '', 'eye', 1, 5);
  100. SET @iParentId = LAST_INSERT_ID();
  101. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  102. (@iParentId, 1, 1, 'casting_acting', '_bx_ads_cat_title_acting', '', '', 1, 1),
  103. (@iParentId, 1, 1, 'casting_dance', '_bx_ads_cat_title_dance', '', '', 1, 2),
  104. (@iParentId, 1, 1, 'casting_modeling', '_bx_ads_cat_title_modeling', '', '', 1, 3),
  105. (@iParentId, 1, 1, 'casting_musician', '_bx_ads_cat_title_musician', '', '', 1, 4),
  106. (@iParentId, 1, 1, 'casting_rshow', '_bx_ads_cat_title_reality_show', '', '', 1, 5);
  107. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  108. (0, 0, 2, 'personal', '_bx_ads_cat_title_personal', '', 'user', 1, 6);
  109. SET @iParentId = LAST_INSERT_ID();
  110. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  111. (@iParentId, 1, 2, 'personal_mw', '_bx_ads_cat_title_men_women', '', '', 1, 1),
  112. (@iParentId, 1, 2, 'personal_wm', '_bx_ads_cat_title_women_men', '', '', 1, 2),
  113. (@iParentId, 1, 2, 'personal_missed', '_bx_ads_cat_title_missed_connection', '', '', 1, 3);
  114. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  115. (0, 0, 2, 'sale', '_bx_ads_cat_title_sale', '', 'shopping-cart', 1, 7);
  116. SET @iParentId = LAST_INSERT_ID();
  117. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  118. (@iParentId, 1, 2, 'sale_barter', '_bx_ads_cat_title_barter', '', '', 1, 1),
  119. (@iParentId, 1, 2, 'sale_clothing', '_bx_ads_cat_title_clothing', '', '', 1, 1),
  120. (@iParentId, 1, 2, 'sale_collectible', '_bx_ads_cat_title_collectible', '', '', 1, 1);
  121. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  122. (0, 0, 2, 'sale_car', '_bx_ads_cat_title_sale_car', '', 'truck', 1, 8);
  123. SET @iParentId = LAST_INSERT_ID();
  124. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  125. (@iParentId, 1, 2, 'sale_car_part', '_bx_ads_cat_title_auto_part', '', '', 1, 1),
  126. (@iParentId, 1, 2, 'sale_car_auto', '_bx_ads_cat_title_auto_truck', '', '', 1, 2),
  127. (@iParentId, 1, 2, 'sale_car_motorcycle', '_bx_ads_cat_title_motorcycle', '', '', 1, 3);
  128. CREATE TABLE IF NOT EXISTS `bx_ads_interested_track` (
  129. `id` int(11) NOT NULL AUTO_INCREMENT,
  130. `entry_id` int(11) NOT NULL default '0',
  131. `profile_id` int(11) NOT NULL default '0',
  132. `date` int(11) NOT NULL default '0',
  133. PRIMARY KEY (`id`),
  134. KEY `interested` (`entry_id`, `profile_id`)
  135. );
  136. -- TABLE: storages & transcoders
  137. CREATE TABLE IF NOT EXISTS `bx_ads_covers` (
  138. `id` int(11) NOT NULL AUTO_INCREMENT,
  139. `profile_id` int(10) unsigned NOT NULL,
  140. `remote_id` varchar(128) NOT NULL,
  141. `path` varchar(255) NOT NULL,
  142. `file_name` varchar(255) NOT NULL,
  143. `mime_type` varchar(128) NOT NULL,
  144. `ext` varchar(32) NOT NULL,
  145. `size` bigint(20) NOT NULL,
  146. `added` int(11) NOT NULL,
  147. `modified` int(11) NOT NULL,
  148. `private` int(11) NOT NULL,
  149. PRIMARY KEY (`id`),
  150. UNIQUE KEY `remote_id` (`remote_id`)
  151. );
  152. CREATE TABLE IF NOT EXISTS `bx_ads_files` (
  153. `id` int(11) NOT NULL AUTO_INCREMENT,
  154. `profile_id` int(10) unsigned NOT NULL,
  155. `remote_id` varchar(128) NOT NULL,
  156. `path` varchar(255) NOT NULL,
  157. `file_name` varchar(255) NOT NULL,
  158. `mime_type` varchar(128) NOT NULL,
  159. `ext` varchar(32) NOT NULL,
  160. `size` bigint(20) NOT NULL,
  161. `added` int(11) NOT NULL,
  162. `modified` int(11) NOT NULL,
  163. `private` int(11) NOT NULL,
  164. PRIMARY KEY (`id`),
  165. UNIQUE KEY `remote_id` (`remote_id`)
  166. );
  167. CREATE TABLE IF NOT EXISTS `bx_ads_photos` (
  168. `id` int(11) NOT NULL AUTO_INCREMENT,
  169. `profile_id` int(10) unsigned NOT NULL,
  170. `remote_id` varchar(128) NOT NULL,
  171. `path` varchar(255) NOT NULL,
  172. `file_name` varchar(255) NOT NULL,
  173. `mime_type` varchar(128) NOT NULL,
  174. `ext` varchar(32) NOT NULL,
  175. `size` bigint(20) NOT NULL,
  176. `added` int(11) NOT NULL,
  177. `modified` int(11) NOT NULL,
  178. `private` int(11) NOT NULL,
  179. PRIMARY KEY (`id`),
  180. UNIQUE KEY `remote_id` (`remote_id`)
  181. );
  182. CREATE TABLE IF NOT EXISTS `bx_ads_photos_resized` (
  183. `id` int(11) NOT NULL AUTO_INCREMENT,
  184. `profile_id` int(10) unsigned NOT NULL,
  185. `remote_id` varchar(128) NOT NULL,
  186. `path` varchar(255) NOT NULL,
  187. `file_name` varchar(255) NOT NULL,
  188. `mime_type` varchar(128) NOT NULL,
  189. `ext` varchar(32) NOT NULL,
  190. `size` bigint(20) NOT NULL,
  191. `added` int(11) NOT NULL,
  192. `modified` int(11) NOT NULL,
  193. `private` int(11) NOT NULL,
  194. PRIMARY KEY (`id`),
  195. UNIQUE KEY `remote_id` (`remote_id`)
  196. );
  197. CREATE TABLE IF NOT EXISTS `bx_ads_videos` (
  198. `id` int(11) NOT NULL AUTO_INCREMENT,
  199. `profile_id` int(10) unsigned NOT NULL,
  200. `remote_id` varchar(128) NOT NULL,
  201. `path` varchar(255) NOT NULL,
  202. `file_name` varchar(255) NOT NULL,
  203. `mime_type` varchar(128) NOT NULL,
  204. `ext` varchar(32) NOT NULL,
  205. `size` bigint(20) NOT NULL,
  206. `added` int(11) NOT NULL,
  207. `modified` int(11) NOT NULL,
  208. `private` int(11) NOT NULL,
  209. PRIMARY KEY (`id`),
  210. UNIQUE KEY `remote_id` (`remote_id`)
  211. );
  212. CREATE TABLE IF NOT EXISTS `bx_ads_videos_resized` (
  213. `id` int(11) NOT NULL AUTO_INCREMENT,
  214. `profile_id` int(10) unsigned NOT NULL,
  215. `remote_id` varchar(128) NOT NULL,
  216. `path` varchar(255) NOT NULL,
  217. `file_name` varchar(255) NOT NULL,
  218. `mime_type` varchar(128) NOT NULL,
  219. `ext` varchar(32) NOT NULL,
  220. `size` bigint(20) NOT NULL,
  221. `added` int(11) NOT NULL,
  222. `modified` int(11) NOT NULL,
  223. `private` int(11) NOT NULL,
  224. PRIMARY KEY (`id`),
  225. UNIQUE KEY `remote_id` (`remote_id`)
  226. );
  227. -- TABLE: comments
  228. CREATE TABLE IF NOT EXISTS `bx_ads_cmts` (
  229. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  230. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  231. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  232. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  233. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  234. `cmt_level` int(11) NOT NULL DEFAULT '0',
  235. `cmt_text` text NOT NULL,
  236. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  237. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  238. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  239. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  240. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  241. `cmt_pinned` int(11) NOT NULL default '0',
  242. PRIMARY KEY (`cmt_id`),
  243. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  244. FULLTEXT KEY `search_fields` (`cmt_text`)
  245. );
  246. -- TABLE: reviews
  247. CREATE TABLE IF NOT EXISTS `bx_ads_reviews` (
  248. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  249. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  250. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  251. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  252. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  253. `cmt_level` int(11) NOT NULL DEFAULT '0',
  254. `cmt_text` text NOT NULL,
  255. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  256. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  257. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  258. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  259. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  260. `cmt_pinned` int(11) NOT NULL default '0',
  261. PRIMARY KEY (`cmt_id`),
  262. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  263. FULLTEXT KEY `search_fields` (`cmt_text`)
  264. );
  265. -- TABLE: votes
  266. CREATE TABLE IF NOT EXISTS `bx_ads_votes` (
  267. `object_id` int(11) NOT NULL default '0',
  268. `count` int(11) NOT NULL default '0',
  269. `sum` int(11) NOT NULL default '0',
  270. UNIQUE KEY `object_id` (`object_id`)
  271. );
  272. CREATE TABLE IF NOT EXISTS `bx_ads_votes_track` (
  273. `id` int(11) NOT NULL AUTO_INCREMENT,
  274. `object_id` int(11) NOT NULL default '0',
  275. `author_id` int(11) NOT NULL default '0',
  276. `author_nip` int(11) unsigned NOT NULL default '0',
  277. `value` tinyint(4) NOT NULL default '0',
  278. `date` int(11) NOT NULL default '0',
  279. PRIMARY KEY (`id`),
  280. KEY `vote` (`object_id`, `author_nip`)
  281. );
  282. CREATE TABLE IF NOT EXISTS `bx_ads_reactions` (
  283. `object_id` int(11) NOT NULL default '0',
  284. `reaction` varchar(32) NOT NULL default '',
  285. `count` int(11) NOT NULL default '0',
  286. `sum` int(11) NOT NULL default '0',
  287. UNIQUE KEY `reaction` (`object_id`, `reaction`)
  288. );
  289. CREATE TABLE IF NOT EXISTS `bx_ads_reactions_track` (
  290. `id` int(11) NOT NULL AUTO_INCREMENT,
  291. `object_id` int(11) NOT NULL default '0',
  292. `author_id` int(11) NOT NULL default '0',
  293. `author_nip` int(11) unsigned NOT NULL default '0',
  294. `reaction` varchar(32) NOT NULL default '',
  295. `value` tinyint(4) NOT NULL default '0',
  296. `date` int(11) NOT NULL default '0',
  297. PRIMARY KEY (`id`),
  298. KEY `vote` (`object_id`, `author_nip`)
  299. );
  300. -- TABLE: views
  301. CREATE TABLE IF NOT EXISTS `bx_ads_views_track` (
  302. `object_id` int(11) NOT NULL default '0',
  303. `viewer_id` int(11) NOT NULL default '0',
  304. `viewer_nip` int(11) unsigned NOT NULL default '0',
  305. `date` int(11) NOT NULL default '0',
  306. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  307. );
  308. -- TABLE: metas
  309. CREATE TABLE IF NOT EXISTS `bx_ads_meta_keywords` (
  310. `object_id` int(10) unsigned NOT NULL,
  311. `keyword` varchar(255) NOT NULL,
  312. KEY `object_id` (`object_id`),
  313. KEY `keyword` (`keyword`)
  314. );
  315. CREATE TABLE IF NOT EXISTS `bx_ads_meta_mentions` (
  316. `object_id` int(10) unsigned NOT NULL,
  317. `profile_id` int(10) unsigned NOT NULL,
  318. KEY `object_id` (`object_id`),
  319. KEY `profile_id` (`profile_id`)
  320. );
  321. CREATE TABLE IF NOT EXISTS `bx_ads_meta_locations` (
  322. `object_id` int(10) unsigned NOT NULL,
  323. `lat` double NOT NULL,
  324. `lng` double NOT NULL,
  325. `country` varchar(2) NOT NULL,
  326. `state` varchar(255) NOT NULL,
  327. `city` varchar(255) NOT NULL,
  328. `zip` varchar(255) NOT NULL,
  329. `street` varchar(255) NOT NULL,
  330. `street_number` varchar(255) NOT NULL,
  331. PRIMARY KEY (`object_id`),
  332. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  333. );
  334. -- TABLE: reports
  335. CREATE TABLE IF NOT EXISTS `bx_ads_reports` (
  336. `object_id` int(11) NOT NULL default '0',
  337. `count` int(11) NOT NULL default '0',
  338. UNIQUE KEY `object_id` (`object_id`)
  339. );
  340. CREATE TABLE IF NOT EXISTS `bx_ads_reports_track` (
  341. `id` int(11) NOT NULL AUTO_INCREMENT,
  342. `object_id` int(11) NOT NULL default '0',
  343. `author_id` int(11) NOT NULL default '0',
  344. `author_nip` int(11) unsigned NOT NULL default '0',
  345. `type` varchar(32) NOT NULL default '',
  346. `text` text NOT NULL default '',
  347. `date` int(11) NOT NULL default '0',
  348. PRIMARY KEY (`id`),
  349. KEY `report` (`object_id`, `author_nip`)
  350. );
  351. -- TABLE: favorites
  352. CREATE TABLE IF NOT EXISTS `bx_ads_favorites_track` (
  353. `object_id` int(11) NOT NULL default '0',
  354. `author_id` int(11) NOT NULL default '0',
  355. `date` int(11) NOT NULL default '0',
  356. KEY `id` (`object_id`,`author_id`)
  357. );
  358. -- TABLE: scores
  359. CREATE TABLE IF NOT EXISTS `bx_ads_scores` (
  360. `object_id` int(11) NOT NULL default '0',
  361. `count_up` int(11) NOT NULL default '0',
  362. `count_down` int(11) NOT NULL default '0',
  363. UNIQUE KEY `object_id` (`object_id`)
  364. );
  365. CREATE TABLE IF NOT EXISTS `bx_ads_scores_track` (
  366. `id` int(11) NOT NULL AUTO_INCREMENT,
  367. `object_id` int(11) NOT NULL default '0',
  368. `author_id` int(11) NOT NULL default '0',
  369. `author_nip` int(11) unsigned NOT NULL default '0',
  370. `type` varchar(8) NOT NULL default '',
  371. `date` int(11) NOT NULL default '0',
  372. PRIMARY KEY (`id`),
  373. KEY `vote` (`object_id`, `author_nip`)
  374. );
  375. -- TABLE: polls
  376. CREATE TABLE IF NOT EXISTS `bx_ads_polls` (
  377. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  378. `author_id` int(11) NOT NULL default '0',
  379. `content_id` int(11) NOT NULL default '0',
  380. `text` text NOT NULL,
  381. PRIMARY KEY (`id`),
  382. FULLTEXT KEY `search_fields` (`text`)
  383. );
  384. CREATE TABLE IF NOT EXISTS `bx_ads_polls_answers` (
  385. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  386. `poll_id` int(11) unsigned NOT NULL default '0',
  387. `title` varchar(255) NOT NULL,
  388. `rate` float NOT NULL default '0',
  389. `votes` int(11) NOT NULL default '0',
  390. `order` int(11) NOT NULL default '0',
  391. PRIMARY KEY (`id`),
  392. FULLTEXT KEY `title` (`title`)
  393. );
  394. CREATE TABLE IF NOT EXISTS `bx_ads_polls_answers_votes` (
  395. `object_id` int(11) NOT NULL default '0',
  396. `count` int(11) NOT NULL default '0',
  397. `sum` int(11) NOT NULL default '0',
  398. UNIQUE KEY `object_id` (`object_id`)
  399. );
  400. CREATE TABLE IF NOT EXISTS `bx_ads_polls_answers_votes_track` (
  401. `id` int(11) NOT NULL AUTO_INCREMENT,
  402. `object_id` int(11) NOT NULL default '0',
  403. `author_id` int(11) NOT NULL default '0',
  404. `author_nip` int(11) unsigned NOT NULL default '0',
  405. `value` tinyint(4) NOT NULL default '0',
  406. `date` int(11) NOT NULL default '0',
  407. PRIMARY KEY (`id`),
  408. KEY `vote` (`object_id`, `author_nip`)
  409. );
  410. -- STORAGES & TRANSCODERS
  411. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  412. 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
  413. ('bx_ads_covers', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_covers', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  414. ('bx_ads_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  415. ('bx_ads_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  416. ('bx_ads_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_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),
  417. ('bx_ads_videos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_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),
  418. ('bx_ads_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_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);
  419. 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
  420. ('bx_ads_preview', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_covers";}', 'no', '1', '2592000', '0', '', ''),
  421. ('bx_ads_gallery', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_covers";}', 'no', '1', '2592000', '0', '', ''),
  422. ('bx_ads_cover', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_covers";}', 'no', '1', '2592000', '0', '', ''),
  423. ('bx_ads_preview_photos', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_photos";}', 'no', '1', '2592000', '0', '', ''),
  424. ('bx_ads_gallery_photos', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_photos";}', 'no', '1', '2592000', '0', '', ''),
  425. ('bx_ads_videos_poster', 'bx_ads_videos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  426. ('bx_ads_videos_poster_preview', 'bx_ads_videos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  427. ('bx_ads_videos_mp4', 'bx_ads_videos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  428. ('bx_ads_videos_mp4_hd', 'bx_ads_videos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  429. ('bx_ads_preview_files', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:12:"bx_ads_files";}', 'no', '1', '2592000', '0', '', ''),
  430. ('bx_ads_gallery_files', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:12:"bx_ads_files";}', 'no', '1', '2592000', '0', '', '');
  431. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  432. ('bx_ads_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
  433. ('bx_ads_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  434. ('bx_ads_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
  435. ('bx_ads_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'),
  436. ('bx_ads_gallery_photos', 'Resize', 'a:4:{s:1:"w";s:3:"600";s:1:"h";s:3:"600";s:13:"square_resize";s:1:"1";s:10:"force_type";s:3:"jpg";}', '0'),
  437. ('bx_ads_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),
  438. ('bx_ads_videos_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  439. ('bx_ads_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
  440. ('bx_ads_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
  441. ('bx_ads_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),
  442. ('bx_ads_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'),
  443. ('bx_ads_gallery_files', 'Resize', 'a:4:{s:1:"w";s:3:"600";s:1:"h";s:3:"600";s:13:"square_resize";s:1:"1";s:10:"force_type";s:3:"jpg";}', '0');
  444. -- FORMS: category
  445. 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
  446. ('bx_ads_category', 'bx_ads', '_bx_ads_form_category', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_ads_categories', 'id', '', '', 'a:1:{i:0;s:9:"do_submit";}', '', 0, 1, 'BxAdsFormCategory', 'modules/boonex/ads/classes/BxAdsFormCategory.php');
  447. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  448. ('bx_ads_category', 'bx_ads_category_add', 'bx_ads', 0, '_bx_ads_form_category_display_add'),
  449. ('bx_ads_category', 'bx_ads_category_delete', 'bx_ads', 0, '_bx_ads_form_category_display_delete'),
  450. ('bx_ads_category', 'bx_ads_category_edit', 'bx_ads', 0, '_bx_ads_form_category_display_edit');
  451. 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
  452. ('bx_ads_category', 'bx_ads', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_ads_form_category_input_sys_delete_confirm', '_bx_ads_form_category_input_delete_confirm', '_bx_ads_form_category_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ads_form_category_input_delete_confirm_error', '', '', 1, 0),
  453. ('bx_ads_category', 'bx_ads', 'parent_id', '', '', 0, 'select', '_bx_ads_form_category_input_sys_parent_id', '_bx_ads_form_category_input_parent_id', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  454. ('bx_ads_category', 'bx_ads', 'title', '', '', 0, 'text_translatable', '_bx_ads_form_category_input_sys_title', '_bx_ads_form_category_input_title', '', 1, 0, 0, '', '', '', 'AvailTranslatable', 'a:1:{i:0;s:5:"title";}', '_bx_ads_form_category_input_title_err', 'Xss', '', 1, 0),
  455. ('bx_ads_category', 'bx_ads', 'text', '', '', 0, 'textarea_translatable', '_bx_ads_form_category_input_sys_text', '_bx_ads_form_category_input_text', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
  456. ('bx_ads_category', 'bx_ads', 'type', '', '', 0, 'select', '_bx_ads_form_category_input_sys_type', '_bx_ads_form_category_input_type', '_bx_ads_form_category_input_type_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ads_form_category_input_type_err', 'Int', '', 0, 0),
  457. ('bx_ads_category', 'bx_ads', 'type_clone', 'on', '', 0, 'switcher', '_bx_ads_form_category_input_sys_type_clone', '_bx_ads_form_category_input_type_clone', '', 0, 0, 0, 'a:1:{s:8:"onchange";s:33:"oBxAdsStudio.onChangeClone(this);";}', '', '', '', '', '', '', '', 0, 0),
  458. ('bx_ads_category', 'bx_ads', 'type_title', '', '', 0, 'text_translatable', '_bx_ads_form_category_input_sys_type_title', '_bx_ads_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),
  459. ('bx_ads_category', 'bx_ads', 'icon', '', '', 0, 'text', '_bx_ads_form_category_input_sys_icon', '_bx_ads_form_category_input_icon', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  460. ('bx_ads_category', 'bx_ads', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  461. ('bx_ads_category', 'bx_ads', 'do_submit', '_bx_ads_form_category_input_do_submit', '', 0, 'submit', '_bx_ads_form_category_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  462. ('bx_ads_category', 'bx_ads', 'do_cancel', '_bx_ads_form_category_input_do_cancel', '', 0, 'button', '_bx_ads_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);
  463. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  464. ('bx_ads_category_add', 'parent_id', 2147483647, 1, 1),
  465. ('bx_ads_category_add', 'type', 2147483647, 1, 2),
  466. ('bx_ads_category_add', 'type_clone', 2147483647, 1, 3),
  467. ('bx_ads_category_add', 'type_title', 2147483647, 1, 4),
  468. ('bx_ads_category_add', 'title', 2147483647, 1, 5),
  469. ('bx_ads_category_add', 'text', 2147483647, 1, 6),
  470. ('bx_ads_category_add', 'icon', 2147483647, 1, 7),
  471. ('bx_ads_category_add', 'controls', 2147483647, 1, 8),
  472. ('bx_ads_category_add', 'do_submit', 2147483647, 1, 9),
  473. ('bx_ads_category_add', 'do_cancel', 2147483647, 1, 10),
  474. ('bx_ads_category_delete', 'delete_confirm', 2147483647, 1, 1),
  475. ('bx_ads_category_delete', 'do_submit', 2147483647, 1, 2),
  476. ('bx_ads_category_edit', 'parent_id', 2147483647, 1, 1),
  477. ('bx_ads_category_edit', 'title', 2147483647, 1, 2),
  478. ('bx_ads_category_edit', 'text', 2147483647, 1, 3),
  479. ('bx_ads_category_edit', 'icon', 2147483647, 1, 4),
  480. ('bx_ads_category_edit', 'controls', 2147483647, 1, 5),
  481. ('bx_ads_category_edit', 'do_submit', 2147483647, 1, 6),
  482. ('bx_ads_category_edit', 'do_cancel', 2147483647, 1, 7);
  483. -- FORMS: entry (ad)
  484. 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
  485. ('bx_ads', 'bx_ads', '_bx_ads_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_ads_entries', 'id', '', '', 'a:1:{i:0;s:9:"do_submit";}', '', 0, 1, 'BxAdsFormEntry', 'modules/boonex/ads/classes/BxAdsFormEntry.php');
  486. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  487. ('bx_ads', 'bx_ads_entry_add', 'bx_ads', 0, '_bx_ads_form_entry_display_add'),
  488. ('bx_ads', 'bx_ads_entry_delete', 'bx_ads', 0, '_bx_ads_form_entry_display_delete'),
  489. ('bx_ads', 'bx_ads_entry_price_add', 'bx_ads', 0, '_bx_ads_form_entry_price_display_add'),
  490. ('bx_ads', 'bx_ads_entry_price_edit', 'bx_ads', 0, '_bx_ads_form_entry_price_display_edit'),
  491. ('bx_ads', 'bx_ads_entry_price_view', 'bx_ads', 1, '_bx_ads_form_entry_price_display_view'),
  492. ('bx_ads', 'bx_ads_entry_price_year_add', 'bx_ads', 0, '_bx_ads_form_entry_price_year_display_add'),
  493. ('bx_ads', 'bx_ads_entry_price_year_edit', 'bx_ads', 0, '_bx_ads_form_entry_price_year_display_edit'),
  494. ('bx_ads', 'bx_ads_entry_price_year_view', 'bx_ads', 1, '_bx_ads_form_entry_price_year_display_view');
  495. 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
  496. ('bx_ads', 'bx_ads', 'allow_view_to', '', '', 0, 'custom', '_bx_ads_form_entry_input_sys_allow_view_to', '_bx_ads_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  497. ('bx_ads', 'bx_ads', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_ads_form_entry_input_sys_delete_confirm', '_bx_ads_form_entry_input_delete_confirm', '_bx_ads_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ads_form_entry_input_delete_confirm_error', '', '', 1, 0),
  498. ('bx_ads', 'bx_ads', 'do_submit', '_bx_ads_form_entry_input_do_submit', '', 0, 'submit', '_bx_ads_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  499. ('bx_ads', 'bx_ads', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  500. ('bx_ads', 'bx_ads', 'covers', 'a:1:{i:0;s:12:"bx_ads_html5";}', 'a:2:{s:13:"bx_ads_simple";s:26:"_sys_uploader_simple_title";s:12:"bx_ads_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_ads_form_entry_input_sys_covers', '_bx_ads_form_entry_input_covers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  501. ('bx_ads', 'bx_ads', 'pictures', 'a:1:{i:0;s:19:"bx_ads_photos_html5";}', 'a:2:{s:20:"bx_ads_photos_simple";s:26:"_sys_uploader_simple_title";s:19:"bx_ads_photos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_ads_form_entry_input_sys_pictures', '_bx_ads_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  502. ('bx_ads', 'bx_ads', 'videos', 'a:1:{i:0;s:19:"bx_ads_videos_html5";}', 'a:2:{s:20:"bx_ads_videos_simple";s:26:"_sys_uploader_simple_title";s:19:"bx_ads_videos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_ads_form_entry_input_sys_videos', '_bx_ads_form_entry_input_videos', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  503. ('bx_ads', 'bx_ads', 'files', 'a:1:{i:0;s:18:"bx_ads_files_html5";}', 'a:2:{s:19:"bx_ads_files_simple";s:26:"_sys_uploader_simple_title";s:18:"bx_ads_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_ads_form_entry_input_sys_files', '_bx_ads_form_entry_input_files', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  504. ('bx_ads', 'bx_ads', 'polls', '', '', 0, 'custom', '_bx_ads_form_entry_input_sys_polls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  505. ('bx_ads', 'bx_ads', 'text', '', '', 0, 'textarea', '_bx_ads_form_entry_input_sys_text', '_bx_ads_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_ads_form_entry_input_text_err', 'XssHtml', '', 1, 0),
  506. ('bx_ads', 'bx_ads', 'title', '', '', 0, 'text', '_bx_ads_form_entry_input_sys_title', '_bx_ads_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ads_form_entry_input_title_err', 'Xss', '', 1, 0),
  507. ('bx_ads', 'bx_ads', 'price', '', '', 0, 'text', '_bx_ads_form_entry_input_sys_price', '_bx_ads_form_entry_input_price', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  508. ('bx_ads', 'bx_ads', 'year', '', '', 0, 'text', '_bx_ads_form_entry_input_sys_year', '_bx_ads_form_entry_input_year', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  509. ('bx_ads', 'bx_ads', 'category', '', '', 0, 'hidden', '_bx_ads_form_entry_input_sys_category', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
  510. ('bx_ads', 'bx_ads', 'category_view', '', '', 0, 'text', '_bx_ads_form_entry_input_sys_category_view', '_bx_ads_form_entry_input_category_view', '', 0, 0, 0, 'a:1:{s:8:"disabled";s:8:"disabled";}', '', '', '', '', '', '', '', 1, 0),
  511. ('bx_ads', 'bx_ads', 'category_select', '', '', 0, 'select', '_bx_ads_form_entry_input_sys_category_select', '_bx_ads_form_entry_input_category_select', '', 1, 0, 0, 'a:1:{s:8:"onchange";s:35:"oBxAdsEntry.onChangeCategory(this);";}', '', '', '', '', '', '', '', 0, 0),
  512. ('bx_ads', 'bx_ads', 'added', '', '', 0, 'datetime', '_bx_ads_form_entry_input_sys_date_added', '_bx_ads_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  513. ('bx_ads', 'bx_ads', 'changed', '', '', 0, 'datetime', '_bx_ads_form_entry_input_sys_date_changed', '_bx_ads_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  514. ('bx_ads', 'bx_ads', 'attachments', '', '', 0, 'custom', '_bx_ads_form_entry_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  515. ('bx_ads', 'bx_ads', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  516. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  517. ('bx_ads_entry_add', 'category_select', 2147483647, 1, 1),
  518. ('bx_ads_entry_delete', 'delete_confirm', 2147483647, 1, 1),
  519. ('bx_ads_entry_delete', 'do_submit', 2147483647, 1, 2),
  520. ('bx_ads_entry_price_add', 'category', 2147483647, 1, 1),
  521. ('bx_ads_entry_price_add', 'category_view', 2147483647, 1, 2),
  522. ('bx_ads_entry_price_add', 'title', 2147483647, 1, 3),
  523. ('bx_ads_entry_price_add', 'price', 2147483647, 1, 4),
  524. ('bx_ads_entry_price_add', 'text', 2147483647, 1, 5),
  525. ('bx_ads_entry_price_add', 'attachments', 2147483647, 1, 6),
  526. ('bx_ads_entry_price_add', 'pictures', 2147483647, 1, 7),
  527. ('bx_ads_entry_price_add', 'videos', 2147483647, 1, 8),
  528. ('bx_ads_entry_price_add', 'files', 2147483647, 1, 9),
  529. ('bx_ads_entry_price_add', 'polls', 2147483647, 1, 10),
  530. ('bx_ads_entry_price_add', 'covers', 2147483647, 1, 11),
  531. ('bx_ads_entry_price_add', 'allow_view_to', 2147483647, 1, 12),
  532. ('bx_ads_entry_price_add', 'location', 2147483647, 1, 13),
  533. ('bx_ads_entry_price_add', 'do_submit', 2147483647, 1, 14),
  534. ('bx_ads_entry_price_edit', 'category_view', 2147483647, 1, 1),
  535. ('bx_ads_entry_price_edit', 'title', 2147483647, 1, 2),
  536. ('bx_ads_entry_price_edit', 'price', 2147483647, 1, 3),
  537. ('bx_ads_entry_price_edit', 'text', 2147483647, 1, 4),
  538. ('bx_ads_entry_price_edit', 'attachments', 2147483647, 1, 5),
  539. ('bx_ads_entry_price_edit', 'pictures', 2147483647, 1, 6),
  540. ('bx_ads_entry_price_edit', 'videos', 2147483647, 1, 7),
  541. ('bx_ads_entry_price_edit', 'files', 2147483647, 1, 8),
  542. ('bx_ads_entry_price_edit', 'polls', 2147483647, 1, 9),
  543. ('bx_ads_entry_price_edit', 'covers', 2147483647, 1, 10),
  544. ('bx_ads_entry_price_edit', 'allow_view_to', 2147483647, 1, 11),
  545. ('bx_ads_entry_price_edit', 'location', 2147483647, 1, 12),
  546. ('bx_ads_entry_price_edit', 'do_submit', 2147483647, 1, 13),
  547. ('bx_ads_entry_price_view', 'category_view', 2147483647, 1, 1),
  548. ('bx_ads_entry_price_view', 'price', 2147483647, 1, 2),
  549. ('bx_ads_entry_price_view', 'added', 2147483647, 1, 3),
  550. ('bx_ads_entry_price_view', 'changed', 2147483647, 1, 4),
  551. ('bx_ads_entry_price_year_add', 'category', 2147483647, 1, 1),
  552. ('bx_ads_entry_price_year_add', 'category_view', 2147483647, 1, 2),
  553. ('bx_ads_entry_price_year_add', 'title', 2147483647, 1, 3),
  554. ('bx_ads_entry_price_year_add', 'price', 2147483647, 1, 4),
  555. ('bx_ads_entry_price_year_add', 'year', 2147483647, 1, 5),
  556. ('bx_ads_entry_price_year_add', 'text', 2147483647, 1, 6),
  557. ('bx_ads_entry_price_year_add', 'attachments', 2147483647, 1, 7),
  558. ('bx_ads_entry_price_year_add', 'pictures', 2147483647, 1, 8),
  559. ('bx_ads_entry_price_year_add', 'videos', 2147483647, 1, 9),
  560. ('bx_ads_entry_price_year_add', 'files', 2147483647, 1, 10),
  561. ('bx_ads_entry_price_year_add', 'polls', 2147483647, 1, 11),
  562. ('bx_ads_entry_price_year_add', 'covers', 2147483647, 1, 12),
  563. ('bx_ads_entry_price_year_add', 'allow_view_to', 2147483647, 1, 13),
  564. ('bx_ads_entry_price_year_add', 'location', 2147483647, 1, 14),
  565. ('bx_ads_entry_price_year_add', 'do_submit', 2147483647, 1, 15),
  566. ('bx_ads_entry_price_year_edit', 'category_view', 2147483647, 1, 1),
  567. ('bx_ads_entry_price_year_edit', 'title', 2147483647, 1, 2),
  568. ('bx_ads_entry_price_year_edit', 'price', 2147483647, 1, 3),
  569. ('bx_ads_entry_price_year_edit', 'year', 2147483647, 1, 4),
  570. ('bx_ads_entry_price_year_edit', 'text', 2147483647, 1, 5),
  571. ('bx_ads_entry_price_year_edit', 'attachments', 2147483647, 1, 6),
  572. ('bx_ads_entry_price_year_edit', 'pictures', 2147483647, 1, 7),
  573. ('bx_ads_entry_price_year_edit', 'videos', 2147483647, 1, 8),
  574. ('bx_ads_entry_price_year_edit', 'files', 2147483647, 1, 9),
  575. ('bx_ads_entry_price_year_edit', 'polls', 2147483647, 1, 10),
  576. ('bx_ads_entry_price_year_edit', 'covers', 2147483647, 1, 11),
  577. ('bx_ads_entry_price_year_edit', 'allow_view_to', 2147483647, 1, 12),
  578. ('bx_ads_entry_price_year_edit', 'location', 2147483647, 1, 13),
  579. ('bx_ads_entry_price_year_edit', 'do_submit', 2147483647, 1, 14),
  580. ('bx_ads_entry_price_year_view', 'category_view', 2147483647, 1, 1),
  581. ('bx_ads_entry_price_year_view', 'price', 2147483647, 1, 2),
  582. ('bx_ads_entry_price_year_view', 'year', 2147483647, 1, 3),
  583. ('bx_ads_entry_price_year_view', 'added', 2147483647, 1, 4),
  584. ('bx_ads_entry_price_year_view', 'changed', 2147483647, 1, 5);
  585. -- FORMS: poll
  586. 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
  587. ('bx_ads_poll', 'bx_ads', '_bx_ads_form_poll', '', '', 'do_submit', 'bx_ads_polls', 'id', '', '', 'a:1:{s:14:"checker_helper";s:26:"BxAdsFormPollCheckerHelper";}', 0, 1, 'BxAdsFormPoll', 'modules/boonex/ads/classes/BxAdsFormPoll.php');
  588. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  589. ('bx_ads_poll_add', 'bx_ads', 'bx_ads_poll', '_bx_ads_form_poll_display_add', 0);
  590. 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
  591. ('bx_ads_poll', 'bx_ads', 'text', '', '', 0, 'text', '_bx_ads_form_poll_input_sys_text', '_bx_ads_form_poll_input_text', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ads_form_poll_input_text_err', 'Xss', '', 1, 0),
  592. ('bx_ads_poll', 'bx_ads', 'answers', '', '', 0, 'custom', '_bx_ads_form_poll_input_sys_answers', '_bx_ads_form_poll_input_answers', '', 1, 0, 0, '', '', '', 'AvailAnswers', '', '_bx_ads_form_poll_input_answers_err', '', '', 1, 0),
  593. ('bx_ads_poll', 'bx_ads', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  594. ('bx_ads_poll', 'bx_ads', 'do_submit', '_bx_ads_form_poll_input_do_submit', '', 0, 'submit', '_bx_ads_form_poll_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  595. ('bx_ads_poll', 'bx_ads', 'do_cancel', '_bx_ads_form_poll_input_do_cancel', '', 0, 'button', '_bx_ads_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);
  596. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  597. ('bx_ads_poll_add', 'text', 2147483647, 1, 1),
  598. ('bx_ads_poll_add', 'answers', 2147483647, 1, 2),
  599. ('bx_ads_poll_add', 'controls', 2147483647, 1, 3),
  600. ('bx_ads_poll_add', 'do_submit', 2147483647, 1, 4),
  601. ('bx_ads_poll_add', 'do_cancel', 2147483647, 1, 5);
  602. -- COMMENTS
  603. 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
  604. ('bx_ads', 'bx_ads', 'bx_ads_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-ad&id={object_id}', '', 'bx_ads_entries', 'id', 'author', 'title', 'comments', '', ''),
  605. ('bx_ads_reviews', 'bx_ads', 'bx_ads_reviews', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 0, 1, -3, 1, 'cmt', 'page.php?i=view-ad&id={object_id}', '', 'bx_ads_entries', 'id', 'author', 'title', 'reviews', 'BxTemplCmtsReviews', '');
  606. -- VOTES
  607. INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  608. ('bx_ads', 'bx_ads_votes', 'bx_ads_votes_track', '604800', '1', '1', '0', '1', 'bx_ads_entries', 'id', 'author', 'rate', 'votes', '', ''),
  609. ('bx_ads_reactions', 'bx_ads_reactions', 'bx_ads_reactions_track', '604800', '1', '1', '1', '1', 'bx_ads_entries', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', ''),
  610. ('bx_ads_poll_answers', 'bx_ads_polls_answers_votes', 'bx_ads_polls_answers_votes_track', '604800', '1', '1', '0', '1', 'bx_ads_polls_answers', 'id', 'author_id', 'rate', 'votes', 'BxAdsVotePollAnswers', 'modules/boonex/ads/classes/BxAdsVotePollAnswers.php');
  611. -- SCORES
  612. 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
  613. ('bx_ads', 'bx_ads', 'bx_ads_scores', 'bx_ads_scores_track', '604800', '0', 'bx_ads_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
  614. -- REPORTS
  615. INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  616. ('bx_ads', 'bx_ads', 'bx_ads_reports', 'bx_ads_reports_track', '1', 'page.php?i=view-ad&id={object_id}', 'bx_ads_entries', 'id', 'author', 'reports', '', '');
  617. -- VIEWS
  618. 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
  619. ('bx_ads', 'bx_ads_views_track', '86400', '1', 'bx_ads_entries', 'id', 'author', 'views', '', '');
  620. -- FAFORITES
  621. 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
  622. ('bx_ads', 'bx_ads_favorites_track', '1', '1', '1', 'page.php?i=view-ad&id={object_id}', 'bx_ads_entries', 'id', 'author', 'favorites', '', '');
  623. -- FEATURED
  624. INSERT INTO `sys_objects_feature` (`name`, `module`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES
  625. ('bx_ads', 'bx_ads', '1', '1', 'page.php?i=view-ad&id={object_id}', 'bx_ads_entries', 'id', 'author', 'featured', '', '');
  626. -- CONTENT INFO
  627. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  628. ('bx_ads', '_bx_ads', 'bx_ads', 'added', 'edited', 'deleted', '', ''),
  629. ('bx_ads_cmts', '_bx_ads_cmts', 'bx_ads', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', ''),
  630. ('bx_ads_reviews', '_bx_ads_reviews', 'bx_ads_reviews', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  631. INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
  632. ('bx_ads', 'bx_ads_administration', 'id', '', ''),
  633. ('bx_ads', 'bx_ads_common', 'id', '', '');
  634. -- SEARCH EXTENDED
  635. INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
  636. ('bx_ads', 'bx_ads', 'bx_ads', '_bx_ads_search_extended', 1, '', ''),
  637. ('bx_ads_cmts', 'bx_ads_cmts', 'bx_ads', '_bx_ads_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', ''),
  638. ('bx_ads_reviews', 'bx_ads_reviews', 'bx_ads', '_bx_ads_search_extended_reviews', 1, 'BxTemplSearchExtendedCmts', '');
  639. -- STUDIO: page & widget
  640. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  641. (3, 'bx_ads', '_bx_ads', '_bx_ads', 'bx_ads@modules/boonex/ads/|std-icon.svg');
  642. SET @iPageId = LAST_INSERT_ID();
  643. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  644. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  645. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  646. (@iPageId, 'bx_ads', 'content', '{url_studio}module.php?name=bx_ads', '', 'bx_ads@modules/boonex/ads/|std-icon.svg', '_bx_ads', '', '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";}');
  647. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  648. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));