install.sql 54 KB

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