1
0

install.sql 69 KB

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