install.sql 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  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. `source_type` varchar(32) NOT NULL DEFAULT '',
  11. `source` varchar(255) NOT NULL DEFAULT '',
  12. `category` int(11) NOT NULL,
  13. `thumb` int(11) NOT NULL,
  14. `name` varchar(255) NOT NULL,
  15. `title` varchar(255) NOT NULL,
  16. `url` varchar(255) NOT NULL,
  17. `price` float NOT NULL,
  18. `auction` tinyint(4) NOT NULL DEFAULT '0',
  19. `quantity` int(11) NOT NULL default '1',
  20. `single` tinyint(4) NOT NULL DEFAULT '1',
  21. `year` int(11) NOT NULL,
  22. `text` mediumtext NOT NULL,
  23. `notes_purchased` text NOT NULL,
  24. `labels` text NOT NULL,
  25. `location` text NOT NULL,
  26. `budget_total` float NOT NULL default '0',
  27. `budget_daily` float NOT NULL default '0',
  28. `impressions` int(11) unsigned NOT NULL default '0',
  29. `clicks` int(11) unsigned NOT NULL default '0',
  30. `views` int(11) NOT NULL default '0',
  31. `rate` float NOT NULL default '0',
  32. `votes` int(11) NOT NULL default '0',
  33. `rrate` float NOT NULL default '0',
  34. `rvotes` int(11) NOT NULL default '0',
  35. `score` int(11) NOT NULL default '0',
  36. `sc_up` int(11) NOT NULL default '0',
  37. `sc_down` int(11) NOT NULL default '0',
  38. `favorites` int(11) NOT NULL default '0',
  39. `comments` int(11) NOT NULL default '0',
  40. `reviews` int(11) NOT NULL default '0',
  41. `reviews_avg` float NOT NULL default '0',
  42. `reports` int(11) NOT NULL default '0',
  43. `featured` int(11) NOT NULL default '0',
  44. `cf` int(11) NOT NULL default '1',
  45. `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
  46. `status` enum('active','awaiting','offer','sold','hidden') NOT NULL DEFAULT 'active',
  47. `status_admin` enum('active','hidden','pending','unpaid') NOT NULL DEFAULT 'active',
  48. PRIMARY KEY (`id`),
  49. FULLTEXT KEY `title_text` (`title`,`text`)
  50. );
  51. -- TABLE: types of categories
  52. CREATE TABLE IF NOT EXISTS `bx_ads_categories_types` (
  53. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  54. `name` varchar(64) NOT NULL DEFAULT '',
  55. `title` varchar(255) NOT NULL DEFAULT '',
  56. `display_add` varchar(255) NOT NULL DEFAULT '',
  57. `display_edit` varchar(255) NOT NULL DEFAULT '',
  58. `display_view` varchar(255) NOT NULL DEFAULT '',
  59. PRIMARY KEY (`id`),
  60. UNIQUE KEY `name` (`name`)
  61. );
  62. INSERT INTO `bx_ads_categories_types` (`id`, `name`, `title`, `display_add`, `display_edit`, `display_view`) VALUES
  63. (1, 'price', '_bx_ads_cat_type_price', 'bx_ads_entry_price_add', 'bx_ads_entry_price_edit', 'bx_ads_entry_price_view'),
  64. (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');
  65. -- TABLE: categories
  66. CREATE TABLE IF NOT EXISTS `bx_ads_categories` (
  67. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  68. `parent_id` int(11) unsigned NOT NULL DEFAULT '0',
  69. `level` tinyint(11) unsigned NOT NULL DEFAULT '0',
  70. `type` int(11) NOT NULL DEFAULT '0',
  71. `name` varchar(64) NOT NULL DEFAULT '',
  72. `title` varchar(255) NOT NULL DEFAULT '',
  73. `text` text NOT NULL,
  74. `icon` varchar(255) NOT NULL DEFAULT '',
  75. `items` int(11) NOT NULL DEFAULT '0',
  76. `active` tinyint(4) NOT NULL DEFAULT '1',
  77. `order` int(11) NOT NULL DEFAULT '0',
  78. PRIMARY KEY (`id`),
  79. UNIQUE KEY `name` (`name`),
  80. FULLTEXT KEY `title_text` (`title`,`text`)
  81. );
  82. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  83. (0, 0, 1, 'job', '_bx_ads_cat_title_job', '', 'user-md', 1, 1);
  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, 1, 'job_finance', '_bx_ads_cat_title_accounting_finance', '', '', 1, 1),
  87. (@iParentId, 1, 1, 'job_education', '_bx_ads_cat_title_education_nonprofit', '', '', 1, 2),
  88. (@iParentId, 1, 1, 'job_legal', '_bx_ads_cat_title_government_legal', '', '', 1, 3),
  89. (@iParentId, 1, 1, 'job_programming', '_bx_ads_cat_title_programming_web_design', '', '', 1, 4);
  90. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  91. (0, 0, 2, 'music', '_bx_ads_cat_title_music', '', 'music', 1, 2);
  92. SET @iParentId = LAST_INSERT_ID();
  93. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  94. (@iParentId, 1, 2, 'music_isale', '_bx_ads_cat_title_instrument_sale', '', '', 1, 1),
  95. (@iParentId, 1, 2, 'music_iwanted', '_bx_ads_cat_title_instrument_wanted', '', '', 1, 2);
  96. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  97. (0, 0, 1, 'housing', '_bx_ads_cat_title_housing', '', 'home', 1, 3);
  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, 'housing_apartments', '_bx_ads_cat_title_apartments_housing', '', '', 1, 1),
  101. (@iParentId, 1, 1, 'housing_office', '_bx_ads_cat_title_office_commercial', '', '', 1, 2),
  102. (@iParentId, 1, 1, 'housing_re_sale', '_bx_ads_cat_title_real_estate_sale', '', '', 1, 3),
  103. (@iParentId, 1, 1, 'housing_roommate', '_bx_ads_cat_title_roommate', '', '', 1, 4),
  104. (@iParentId, 1, 1, 'housing_temp_rental', '_bx_ads_cat_title_temporary_rental', '', '', 1, 5);
  105. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  106. (0, 0, 1, 'service', '_bx_ads_cat_title_service', '', 'wrench', 1, 4);
  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, 1, 'service_automotive', '_bx_ads_cat_title_automotive', '', '', 1, 1),
  110. (@iParentId, 1, 1, 'service_educational', '_bx_ads_cat_title_educational', '', '', 1, 2),
  111. (@iParentId, 1, 1, 'service_financial', '_bx_ads_cat_title_financial', '', '', 1, 3),
  112. (@iParentId, 1, 1, 'service_labor', '_bx_ads_cat_title_labor_move', '', '', 1, 4),
  113. (@iParentId, 1, 1, 'service_legal', '_bx_ads_cat_title_legal', '', '', 1, 5);
  114. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  115. (0, 0, 1, 'casting', '_bx_ads_cat_title_casting', '', 'eye', 1, 5);
  116. SET @iParentId = LAST_INSERT_ID();
  117. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  118. (@iParentId, 1, 1, 'casting_acting', '_bx_ads_cat_title_acting', '', '', 1, 1),
  119. (@iParentId, 1, 1, 'casting_dance', '_bx_ads_cat_title_dance', '', '', 1, 2),
  120. (@iParentId, 1, 1, 'casting_modeling', '_bx_ads_cat_title_modeling', '', '', 1, 3),
  121. (@iParentId, 1, 1, 'casting_musician', '_bx_ads_cat_title_musician', '', '', 1, 4),
  122. (@iParentId, 1, 1, 'casting_rshow', '_bx_ads_cat_title_reality_show', '', '', 1, 5);
  123. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  124. (0, 0, 2, 'personal', '_bx_ads_cat_title_personal', '', 'user', 1, 6);
  125. SET @iParentId = LAST_INSERT_ID();
  126. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  127. (@iParentId, 1, 2, 'personal_mw', '_bx_ads_cat_title_men_women', '', '', 1, 1),
  128. (@iParentId, 1, 2, 'personal_wm', '_bx_ads_cat_title_women_men', '', '', 1, 2),
  129. (@iParentId, 1, 2, 'personal_missed', '_bx_ads_cat_title_missed_connection', '', '', 1, 3);
  130. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  131. (0, 0, 2, 'sale', '_bx_ads_cat_title_sale', '', 'shopping-cart', 1, 7);
  132. SET @iParentId = LAST_INSERT_ID();
  133. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  134. (@iParentId, 1, 2, 'sale_barter', '_bx_ads_cat_title_barter', '', '', 1, 1),
  135. (@iParentId, 1, 2, 'sale_clothing', '_bx_ads_cat_title_clothing', '', '', 1, 1),
  136. (@iParentId, 1, 2, 'sale_collectible', '_bx_ads_cat_title_collectible', '', '', 1, 1);
  137. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  138. (0, 0, 2, 'sale_car', '_bx_ads_cat_title_sale_car', '', 'truck', 1, 8);
  139. SET @iParentId = LAST_INSERT_ID();
  140. INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`, `text`, `icon`, `active`, `order`) VALUES
  141. (@iParentId, 1, 2, 'sale_car_part', '_bx_ads_cat_title_auto_part', '', '', 1, 1),
  142. (@iParentId, 1, 2, 'sale_car_auto', '_bx_ads_cat_title_auto_truck', '', '', 1, 2),
  143. (@iParentId, 1, 2, 'sale_car_motorcycle', '_bx_ads_cat_title_motorcycle', '', '', 1, 3);
  144. CREATE TABLE IF NOT EXISTS `bx_ads_interested_track` (
  145. `id` int(11) NOT NULL AUTO_INCREMENT,
  146. `entry_id` int(11) NOT NULL default '0',
  147. `profile_id` int(11) NOT NULL default '0',
  148. `date` int(11) NOT NULL default '0',
  149. PRIMARY KEY (`id`),
  150. KEY `interested` (`entry_id`, `profile_id`)
  151. );
  152. -- TABLE: sources
  153. CREATE TABLE IF NOT EXISTS `bx_ads_sources` (
  154. `id` int(11) NOT NULL auto_increment,
  155. `name` varchar(64) NOT NULL default '',
  156. `caption` varchar(128) NOT NULL default '',
  157. `description` varchar(128) NOT NULL default '',
  158. `option_prefix` varchar(32) NOT NULL default '',
  159. `active` tinyint(4) NOT NULL default '0',
  160. `order` tinyint(4) NOT NULL default '0',
  161. `class_name` varchar(128) NOT NULL default '',
  162. `class_file` varchar(255) NOT NULL default '',
  163. PRIMARY KEY(`id`)
  164. );
  165. CREATE TABLE IF NOT EXISTS `bx_ads_sources_options` (
  166. `id` int(11) NOT NULL auto_increment,
  167. `source_id` varchar(64) NOT NULL default '',
  168. `name` varchar(64) NOT NULL default '',
  169. `type` varchar(64) NOT NULL default 'text',
  170. `caption` varchar(255) NOT NULL default '',
  171. `description` text NOT NULL default '',
  172. `extra` varchar(255) NOT NULL default '',
  173. `check_type` varchar(64) NOT NULL default '',
  174. `check_params` varchar(128) NOT NULL default '',
  175. `check_error` varchar(128) NOT NULL default '',
  176. `order` tinyint(4) NOT NULL default '0',
  177. PRIMARY KEY(`id`),
  178. UNIQUE KEY `name`(`name`)
  179. );
  180. CREATE TABLE IF NOT EXISTS `bx_ads_sources_options_values` (
  181. `id` int(11) NOT NULL auto_increment,
  182. `profile_id` int(11) NOT NULL default '0',
  183. `option_id` int(11) NOT NULL default '0',
  184. `value` varchar(255) NOT NULL default '',
  185. PRIMARY KEY(`id`),
  186. UNIQUE KEY `value`(`profile_id`, `option_id`)
  187. );
  188. -- Shopify (Admin API) source
  189. INSERT INTO `bx_ads_sources`(`name`, `caption`, `description`, `option_prefix`, `active`, `order`, `class_name`) VALUES
  190. ('shopify_admin', '_bx_ads_src_cpt_shopify_admin', '_bx_ads_src_dsc_shopify_admin', 'shf_adm_', 1, 1, 'BxAdsSourceShopifyAdmin');
  191. SET @iSourceId = LAST_INSERT_ID();
  192. INSERT INTO `bx_ads_sources_options`(`source_id`, `name`, `type`, `caption`, `description`, `extra`, `check_type`, `check_params`, `check_error`, `order`) VALUES
  193. (@iSourceId, 'shf_adm_active', 'checkbox', '_bx_ads_src_opt_cpt_active', '_bx_ads_src_opt_dsc_active', '', '', '', '', 1),
  194. (@iSourceId, 'shf_adm_shop_domain', 'text', '_bx_ads_src_opt_cpt_shop_domain', '_bx_ads_src_opt_dsc_shop_domain', '', '', '', '', 2),
  195. (@iSourceId, 'shf_adm_access_token', 'text', '_bx_ads_src_opt_cpt_access_token', '_bx_ads_src_opt_dsc_access_token', '', '', '', '', 3);
  196. -- TABLE: types of categories
  197. CREATE TABLE IF NOT EXISTS `bx_ads_commodities` (
  198. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  199. `entry_id` int(11) NOT NULL default '0',
  200. `type` varchar(16) NOT NULL DEFAULT '',
  201. `amount` float NOT NULL,
  202. `added` int(11) NOT NULL,
  203. PRIMARY KEY (`id`)
  204. );
  205. -- TABLE: licenses
  206. CREATE TABLE IF NOT EXISTS `bx_ads_licenses` (
  207. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  208. `profile_id` int(11) unsigned NOT NULL default '0',
  209. `entry_id` int(11) unsigned NOT NULL default '0',
  210. `count` int(11) unsigned NOT NULL default '0',
  211. `order` varchar(32) NOT NULL default '',
  212. `license` varchar(32) NOT NULL default '',
  213. `added` int(11) unsigned NOT NULL default '0',
  214. `new` tinyint(1) NOT NULL default '1',
  215. PRIMARY KEY (`id`),
  216. KEY `product_id` (`entry_id`, `profile_id`),
  217. KEY `license` (`license`)
  218. );
  219. CREATE TABLE IF NOT EXISTS `bx_ads_licenses_deleted` (
  220. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  221. `profile_id` int(11) unsigned NOT NULL default '0',
  222. `entry_id` int(11) unsigned NOT NULL default '0',
  223. `count` int(11) unsigned NOT NULL default '0',
  224. `order` varchar(32) NOT NULL default '',
  225. `license` varchar(32) NOT NULL default '',
  226. `added` int(11) unsigned NOT NULL default '0',
  227. `new` tinyint(1) NOT NULL default '1',
  228. `reason` varchar(16) NOT NULL default '',
  229. `deleted` int(11) unsigned NOT NULL default '0',
  230. PRIMARY KEY (`id`),
  231. KEY `product_id` (`entry_id`,`profile_id`),
  232. KEY `license` (`license`)
  233. );
  234. -- TABLE: promotions
  235. CREATE TABLE IF NOT EXISTS `bx_ads_promo_licenses` (
  236. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  237. `profile_id` int(11) unsigned NOT NULL default '0',
  238. `commodity_id` int(11) unsigned NOT NULL default '0',
  239. `entry_id` int(11) unsigned NOT NULL default '0',
  240. `amount` float NOT NULL default '0',
  241. `order` varchar(32) NOT NULL default '',
  242. `license` varchar(32) NOT NULL default '',
  243. `added` int(11) unsigned NOT NULL default '0',
  244. PRIMARY KEY (`id`),
  245. KEY `license` (`license`)
  246. );
  247. CREATE TABLE IF NOT EXISTS `bx_ads_promo_licenses_deleted` (
  248. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  249. `profile_id` int(11) unsigned NOT NULL default '0',
  250. `commodity_id` int(11) unsigned NOT NULL default '0',
  251. `entry_id` int(11) unsigned NOT NULL default '0',
  252. `amount` float NOT NULL default '0',
  253. `order` varchar(32) NOT NULL default '',
  254. `license` varchar(32) NOT NULL default '',
  255. `added` int(11) unsigned NOT NULL default '0',
  256. `reason` varchar(16) NOT NULL default '',
  257. `deleted` int(11) unsigned NOT NULL default '0',
  258. PRIMARY KEY (`id`),
  259. KEY `license` (`license`)
  260. );
  261. CREATE TABLE IF NOT EXISTS `bx_ads_promo_tracker` (
  262. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  263. `entry_id` int(11) unsigned NOT NULL default '0',
  264. `date` int(11) unsigned NOT NULL default '0',
  265. `impressions` int(11) unsigned NOT NULL default '0',
  266. `clicks` int(11) unsigned NOT NULL default '0',
  267. PRIMARY KEY (`id`),
  268. UNIQUE KEY `track` (`entry_id`, `date`)
  269. );
  270. -- TABLE: storages & transcoders
  271. CREATE TABLE IF NOT EXISTS `bx_ads_covers` (
  272. `id` int(11) NOT NULL AUTO_INCREMENT,
  273. `profile_id` int(10) unsigned NOT NULL,
  274. `remote_id` varchar(128) NOT NULL,
  275. `path` varchar(255) NOT NULL,
  276. `file_name` varchar(255) NOT NULL,
  277. `mime_type` varchar(128) NOT NULL,
  278. `ext` varchar(32) NOT NULL,
  279. `size` bigint(20) NOT NULL,
  280. `added` int(11) NOT NULL,
  281. `modified` int(11) NOT NULL,
  282. `private` int(11) NOT NULL,
  283. PRIMARY KEY (`id`),
  284. UNIQUE KEY `remote_id` (`remote_id`)
  285. );
  286. CREATE TABLE IF NOT EXISTS `bx_ads_files` (
  287. `id` int(11) NOT NULL AUTO_INCREMENT,
  288. `profile_id` int(10) unsigned NOT NULL,
  289. `remote_id` varchar(128) NOT NULL,
  290. `path` varchar(255) NOT NULL,
  291. `file_name` varchar(255) NOT NULL,
  292. `mime_type` varchar(128) NOT NULL,
  293. `ext` varchar(32) NOT NULL,
  294. `size` bigint(20) NOT NULL,
  295. `added` int(11) NOT NULL,
  296. `modified` int(11) NOT NULL,
  297. `private` int(11) NOT NULL,
  298. PRIMARY KEY (`id`),
  299. UNIQUE KEY `remote_id` (`remote_id`)
  300. );
  301. CREATE TABLE IF NOT EXISTS `bx_ads_photos` (
  302. `id` int(11) NOT NULL AUTO_INCREMENT,
  303. `profile_id` int(10) unsigned NOT NULL,
  304. `remote_id` varchar(128) NOT NULL,
  305. `path` varchar(255) NOT NULL,
  306. `file_name` varchar(255) NOT NULL,
  307. `mime_type` varchar(128) NOT NULL,
  308. `ext` varchar(32) NOT NULL,
  309. `size` bigint(20) NOT NULL,
  310. `added` int(11) NOT NULL,
  311. `modified` int(11) NOT NULL,
  312. `private` int(11) NOT NULL,
  313. PRIMARY KEY (`id`),
  314. UNIQUE KEY `remote_id` (`remote_id`)
  315. );
  316. CREATE TABLE IF NOT EXISTS `bx_ads_photos_resized` (
  317. `id` int(11) NOT NULL AUTO_INCREMENT,
  318. `profile_id` int(10) unsigned NOT NULL,
  319. `remote_id` varchar(128) NOT NULL,
  320. `path` varchar(255) NOT NULL,
  321. `file_name` varchar(255) NOT NULL,
  322. `mime_type` varchar(128) NOT NULL,
  323. `ext` varchar(32) NOT NULL,
  324. `size` bigint(20) NOT NULL,
  325. `added` int(11) NOT NULL,
  326. `modified` int(11) NOT NULL,
  327. `private` int(11) NOT NULL,
  328. PRIMARY KEY (`id`),
  329. UNIQUE KEY `remote_id` (`remote_id`)
  330. );
  331. CREATE TABLE IF NOT EXISTS `bx_ads_videos` (
  332. `id` int(11) NOT NULL AUTO_INCREMENT,
  333. `profile_id` int(10) unsigned NOT NULL,
  334. `remote_id` varchar(128) NOT NULL,
  335. `path` varchar(255) NOT NULL,
  336. `file_name` varchar(255) NOT NULL,
  337. `mime_type` varchar(128) NOT NULL,
  338. `ext` varchar(32) NOT NULL,
  339. `size` bigint(20) NOT NULL,
  340. `dimensions` varchar(12) NOT NULL,
  341. `added` int(11) NOT NULL,
  342. `modified` int(11) NOT NULL,
  343. `private` int(11) NOT NULL,
  344. PRIMARY KEY (`id`),
  345. UNIQUE KEY `remote_id` (`remote_id`)
  346. );
  347. CREATE TABLE IF NOT EXISTS `bx_ads_videos_resized` (
  348. `id` int(11) NOT NULL AUTO_INCREMENT,
  349. `profile_id` int(10) unsigned NOT NULL,
  350. `remote_id` varchar(128) NOT NULL,
  351. `path` varchar(255) NOT NULL,
  352. `file_name` varchar(255) NOT NULL,
  353. `mime_type` varchar(128) NOT NULL,
  354. `ext` varchar(32) NOT NULL,
  355. `size` bigint(20) NOT NULL,
  356. `added` int(11) NOT NULL,
  357. `modified` int(11) NOT NULL,
  358. `private` int(11) NOT NULL,
  359. PRIMARY KEY (`id`),
  360. UNIQUE KEY `remote_id` (`remote_id`)
  361. );
  362. -- TABLE: comments
  363. CREATE TABLE IF NOT EXISTS `bx_ads_cmts` (
  364. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  365. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  366. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  367. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  368. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  369. `cmt_level` int(11) NOT NULL DEFAULT '0',
  370. `cmt_text` text NOT NULL,
  371. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  372. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  373. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  374. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  375. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  376. `cmt_pinned` int(11) NOT NULL default '0',
  377. `cmt_cf` int(11) NOT NULL default '1',
  378. PRIMARY KEY (`cmt_id`),
  379. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  380. FULLTEXT KEY `search_fields` (`cmt_text`)
  381. );
  382. CREATE TABLE IF NOT EXISTS `bx_ads_cmts_notes` (
  383. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  384. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  385. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  386. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  387. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  388. `cmt_level` int(11) NOT NULL DEFAULT '0',
  389. `cmt_text` text NOT NULL,
  390. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  391. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  392. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  393. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  394. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  395. `cmt_pinned` int(11) NOT NULL default '0',
  396. PRIMARY KEY (`cmt_id`),
  397. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  398. FULLTEXT KEY `search_fields` (`cmt_text`)
  399. );
  400. -- TABLE: reviews
  401. CREATE TABLE IF NOT EXISTS `bx_ads_reviews` (
  402. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  403. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  404. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  405. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  406. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  407. `cmt_level` int(11) NOT NULL DEFAULT '0',
  408. `cmt_text` text NOT NULL,
  409. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  410. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  411. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  412. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  413. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  414. `cmt_pinned` int(11) NOT NULL default '0',
  415. `cmt_cf` int(11) NOT NULL default '1',
  416. PRIMARY KEY (`cmt_id`),
  417. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  418. FULLTEXT KEY `search_fields` (`cmt_text`)
  419. );
  420. -- TABLE: votes
  421. CREATE TABLE IF NOT EXISTS `bx_ads_votes` (
  422. `id` int(11) NOT NULL AUTO_INCREMENT,
  423. `object_id` int(11) NOT NULL default '0',
  424. `count` int(11) NOT NULL default '0',
  425. `sum` int(11) NOT NULL default '0',
  426. PRIMARY KEY (`id`),
  427. UNIQUE KEY `object_id` (`object_id`)
  428. );
  429. CREATE TABLE IF NOT EXISTS `bx_ads_votes_track` (
  430. `id` int(11) NOT NULL AUTO_INCREMENT,
  431. `object_id` int(11) NOT NULL default '0',
  432. `author_id` int(11) NOT NULL default '0',
  433. `author_nip` int(11) unsigned NOT NULL default '0',
  434. `value` tinyint(4) NOT NULL default '0',
  435. `date` int(11) NOT NULL default '0',
  436. PRIMARY KEY (`id`),
  437. KEY `vote` (`object_id`, `author_nip`)
  438. );
  439. CREATE TABLE IF NOT EXISTS `bx_ads_reactions` (
  440. `id` int(11) NOT NULL AUTO_INCREMENT,
  441. `object_id` int(11) NOT NULL default '0',
  442. `reaction` varchar(32) NOT NULL default '',
  443. `count` int(11) NOT NULL default '0',
  444. `sum` int(11) NOT NULL default '0',
  445. PRIMARY KEY (`id`),
  446. UNIQUE KEY `reaction` (`object_id`, `reaction`)
  447. );
  448. CREATE TABLE IF NOT EXISTS `bx_ads_reactions_track` (
  449. `id` int(11) NOT NULL AUTO_INCREMENT,
  450. `object_id` int(11) NOT NULL default '0',
  451. `author_id` int(11) NOT NULL default '0',
  452. `author_nip` int(11) unsigned NOT NULL default '0',
  453. `reaction` varchar(32) NOT NULL default '',
  454. `value` tinyint(4) NOT NULL default '0',
  455. `date` int(11) NOT NULL default '0',
  456. PRIMARY KEY (`id`),
  457. KEY `vote` (`object_id`, `author_nip`)
  458. );
  459. -- TABLE: views
  460. CREATE TABLE IF NOT EXISTS `bx_ads_views_track` (
  461. `id` int(11) NOT NULL AUTO_INCREMENT,
  462. `object_id` int(11) NOT NULL default '0',
  463. `viewer_id` int(11) NOT NULL default '0',
  464. `viewer_nip` int(11) unsigned NOT NULL default '0',
  465. `date` int(11) NOT NULL default '0',
  466. PRIMARY KEY (`id`),
  467. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  468. );
  469. -- TABLE: metas
  470. CREATE TABLE IF NOT EXISTS `bx_ads_meta_keywords` (
  471. `id` int(11) NOT NULL AUTO_INCREMENT,
  472. `object_id` int(10) unsigned NOT NULL,
  473. `keyword` varchar(255) NOT NULL,
  474. PRIMARY KEY (`id`),
  475. KEY `object_id` (`object_id`),
  476. KEY `keyword` (`keyword`)
  477. );
  478. CREATE TABLE IF NOT EXISTS `bx_ads_meta_mentions` (
  479. `id` int(11) NOT NULL AUTO_INCREMENT,
  480. `object_id` int(10) unsigned NOT NULL,
  481. `profile_id` int(10) unsigned NOT NULL,
  482. PRIMARY KEY (`id`),
  483. KEY `object_id` (`object_id`),
  484. KEY `profile_id` (`profile_id`)
  485. );
  486. CREATE TABLE IF NOT EXISTS `bx_ads_meta_locations` (
  487. `object_id` int(10) unsigned NOT NULL,
  488. `lat` double NOT NULL,
  489. `lng` double NOT NULL,
  490. `country` varchar(2) NOT NULL,
  491. `state` varchar(255) NOT NULL,
  492. `city` varchar(255) NOT NULL,
  493. `zip` varchar(255) NOT NULL,
  494. `street` varchar(255) NOT NULL,
  495. `street_number` varchar(255) NOT NULL,
  496. PRIMARY KEY (`object_id`),
  497. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  498. );
  499. -- TABLE: reports
  500. CREATE TABLE IF NOT EXISTS `bx_ads_reports` (
  501. `id` int(11) NOT NULL AUTO_INCREMENT,
  502. `object_id` int(11) NOT NULL default '0',
  503. `count` int(11) NOT NULL default '0',
  504. PRIMARY KEY (`id`),
  505. UNIQUE KEY `object_id` (`object_id`)
  506. );
  507. CREATE TABLE IF NOT EXISTS `bx_ads_reports_track` (
  508. `id` int(11) NOT NULL AUTO_INCREMENT,
  509. `object_id` int(11) NOT NULL default '0',
  510. `author_id` int(11) NOT NULL default '0',
  511. `author_nip` int(11) unsigned NOT NULL default '0',
  512. `type` varchar(32) NOT NULL default '',
  513. `text` text NOT NULL default '',
  514. `date` int(11) NOT NULL default '0',
  515. `checked_by` int(11) NOT NULL default '0',
  516. `status` tinyint(11) NOT NULL default '0',
  517. PRIMARY KEY (`id`),
  518. KEY `report` (`object_id`, `author_nip`)
  519. );
  520. -- TABLES: favorites
  521. CREATE TABLE IF NOT EXISTS `bx_ads_favorites_track` (
  522. `id` int(11) NOT NULL AUTO_INCREMENT,
  523. `object_id` int(11) NOT NULL default '0',
  524. `author_id` int(11) NOT NULL default '0',
  525. `list_id` int(11) NOT NULL default '0',
  526. `date` int(11) NOT NULL default '0',
  527. PRIMARY KEY (`id`),
  528. KEY `id` (`object_id`,`author_id`)
  529. );
  530. CREATE TABLE `bx_ads_favorites_lists` (
  531. `id` int(11) NOT NULL AUTO_INCREMENT,
  532. `title` varchar(255) NOT NULL,
  533. `author_id` int(11) NOT NULL default '0',
  534. `date` int(11) NOT NULL default '0',
  535. `allow_view_favorite_list_to` varchar(16) NOT NULL DEFAULT '3',
  536. PRIMARY KEY (`id`)
  537. );
  538. -- TABLE: scores
  539. CREATE TABLE IF NOT EXISTS `bx_ads_scores` (
  540. `id` int(11) NOT NULL AUTO_INCREMENT,
  541. `object_id` int(11) NOT NULL default '0',
  542. `count_up` int(11) NOT NULL default '0',
  543. `count_down` int(11) NOT NULL default '0',
  544. PRIMARY KEY (`id`),
  545. UNIQUE KEY `object_id` (`object_id`)
  546. );
  547. CREATE TABLE IF NOT EXISTS `bx_ads_scores_track` (
  548. `id` int(11) NOT NULL AUTO_INCREMENT,
  549. `object_id` int(11) NOT NULL default '0',
  550. `author_id` int(11) NOT NULL default '0',
  551. `author_nip` int(11) unsigned NOT NULL default '0',
  552. `type` varchar(8) NOT NULL default '',
  553. `date` int(11) NOT NULL default '0',
  554. PRIMARY KEY (`id`),
  555. KEY `vote` (`object_id`, `author_nip`)
  556. );
  557. -- TABLE: polls
  558. CREATE TABLE IF NOT EXISTS `bx_ads_polls` (
  559. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  560. `author_id` int(11) NOT NULL default '0',
  561. `content_id` int(11) NOT NULL default '0',
  562. `text` text NOT NULL,
  563. PRIMARY KEY (`id`),
  564. FULLTEXT KEY `search_fields` (`text`)
  565. );
  566. CREATE TABLE IF NOT EXISTS `bx_ads_polls_answers` (
  567. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  568. `poll_id` int(11) unsigned NOT NULL default '0',
  569. `title` varchar(255) NOT NULL,
  570. `rate` float NOT NULL default '0',
  571. `votes` int(11) NOT NULL default '0',
  572. `order` int(11) NOT NULL default '0',
  573. PRIMARY KEY (`id`),
  574. FULLTEXT KEY `title` (`title`)
  575. );
  576. CREATE TABLE IF NOT EXISTS `bx_ads_polls_answers_votes` (
  577. `id` int(11) NOT NULL AUTO_INCREMENT,
  578. `object_id` int(11) NOT NULL default '0',
  579. `count` int(11) NOT NULL default '0',
  580. `sum` int(11) NOT NULL default '0',
  581. PRIMARY KEY (`id`),
  582. UNIQUE KEY `object_id` (`object_id`)
  583. );
  584. CREATE TABLE IF NOT EXISTS `bx_ads_polls_answers_votes_track` (
  585. `id` int(11) NOT NULL AUTO_INCREMENT,
  586. `object_id` int(11) NOT NULL default '0',
  587. `author_id` int(11) NOT NULL default '0',
  588. `author_nip` int(11) unsigned NOT NULL default '0',
  589. `value` tinyint(4) NOT NULL default '0',
  590. `date` int(11) NOT NULL default '0',
  591. PRIMARY KEY (`id`),
  592. KEY `vote` (`object_id`, `author_nip`)
  593. );
  594. -- TABLE: offers
  595. CREATE TABLE IF NOT EXISTS `bx_ads_offers` (
  596. `id` int(11) NOT NULL AUTO_INCREMENT,
  597. `content_id` int(11) NOT NULL default '0',
  598. `author_id` int(11) NOT NULL default '0',
  599. `added` int(11) NOT NULL default '0',
  600. `changed` int(11) NOT NULL default '0',
  601. `amount` float NOT NULL default '0',
  602. `quantity` int(11) NOT NULL default '0',
  603. `message` text NOT NULL,
  604. `status` enum('accepted','awaiting','declined','canceled','paid') NOT NULL DEFAULT 'awaiting',
  605. PRIMARY KEY (`id`)
  606. );
  607. -- STORAGES & TRANSCODERS
  608. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  609. 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
  610. ('bx_ads_covers', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_covers', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0),
  611. ('bx_ads_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_photos', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0),
  612. ('bx_ads_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_photos_resized', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0),
  613. ('bx_ads_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_videos', 'allow-deny', '{video}', '', 0, 0, 0, 0, 0, 0),
  614. ('bx_ads_videos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_videos_resized', 'allow-deny', '{imagevideo}', '', 0, 0, 0, 0, 0, 0),
  615. ('bx_ads_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_ads_files', 'deny-allow', '', '{dangerous}', 0, 0, 0, 0, 0, 0);
  616. 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
  617. ('bx_ads_preview', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_covers";}', 'no', '1', '2592000', '0', '', ''),
  618. ('bx_ads_gallery', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_covers";}', 'no', '1', '2592000', '0', '', ''),
  619. ('bx_ads_cover', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_covers";}', 'no', '1', '2592000', '0', '', ''),
  620. ('bx_ads_preview_photos', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_photos";}', 'no', '1', '2592000', '0', '', ''),
  621. ('bx_ads_gallery_photos', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_photos";}', 'no', '1', '2592000', '0', '', ''),
  622. ('bx_ads_view_photos', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_photos";}', 'no', '1', '2592000', '0', '', ''),
  623. ('bx_ads_videos_poster', 'bx_ads_videos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  624. ('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', ''),
  625. ('bx_ads_videos_mp4', 'bx_ads_videos_resized', 'Storage', 'a:1:{s:6:"object";s:13:"bx_ads_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  626. ('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', ''),
  627. ('bx_ads_preview_files', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:12:"bx_ads_files";}', 'no', '1', '2592000', '0', '', ''),
  628. ('bx_ads_gallery_files', 'bx_ads_photos_resized', 'Storage', 'a:1:{s:6:"object";s:12:"bx_ads_files";}', 'no', '1', '2592000', '0', '', '');
  629. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  630. ('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'),
  631. ('bx_ads_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  632. ('bx_ads_cover', 'Resize', 'a:1:{s:1:"w";s:4:"1200";}', '0'),
  633. ('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'),
  634. ('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'),
  635. ('bx_ads_view_photos', 'Resize', 'a:2:{s:1:"w";s:4:"1200";s:1:"h";s:4:"1200";}', '0'),
  636. ('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),
  637. ('bx_ads_videos_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
  638. ('bx_ads_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
  639. ('bx_ads_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
  640. ('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),
  641. ('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'),
  642. ('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');
  643. -- FORMS: sources details
  644. 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
  645. ('bx_ads_form_sources_details', 'bx_ads', '_bx_ads_form_sources_details', '', '', 'submit', '', 'id', '', '', 'a:1:{s:14:"checker_helper";s:36:"BxAdsSourcesDetailsFormCheckerHelper";}', 0, 1, 'BxAdsFormSourcesDetails', 'modules/boonex/ads/classes/BxAdsFormSourcesDetails.php');
  646. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  647. ('bx_ads_form_sources_details_edit', 'bx_ads', 'bx_ads_form_sources_details', '_bx_ads_form_sources_details_display_edit', 0);
  648. -- FORMS: category
  649. 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
  650. ('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');
  651. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  652. ('bx_ads_category', 'bx_ads_category_add', 'bx_ads', 0, '_bx_ads_form_category_display_add'),
  653. ('bx_ads_category', 'bx_ads_category_delete', 'bx_ads', 0, '_bx_ads_form_category_display_delete'),
  654. ('bx_ads_category', 'bx_ads_category_edit', 'bx_ads', 0, '_bx_ads_form_category_display_edit');
  655. 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
  656. ('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),
  657. ('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),
  658. ('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),
  659. ('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),
  660. ('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),
  661. ('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),
  662. ('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),
  663. ('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),
  664. ('bx_ads_category', 'bx_ads', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  665. ('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),
  666. ('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);
  667. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  668. ('bx_ads_category_add', 'parent_id', 2147483647, 1, 1),
  669. ('bx_ads_category_add', 'type', 2147483647, 1, 2),
  670. ('bx_ads_category_add', 'type_clone', 2147483647, 1, 3),
  671. ('bx_ads_category_add', 'type_title', 2147483647, 1, 4),
  672. ('bx_ads_category_add', 'title', 2147483647, 1, 5),
  673. ('bx_ads_category_add', 'text', 2147483647, 1, 6),
  674. ('bx_ads_category_add', 'icon', 2147483647, 1, 7),
  675. ('bx_ads_category_add', 'controls', 2147483647, 1, 8),
  676. ('bx_ads_category_add', 'do_submit', 2147483647, 1, 9),
  677. ('bx_ads_category_add', 'do_cancel', 2147483647, 1, 10),
  678. ('bx_ads_category_delete', 'delete_confirm', 2147483647, 1, 1),
  679. ('bx_ads_category_delete', 'do_submit', 2147483647, 1, 2),
  680. ('bx_ads_category_edit', 'parent_id', 2147483647, 1, 1),
  681. ('bx_ads_category_edit', 'title', 2147483647, 1, 2),
  682. ('bx_ads_category_edit', 'text', 2147483647, 1, 3),
  683. ('bx_ads_category_edit', 'icon', 2147483647, 1, 4),
  684. ('bx_ads_category_edit', 'controls', 2147483647, 1, 5),
  685. ('bx_ads_category_edit', 'do_submit', 2147483647, 1, 6),
  686. ('bx_ads_category_edit', 'do_cancel', 2147483647, 1, 7);
  687. -- FORMS: entry (ad)
  688. 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
  689. ('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');
  690. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  691. ('bx_ads', 'bx_ads_entry_add', 'bx_ads', 0, '_bx_ads_form_entry_display_add'),
  692. ('bx_ads', 'bx_ads_entry_edit_budget', 'bx_ads', 0, '_bx_ads_form_entry_display_edit_budget'),
  693. ('bx_ads', 'bx_ads_entry_delete', 'bx_ads', 0, '_bx_ads_form_entry_display_delete'),
  694. ('bx_ads', 'bx_ads_entry_price_add', 'bx_ads', 0, '_bx_ads_form_entry_price_display_add'),
  695. ('bx_ads', 'bx_ads_entry_price_edit', 'bx_ads', 0, '_bx_ads_form_entry_price_display_edit'),
  696. ('bx_ads', 'bx_ads_entry_price_view', 'bx_ads', 1, '_bx_ads_form_entry_price_display_view'),
  697. ('bx_ads', 'bx_ads_entry_price_year_add', 'bx_ads', 0, '_bx_ads_form_entry_price_year_display_add'),
  698. ('bx_ads', 'bx_ads_entry_price_year_edit', 'bx_ads', 0, '_bx_ads_form_entry_price_year_display_edit'),
  699. ('bx_ads', 'bx_ads_entry_price_year_view', 'bx_ads', 1, '_bx_ads_form_entry_price_year_display_view');
  700. 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
  701. ('bx_ads', 'bx_ads', 'cf', '1', '#!sys_content_filter', 0, 'select', '_sys_form_entry_input_sys_cf', '_sys_form_entry_input_cf', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  702. ('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),
  703. ('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),
  704. ('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),
  705. ('bx_ads', 'bx_ads', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  706. ('bx_ads', 'bx_ads', 'covers', 'a:1:{i:0;s:12:"bx_ads_html5";}', 'a:1:{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),
  707. ('bx_ads', 'bx_ads', 'pictures', 'a:1:{i:0;s:19:"bx_ads_photos_html5";}', 'a:1:{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),
  708. ('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:2:{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),
  709. ('bx_ads', 'bx_ads', 'files', 'a:1:{i:0;s:18:"bx_ads_files_html5";}', 'a:1:{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),
  710. ('bx_ads', 'bx_ads', 'polls', '', '', 0, 'custom', '_bx_ads_form_entry_input_sys_polls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  711. ('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),
  712. ('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),
  713. ('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),
  714. ('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),
  715. ('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),
  716. ('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),
  717. ('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),
  718. ('bx_ads', 'bx_ads', 'category', '', '', 0, 'hidden', '_bx_ads_form_entry_input_sys_category', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
  719. ('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),
  720. ('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, '', '', '', 'Avail', '', '_bx_ads_form_entry_input_category_select_err', 'Int', '', 0, 0),
  721. ('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),
  722. ('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),
  723. ('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),
  724. ('bx_ads', 'bx_ads', 'attachments', '', '', 0, 'custom', '_bx_ads_form_entry_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  725. ('bx_ads', 'bx_ads', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  726. ('bx_ads', 'bx_ads', 'source_type', '', '', 0, 'hidden', '_bx_ads_form_entry_input_sys_source_type', '_bx_ads_form_entry_input_source_type', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  727. ('bx_ads', 'bx_ads', 'source', '', '', 0, 'text', '_bx_ads_form_entry_input_sys_source', '_bx_ads_form_entry_input_source', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  728. ('bx_ads', 'bx_ads', 'url', '', '', 0, 'hidden', '_bx_ads_form_entry_input_sys_url', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  729. ('bx_ads', 'bx_ads', 'budget_total', '', '', 0, 'text', '_bx_ads_form_entry_input_sys_budget_total', '_bx_ads_form_entry_input_budget_total', '', 0, 0, 0, '', '', '', '', '', '', 'Float', '', 1, 0),
  730. ('bx_ads', 'bx_ads', 'budget_daily', '', '', 0, 'text', '_bx_ads_form_entry_input_sys_budget_daily', '_bx_ads_form_entry_input_budget_daily', '', 0, 0, 0, '', '', '', '', '', '', 'Float', '', 1, 0);
  731. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  732. ('bx_ads_entry_add', 'category_select', 2147483647, 1, 1),
  733. ('bx_ads_entry_add', 'do_submit', 2147483647, 1, 2),
  734. ('bx_ads_entry_edit_budget', 'budget_total', 2147483647, 1, 1),
  735. ('bx_ads_entry_edit_budget', 'budget_daily', 2147483647, 1, 2),
  736. ('bx_ads_entry_edit_budget', 'do_submit', 2147483647, 1, 3),
  737. ('bx_ads_entry_delete', 'delete_confirm', 2147483647, 1, 1),
  738. ('bx_ads_entry_delete', 'do_submit', 2147483647, 1, 2),
  739. ('bx_ads_entry_price_add', 'url', 2147483647, 1, 0),
  740. ('bx_ads_entry_price_add', 'source_type', 2147483647, 1, 1),
  741. ('bx_ads_entry_price_add', 'source', 2147483647, 1, 2),
  742. ('bx_ads_entry_price_add', 'category', 2147483647, 1, 3),
  743. ('bx_ads_entry_price_add', 'category_view', 2147483647, 1, 4),
  744. ('bx_ads_entry_price_add', 'title', 2147483647, 1, 5),
  745. ('bx_ads_entry_price_add', 'name', 2147483647, 1, 6),
  746. ('bx_ads_entry_price_add', 'price', 2147483647, 1, 7),
  747. ('bx_ads_entry_price_add', 'auction', 2147483647, 1, 8),
  748. ('bx_ads_entry_price_add', 'quantity', 2147483647, 1, 9),
  749. ('bx_ads_entry_price_add', 'text', 2147483647, 1, 10),
  750. ('bx_ads_entry_price_add', 'attachments', 2147483647, 1, 11),
  751. ('bx_ads_entry_price_add', 'pictures', 2147483647, 1, 12),
  752. ('bx_ads_entry_price_add', 'videos', 2147483647, 1, 13),
  753. ('bx_ads_entry_price_add', 'files', 2147483647, 1, 14),
  754. ('bx_ads_entry_price_add', 'polls', 2147483647, 1, 15),
  755. ('bx_ads_entry_price_add', 'covers', 2147483647, 1, 16),
  756. ('bx_ads_entry_price_add', 'budget_total', 2147483647, 1, 17),
  757. ('bx_ads_entry_price_add', 'budget_daily', 2147483647, 1, 18),
  758. ('bx_ads_entry_price_add', 'allow_view_to', 2147483647, 1, 19),
  759. ('bx_ads_entry_price_add', 'cf', 2147483647, 1, 20),
  760. ('bx_ads_entry_price_add', 'notes_purchased', 2147483647, 1, 21),
  761. ('bx_ads_entry_price_add', 'location', 2147483647, 1, 22),
  762. ('bx_ads_entry_price_add', 'do_submit', 2147483647, 1, 23),
  763. ('bx_ads_entry_price_edit', 'source_type', 2147483647, 1, 1),
  764. ('bx_ads_entry_price_edit', 'source', 2147483647, 1, 2),
  765. ('bx_ads_entry_price_edit', 'category_view', 2147483647, 1, 3),
  766. ('bx_ads_entry_price_edit', 'title', 2147483647, 1, 4),
  767. ('bx_ads_entry_price_edit', 'name', 2147483647, 1, 5),
  768. ('bx_ads_entry_price_edit', 'price', 2147483647, 1, 6),
  769. ('bx_ads_entry_price_edit', 'auction', 2147483647, 1, 7),
  770. ('bx_ads_entry_price_edit', 'quantity', 2147483647, 1, 8),
  771. ('bx_ads_entry_price_edit', 'text', 2147483647, 1, 9),
  772. ('bx_ads_entry_price_edit', 'attachments', 2147483647, 1, 10),
  773. ('bx_ads_entry_price_edit', 'pictures', 2147483647, 1, 11),
  774. ('bx_ads_entry_price_edit', 'videos', 2147483647, 1, 12),
  775. ('bx_ads_entry_price_edit', 'files', 2147483647, 1, 13),
  776. ('bx_ads_entry_price_edit', 'polls', 2147483647, 1, 14),
  777. ('bx_ads_entry_price_edit', 'covers', 2147483647, 1, 15),
  778. ('bx_ads_entry_price_edit', 'allow_view_to', 2147483647, 1, 16),
  779. ('bx_ads_entry_price_edit', 'cf', 2147483647, 1, 17),
  780. ('bx_ads_entry_price_edit', 'notes_purchased', 2147483647, 1, 18),
  781. ('bx_ads_entry_price_edit', 'location', 2147483647, 1, 19),
  782. ('bx_ads_entry_price_edit', 'do_submit', 2147483647, 1, 20),
  783. ('bx_ads_entry_price_view', 'category_view', 2147483647, 1, 1),
  784. ('bx_ads_entry_price_view', 'price', 2147483647, 1, 2),
  785. ('bx_ads_entry_price_view', 'added', 2147483647, 1, 3),
  786. ('bx_ads_entry_price_view', 'changed', 2147483647, 1, 4),
  787. ('bx_ads_entry_price_year_add', 'url', 2147483647, 1, 0),
  788. ('bx_ads_entry_price_year_add', 'source_type', 2147483647, 1, 1),
  789. ('bx_ads_entry_price_year_add', 'source', 2147483647, 1, 2),
  790. ('bx_ads_entry_price_year_add', 'category', 2147483647, 1, 3),
  791. ('bx_ads_entry_price_year_add', 'category_view', 2147483647, 1, 4),
  792. ('bx_ads_entry_price_year_add', 'title', 2147483647, 1, 5),
  793. ('bx_ads_entry_price_year_add', 'name', 2147483647, 1, 6),
  794. ('bx_ads_entry_price_year_add', 'price', 2147483647, 1, 7),
  795. ('bx_ads_entry_price_year_add', 'auction', 2147483647, 1, 8),
  796. ('bx_ads_entry_price_year_add', 'quantity', 2147483647, 1, 9),
  797. ('bx_ads_entry_price_year_add', 'year', 2147483647, 1, 10),
  798. ('bx_ads_entry_price_year_add', 'text', 2147483647, 1, 11),
  799. ('bx_ads_entry_price_year_add', 'attachments', 2147483647, 1, 12),
  800. ('bx_ads_entry_price_year_add', 'pictures', 2147483647, 1, 13),
  801. ('bx_ads_entry_price_year_add', 'videos', 2147483647, 1, 14),
  802. ('bx_ads_entry_price_year_add', 'files', 2147483647, 1, 15),
  803. ('bx_ads_entry_price_year_add', 'polls', 2147483647, 1, 16),
  804. ('bx_ads_entry_price_year_add', 'covers', 2147483647, 1, 17),
  805. ('bx_ads_entry_price_year_add', 'budget_total', 2147483647, 1, 18),
  806. ('bx_ads_entry_price_year_add', 'budget_daily', 2147483647, 1, 19),
  807. ('bx_ads_entry_price_year_add', 'allow_view_to', 2147483647, 1, 20),
  808. ('bx_ads_entry_price_year_add', 'cf', 2147483647, 1, 21),
  809. ('bx_ads_entry_price_year_add', 'notes_purchased', 2147483647, 1, 22),
  810. ('bx_ads_entry_price_year_add', 'location', 2147483647, 1, 23),
  811. ('bx_ads_entry_price_year_add', 'do_submit', 2147483647, 1, 24),
  812. ('bx_ads_entry_price_year_edit', 'source_type', 2147483647, 1, 1),
  813. ('bx_ads_entry_price_year_edit', 'source', 2147483647, 1, 2),
  814. ('bx_ads_entry_price_year_edit', 'category_view', 2147483647, 1, 3),
  815. ('bx_ads_entry_price_year_edit', 'title', 2147483647, 1, 4),
  816. ('bx_ads_entry_price_year_edit', 'name', 2147483647, 1, 5),
  817. ('bx_ads_entry_price_year_edit', 'price', 2147483647, 1, 6),
  818. ('bx_ads_entry_price_year_edit', 'auction', 2147483647, 1, 7),
  819. ('bx_ads_entry_price_year_edit', 'quantity', 2147483647, 1, 8),
  820. ('bx_ads_entry_price_year_edit', 'year', 2147483647, 1, 9),
  821. ('bx_ads_entry_price_year_edit', 'text', 2147483647, 1, 10),
  822. ('bx_ads_entry_price_year_edit', 'attachments', 2147483647, 1, 11),
  823. ('bx_ads_entry_price_year_edit', 'pictures', 2147483647, 1, 12),
  824. ('bx_ads_entry_price_year_edit', 'videos', 2147483647, 1, 13),
  825. ('bx_ads_entry_price_year_edit', 'files', 2147483647, 1, 14),
  826. ('bx_ads_entry_price_year_edit', 'polls', 2147483647, 1, 15),
  827. ('bx_ads_entry_price_year_edit', 'covers', 2147483647, 1, 16),
  828. ('bx_ads_entry_price_year_edit', 'allow_view_to', 2147483647, 1, 17),
  829. ('bx_ads_entry_price_year_edit', 'cf', 2147483647, 1, 18),
  830. ('bx_ads_entry_price_year_edit', 'notes_purchased', 2147483647, 1, 19),
  831. ('bx_ads_entry_price_year_edit', 'location', 2147483647, 1, 20),
  832. ('bx_ads_entry_price_year_edit', 'do_submit', 2147483647, 1, 21),
  833. ('bx_ads_entry_price_year_view', 'category_view', 2147483647, 1, 1),
  834. ('bx_ads_entry_price_year_view', 'price', 2147483647, 1, 2),
  835. ('bx_ads_entry_price_year_view', 'quantity', 2147483647, 1, 3),
  836. ('bx_ads_entry_price_year_view', 'year', 2147483647, 1, 4),
  837. ('bx_ads_entry_price_year_view', 'added', 2147483647, 1, 5),
  838. ('bx_ads_entry_price_year_view', 'changed', 2147483647, 1, 6);
  839. -- FORMS: poll
  840. 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
  841. ('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');
  842. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  843. ('bx_ads_poll_add', 'bx_ads', 'bx_ads_poll', '_bx_ads_form_poll_display_add', 0);
  844. 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
  845. ('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),
  846. ('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),
  847. ('bx_ads_poll', 'bx_ads', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  848. ('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),
  849. ('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);
  850. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  851. ('bx_ads_poll_add', 'text', 2147483647, 1, 1),
  852. ('bx_ads_poll_add', 'answers', 2147483647, 1, 2),
  853. ('bx_ads_poll_add', 'controls', 2147483647, 1, 3),
  854. ('bx_ads_poll_add', 'do_submit', 2147483647, 1, 4),
  855. ('bx_ads_poll_add', 'do_cancel', 2147483647, 1, 5);
  856. -- FORMS: offer
  857. 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
  858. ('bx_ads_offer', 'bx_ads', '_bx_ads_form_offer', '', '', 'do_submit', 'bx_ads_offers', 'id', '', '', '', 0, 1, 'BxAdsFormOffer', 'modules/boonex/ads/classes/BxAdsFormOffer.php');
  859. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  860. ('bx_ads_offer_add', 'bx_ads', 'bx_ads_offer', '_bx_ads_form_offer_display_add', 0),
  861. ('bx_ads_offer_view', 'bx_ads', 'bx_ads_offer', '_bx_ads_form_offer_display_view', 1);
  862. 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
  863. ('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),
  864. ('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),
  865. ('bx_ads_offer', 'bx_ads', 'total', '', '', 0, 'text', '_bx_ads_form_offer_input_sys_total', '_bx_ads_form_offer_input_total', '', 0, 0, 0, 'a:1:{s:8:"readonly";s:8:"readonly";}', '', '', '', '', '', '', '', 1, 0),
  866. ('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),
  867. ('bx_ads_offer', 'bx_ads', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  868. ('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),
  869. ('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);
  870. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  871. ('bx_ads_offer_add', 'amount', 2147483647, 1, 1),
  872. ('bx_ads_offer_add', 'quantity', 2147483647, 1, 2),
  873. ('bx_ads_offer_add', 'total', 2147483647, 1, 3),
  874. ('bx_ads_offer_add', 'message', 2147483647, 1, 4),
  875. ('bx_ads_offer_add', 'controls', 2147483647, 1, 5),
  876. ('bx_ads_offer_add', 'do_submit', 2147483647, 1, 6),
  877. ('bx_ads_offer_add', 'do_cancel', 2147483647, 1, 7),
  878. ('bx_ads_offer_view', 'amount', 2147483647, 1, 1),
  879. ('bx_ads_offer_view', 'quantity', 2147483647, 1, 2),
  880. ('bx_ads_offer_view', 'total', 2147483647, 1, 3),
  881. ('bx_ads_offer_view', 'message', 2147483647, 1, 4);
  882. -- COMMENTS
  883. 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
  884. ('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', '', ''),
  885. ('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', ''),
  886. ('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', '');
  887. -- VOTES
  888. INSERT INTO `sys_objects_vote` (`Name`, `Module`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  889. ('bx_ads', 'bx_ads', 'bx_ads_votes', 'bx_ads_votes_track', '604800', '1', '1', '0', '1', 'bx_ads_entries', 'id', 'author', 'rate', 'votes', '', ''),
  890. ('bx_ads_reactions', 'bx_ads', 'bx_ads_reactions', 'bx_ads_reactions_track', '604800', '1', '1', '1', '1', 'bx_ads_entries', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', ''),
  891. ('bx_ads_poll_answers', 'bx_ads', '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');
  892. -- SCORES
  893. 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
  894. ('bx_ads', 'bx_ads', 'bx_ads_scores', 'bx_ads_scores_track', '604800', '0', 'bx_ads_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
  895. -- REPORTS
  896. INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `is_on`, `base_url`, `object_comment`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  897. ('bx_ads', 'bx_ads', 'bx_ads_reports', 'bx_ads_reports_track', '1', 'page.php?i=view-ad&id={object_id}', 'bx_ads_notes', 'bx_ads_entries', 'id', 'author', 'reports', '', '');
  898. -- VIEWS
  899. INSERT INTO `sys_objects_view` (`name`, `module`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  900. ('bx_ads', 'bx_ads', 'bx_ads_views_track', '86400', '1', 'bx_ads_entries', 'id', 'author', 'views', '', '');
  901. -- FAFORITES
  902. INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `table_lists`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  903. ('bx_ads', 'bx_ads_favorites_track', 'bx_ads_favorites_lists', '1', '1', '1', 'page.php?i=view-ad&id={object_id}', 'bx_ads_entries', 'id', 'author', 'favorites', '', '');
  904. -- FEATURED
  905. 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
  906. ('bx_ads', 'bx_ads', '1', '1', 'page.php?i=view-ad&id={object_id}', 'bx_ads_entries', 'id', 'author', 'featured', '', '');
  907. -- CONTENT INFO
  908. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  909. ('bx_ads', '_bx_ads', 'bx_ads', 'added', 'edited', 'deleted', '', ''),
  910. ('bx_ads_cmts', '_bx_ads_cmts', 'bx_ads', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', ''),
  911. ('bx_ads_reviews', '_bx_ads_reviews', 'bx_ads_reviews', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  912. INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
  913. ('bx_ads', 'bx_ads_administration', 'id', '', ''),
  914. ('bx_ads', 'bx_ads_common', 'id', '', '');
  915. -- SEARCH EXTENDED
  916. INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
  917. ('bx_ads', 'bx_ads', 'bx_ads', '_bx_ads_search_extended', 1, '', ''),
  918. ('bx_ads_cmts', 'bx_ads_cmts', 'bx_ads', '_bx_ads_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', ''),
  919. ('bx_ads_reviews', 'bx_ads_reviews', 'bx_ads', '_bx_ads_search_extended_reviews', 1, 'BxTemplSearchExtendedCmts', '');
  920. -- STUDIO: page & widget
  921. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  922. (3, 'bx_ads', '_bx_ads', '_bx_ads', 'bx_ads@modules/boonex/ads/|std-icon.svg');
  923. SET @iPageId = LAST_INSERT_ID();
  924. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  925. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  926. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  927. (@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";}');
  928. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  929. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));