install.sql 53 KB

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