install.sql 45 KB

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