install.sql 53 KB

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