install.sql 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  2. -- TABLE: entries
  3. CREATE TABLE IF NOT EXISTS `bx_market_products` (
  4. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  5. `author` int(11) unsigned NOT NULL default '0',
  6. `added` int(11) NOT NULL default '0',
  7. `changed` int(11) NOT NULL default '0',
  8. `thumb` int(11) NOT NULL default '0',
  9. `cover` int(11) NOT NULL default '0',
  10. `package` int(11) NOT NULL default '0',
  11. `name` varchar(255) NOT NULL,
  12. `title` varchar(255) NOT NULL,
  13. `text` text NOT NULL,
  14. `notes` text NOT NULL,
  15. `notes_purchased` text NOT NULL,
  16. `cat` int(11) NOT NULL,
  17. `price_single` float NOT NULL default '0',
  18. `price_recurring` float NOT NULL default '0',
  19. `duration_recurring` varchar(16) NOT NULL default 'month',
  20. `trial_recurring` int(11) NOT NULL default '0',
  21. `views` int(11) NOT NULL default '0',
  22. `rate` float NOT NULL default '0',
  23. `votes` 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. `reports` int(11) NOT NULL default '0',
  30. `featured` int(11) NOT NULL default '0',
  31. `allow_view_to` varchar(32) NOT NULL DEFAULT '3',
  32. `allow_purchase_to` varchar(32) NOT NULL DEFAULT '3',
  33. `allow_comment_to` varchar(32) NOT NULL DEFAULT 'c',
  34. `allow_vote_to` varchar(32) NOT NULL DEFAULT 'c',
  35. `status` enum('active','hidden') NOT NULL DEFAULT 'active',
  36. `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
  37. PRIMARY KEY (`id`),
  38. UNIQUE KEY `name` (`name`(191)),
  39. FULLTEXT KEY `title_text` (`title`,`text`)
  40. );
  41. -- TABLE: subentries
  42. CREATE TABLE IF NOT EXISTS `bx_market_subproducts` (
  43. `id` int(11) NOT NULL AUTO_INCREMENT,
  44. `initiator` int(11) NOT NULL,
  45. `content` int(11) NOT NULL,
  46. `added` int(10) unsigned NOT NULL,
  47. PRIMARY KEY (`id`),
  48. UNIQUE KEY `initiator` (`initiator`,`content`),
  49. KEY `content` (`content`)
  50. );
  51. -- TABLE: licenses
  52. CREATE TABLE IF NOT EXISTS `bx_market_licenses` (
  53. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  54. `profile_id` int(11) unsigned NOT NULL default '0',
  55. `product_id` int(11) unsigned NOT NULL default '0',
  56. `count` int(11) unsigned NOT NULL default '0',
  57. `order` varchar(32) NOT NULL default '',
  58. `license` varchar(32) NOT NULL default '',
  59. `type` varchar(16) NOT NULL default '',
  60. `domain` varchar(128) NOT NULL default '',
  61. `added` int(11) unsigned NOT NULL default '0',
  62. `expired` int(11) unsigned NOT NULL default '0',
  63. `new` tinyint(1) NOT NULL default '1',
  64. PRIMARY KEY (`id`),
  65. KEY `product_id` (`product_id`, `profile_id`),
  66. KEY `license` (`license`)
  67. );
  68. CREATE TABLE IF NOT EXISTS `bx_market_licenses_deleted` (
  69. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  70. `profile_id` int(11) unsigned NOT NULL default '0',
  71. `product_id` int(11) unsigned NOT NULL default '0',
  72. `count` int(11) unsigned NOT NULL default '0',
  73. `order` varchar(32) NOT NULL default '',
  74. `license` varchar(32) NOT NULL default '',
  75. `type` varchar(16) NOT NULL default '',
  76. `domain` varchar(128) NOT NULL default '',
  77. `added` int(11) unsigned NOT NULL default '0',
  78. `expired` int(11) unsigned NOT NULL default '0',
  79. `new` tinyint(1) NOT NULL default '1',
  80. `reason` varchar(16) NOT NULL default '',
  81. `deleted` int(11) unsigned NOT NULL default '0',
  82. PRIMARY KEY (`id`),
  83. KEY `product_id` (`product_id`,`profile_id`),
  84. KEY `license` (`license`)
  85. );
  86. -- TABLE: storages & transcoders
  87. CREATE TABLE IF NOT EXISTS `bx_market_files` (
  88. `id` int(11) NOT NULL AUTO_INCREMENT,
  89. `profile_id` int(10) unsigned NOT NULL,
  90. `remote_id` varchar(128) NOT NULL,
  91. `path` varchar(255) NOT NULL,
  92. `file_name` varchar(255) NOT NULL,
  93. `mime_type` varchar(128) NOT NULL,
  94. `ext` varchar(32) NOT NULL,
  95. `size` int(11) NOT NULL,
  96. `added` int(11) NOT NULL,
  97. `modified` int(11) NOT NULL,
  98. `private` int(11) NOT NULL,
  99. PRIMARY KEY (`id`),
  100. UNIQUE KEY `remote_id` (`remote_id`)
  101. );
  102. CREATE TABLE IF NOT EXISTS `bx_market_files2products` (
  103. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  104. `content_id` int(11) unsigned NOT NULL,
  105. `file_id` int(11) NOT NULL,
  106. `type` enum('version','update') NOT NULL DEFAULT 'version',
  107. `version` varchar(255) NOT NULL,
  108. `version_to` varchar(255) NOT NULL,
  109. `downloads` int(11) NOT NULL,
  110. `order` int(11) NOT NULL,
  111. PRIMARY KEY (`id`),
  112. UNIQUE KEY `file_content` (`file_id`,`content_id`),
  113. KEY `content_id` (`content_id`)
  114. );
  115. CREATE TABLE IF NOT EXISTS `bx_market_downloads_track` (
  116. `id` int(11) NOT NULL AUTO_INCREMENT,
  117. `file_id` int(11) NOT NULL default '0',
  118. `profile_id` int(11) NOT NULL default '0',
  119. `profile_nip` int(11) unsigned NOT NULL default '0',
  120. `date` int(11) NOT NULL default '0',
  121. PRIMARY KEY (`id`)
  122. );
  123. CREATE TABLE IF NOT EXISTS `bx_market_photos` (
  124. `id` int(11) NOT NULL AUTO_INCREMENT,
  125. `profile_id` int(10) unsigned NOT NULL,
  126. `remote_id` varchar(128) NOT NULL,
  127. `path` varchar(255) NOT NULL,
  128. `file_name` varchar(255) NOT NULL,
  129. `mime_type` varchar(128) NOT NULL,
  130. `ext` varchar(32) NOT NULL,
  131. `size` int(11) NOT NULL,
  132. `added` int(11) NOT NULL,
  133. `modified` int(11) NOT NULL,
  134. `private` int(11) NOT NULL,
  135. PRIMARY KEY (`id`),
  136. UNIQUE KEY `remote_id` (`remote_id`)
  137. );
  138. CREATE TABLE IF NOT EXISTS `bx_market_photos2products` (
  139. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  140. `content_id` int(11) unsigned NOT NULL,
  141. `file_id` int(11) NOT NULL,
  142. `title` varchar(255) NOT NULL,
  143. `order` int(11) NOT NULL,
  144. PRIMARY KEY (`id`),
  145. UNIQUE KEY `file_content` (`file_id`,`content_id`),
  146. KEY `content_id` (`content_id`)
  147. );
  148. CREATE TABLE IF NOT EXISTS `bx_market_photos_resized` (
  149. `id` int(11) NOT NULL AUTO_INCREMENT,
  150. `profile_id` int(10) unsigned NOT NULL,
  151. `remote_id` varchar(128) NOT NULL,
  152. `path` varchar(255) NOT NULL,
  153. `file_name` varchar(255) NOT NULL,
  154. `mime_type` varchar(128) NOT NULL,
  155. `ext` varchar(32) NOT NULL,
  156. `size` int(11) NOT NULL,
  157. `added` int(11) NOT NULL,
  158. `modified` int(11) NOT NULL,
  159. `private` int(11) NOT NULL,
  160. PRIMARY KEY (`id`),
  161. UNIQUE KEY `remote_id` (`remote_id`)
  162. );
  163. -- TABLE: comments
  164. CREATE TABLE IF NOT EXISTS `bx_market_cmts` (
  165. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  166. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  167. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  168. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  169. `cmt_author_id` int(10) NOT NULL DEFAULT '0',
  170. `cmt_level` int(11) NOT NULL DEFAULT '0',
  171. `cmt_text` text NOT NULL,
  172. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  173. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  174. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  175. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  176. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  177. PRIMARY KEY (`cmt_id`),
  178. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  179. FULLTEXT KEY `search_fields` (`cmt_text`)
  180. );
  181. -- TABLE: votes
  182. CREATE TABLE IF NOT EXISTS `bx_market_votes` (
  183. `object_id` int(11) NOT NULL default '0',
  184. `count` int(11) NOT NULL default '0',
  185. `sum` int(11) NOT NULL default '0',
  186. UNIQUE KEY `object_id` (`object_id`)
  187. );
  188. CREATE TABLE IF NOT EXISTS `bx_market_votes_track` (
  189. `id` int(11) NOT NULL AUTO_INCREMENT,
  190. `object_id` int(11) NOT NULL default '0',
  191. `author_id` int(11) NOT NULL default '0',
  192. `author_nip` int(11) unsigned NOT NULL default '0',
  193. `value` tinyint(4) NOT NULL default '0',
  194. `date` int(11) NOT NULL default '0',
  195. PRIMARY KEY (`id`),
  196. KEY `vote` (`object_id`, `author_nip`)
  197. );
  198. -- TABLE: views
  199. CREATE TABLE `bx_market_views_track` (
  200. `object_id` int(11) NOT NULL default '0',
  201. `viewer_id` int(11) NOT NULL default '0',
  202. `viewer_nip` int(11) unsigned NOT NULL default '0',
  203. `date` int(11) NOT NULL default '0',
  204. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  205. );
  206. -- TABLE: metas
  207. CREATE TABLE `bx_market_meta_keywords` (
  208. `object_id` int(10) unsigned NOT NULL,
  209. `keyword` varchar(255) NOT NULL,
  210. KEY `object_id` (`object_id`),
  211. KEY `keyword` (`keyword`)
  212. );
  213. CREATE TABLE `bx_market_meta_locations` (
  214. `object_id` int(10) unsigned NOT NULL,
  215. `lat` double NOT NULL,
  216. `lng` double NOT NULL,
  217. `country` varchar(2) NOT NULL,
  218. `state` varchar(255) NOT NULL,
  219. `city` varchar(255) NOT NULL,
  220. `zip` varchar(255) NOT NULL,
  221. `street` varchar(255) NOT NULL,
  222. `street_number` varchar(255) NOT NULL,
  223. PRIMARY KEY (`object_id`),
  224. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  225. );
  226. CREATE TABLE `bx_market_meta_mentions` (
  227. `object_id` int(10) unsigned NOT NULL,
  228. `profile_id` int(10) unsigned NOT NULL,
  229. KEY `object_id` (`object_id`),
  230. KEY `profile_id` (`profile_id`)
  231. );
  232. -- TABLE: reports
  233. CREATE TABLE IF NOT EXISTS `bx_market_reports` (
  234. `object_id` int(11) NOT NULL default '0',
  235. `count` int(11) NOT NULL default '0',
  236. UNIQUE KEY `object_id` (`object_id`)
  237. );
  238. CREATE TABLE IF NOT EXISTS `bx_market_reports_track` (
  239. `id` int(11) NOT NULL AUTO_INCREMENT,
  240. `object_id` int(11) NOT NULL default '0',
  241. `author_id` int(11) NOT NULL default '0',
  242. `author_nip` int(11) unsigned NOT NULL default '0',
  243. `type` varchar(32) NOT NULL default '',
  244. `text` text NOT NULL default '',
  245. `date` int(11) NOT NULL default '0',
  246. PRIMARY KEY (`id`),
  247. KEY `report` (`object_id`, `author_nip`)
  248. );
  249. -- TABLE: favorites
  250. CREATE TABLE `bx_market_favorites_track` (
  251. `object_id` int(11) NOT NULL default '0',
  252. `author_id` int(11) NOT NULL default '0',
  253. `date` int(11) NOT NULL default '0',
  254. KEY `id` (`object_id`,`author_id`)
  255. );
  256. -- TABLE: scores
  257. CREATE TABLE IF NOT EXISTS `bx_market_scores` (
  258. `object_id` int(11) NOT NULL default '0',
  259. `count_up` int(11) NOT NULL default '0',
  260. `count_down` int(11) NOT NULL default '0',
  261. UNIQUE KEY `object_id` (`object_id`)
  262. );
  263. CREATE TABLE IF NOT EXISTS `bx_market_scores_track` (
  264. `id` int(11) NOT NULL AUTO_INCREMENT,
  265. `object_id` int(11) NOT NULL default '0',
  266. `author_id` int(11) NOT NULL default '0',
  267. `author_nip` int(11) unsigned NOT NULL default '0',
  268. `type` varchar(8) NOT NULL default '',
  269. `date` int(11) NOT NULL default '0',
  270. PRIMARY KEY (`id`),
  271. KEY `vote` (`object_id`, `author_nip`)
  272. );
  273. -- STORAGES & TRANSCODERS
  274. 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
  275. ('bx_market_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_market_files', 'allow-deny', 'zip', '', 0, 0, 0, 0, 0, 0),
  276. ('bx_market_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_market_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  277. ('bx_market_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_market_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
  278. INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES
  279. ('bx_market_preview', 'bx_market_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_market_photos";}', 'no', '1', '2592000', '0'),
  280. ('bx_market_icon', 'bx_market_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_market_photos";}', 'no', '1', '2592000', '0'),
  281. ('bx_market_thumb', 'bx_market_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_market_photos";}', 'no', '1', '2592000', '0'),
  282. ('bx_market_cover', 'bx_market_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_market_photos";}', 'no', '1', '2592000', '0'),
  283. ('bx_market_screenshot', 'bx_market_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_market_photos";}', 'no', '1', '2592000', '0'),
  284. ('bx_market_gallery', 'bx_market_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_market_photos";}', 'no', '1', '2592000', '0');
  285. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  286. ('bx_market_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
  287. ('bx_market_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  288. ('bx_market_icon', 'Resize', 'a:3:{s:1:"w";s:2:"50";s:1:"h";s:2:"50";s:13:"square_resize";s:1:"1";}', '0'),
  289. ('bx_market_thumb', 'Resize', 'a:3:{s:1:"w";s:3:"100";s:1:"h";s:3:"100";s:13:"square_resize";s:1:"1";}', '0'),
  290. ('bx_market_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
  291. ('bx_market_screenshot', 'Resize', 'a:3:{s:1:"w";s:3:"200";s:1:"h";s:3:"120";s:11:"crop_resize";s:1:"1";}', '0');
  292. -- FORMS
  293. 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
  294. ('bx_market', 'bx_market', '_bx_market_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_market_products', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxMarketFormEntry', 'modules/boonex/market/classes/BxMarketFormEntry.php');
  295. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  296. ('bx_market', 'bx_market_entry_add', 'bx_market', 0, '_bx_market_form_entry_display_add'),
  297. ('bx_market', 'bx_market_entry_delete', 'bx_market', 0, '_bx_market_form_entry_display_delete'),
  298. ('bx_market', 'bx_market_entry_edit', 'bx_market', 0, '_bx_market_form_entry_display_edit'),
  299. ('bx_market', 'bx_market_entry_view', 'bx_market', 1, '_bx_market_form_entry_display_view'),
  300. ('bx_market', 'bx_market_entry_view_full', 'bx_market', 1, '_bx_market_form_entry_display_view_full');
  301. 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
  302. ('bx_market', 'bx_market', 'allow_view_to', '', '', 0, 'custom', '_bx_market_form_entry_input_sys_allow_view_to', '_bx_market_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  303. ('bx_market', 'bx_market', 'allow_purchase_to', '', '', 0, 'custom', '_bx_market_form_entry_input_sys_allow_purchase_to', '_bx_market_form_entry_input_allow_purchase_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  304. ('bx_market', 'bx_market', 'allow_comment_to', '', '', 0, 'custom', '_bx_market_form_entry_input_sys_allow_comment_to', '_bx_market_form_entry_input_allow_comment_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  305. ('bx_market', 'bx_market', 'allow_vote_to', '', '', 0, 'custom', '_bx_market_form_entry_input_sys_allow_vote_to', '_bx_market_form_entry_input_allow_vote_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  306. ('bx_market', 'bx_market', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_market_form_entry_input_sys_delete_confirm', '_bx_market_form_entry_input_delete_confirm', '_bx_market_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_market_form_entry_input_delete_confirm_error', '', '', 1, 0),
  307. ('bx_market', 'bx_market', 'do_publish', '_bx_market_form_entry_input_do_publish', '', 0, 'submit', '_bx_market_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  308. ('bx_market', 'bx_market', 'do_submit', '_bx_market_form_entry_input_do_submit', '', 0, 'submit', '_bx_market_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  309. ('bx_market', 'bx_market', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  310. ('bx_market', 'bx_market', 'pictures', 'a:1:{i:0;s:15:"bx_market_html5";}', 'a:2:{s:16:"bx_market_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_market_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_market_form_entry_input_sys_pictures', '_bx_market_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  311. ('bx_market', 'bx_market', 'files', 'a:1:{i:0;s:15:"bx_market_html5";}', 'a:2:{s:16:"bx_market_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_market_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_market_form_entry_input_sys_files', '_bx_market_form_entry_input_files', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  312. ('bx_market', 'bx_market', 'text', '', '', 0, 'textarea', '_bx_market_form_entry_input_sys_text', '_bx_market_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_market_form_entry_input_text_err', 'XssHtml', '', 1, 0),
  313. ('bx_market', 'bx_market', 'notes', '', '', 0, 'textarea', '_bx_market_form_entry_input_sys_notes', '_bx_market_form_entry_input_notes', '_bx_market_form_entry_input_notes_inf', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  314. ('bx_market', 'bx_market', 'notes_purchased', '', '', 0, 'textarea', '_bx_market_form_entry_input_sys_notes_purchased', '_bx_market_form_entry_input_notes_purchased', '_bx_market_form_entry_input_notes_purchased_inf', 0, 0, 0, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
  315. ('bx_market', 'bx_market', 'title', '', '', 0, 'text', '_bx_market_form_entry_input_sys_title', '_bx_market_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_market_form_entry_input_title_err', 'Xss', '', 1, 0),
  316. ('bx_market', 'bx_market', 'name', '', '', 0, 'text', '_bx_market_form_entry_input_sys_name', '_bx_market_form_entry_input_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_market_form_entry_input_name_err', 'Xss', '', 1, 0),
  317. ('bx_market', 'bx_market', 'cat', '', '#!bx_market_cats', 0, 'select', '_bx_market_form_entry_input_sys_cat', '_bx_market_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_market_form_entry_input_cat_err', 'Xss', '', 1, 0),
  318. ('bx_market', 'bx_market', 'price_single', '', '', 0, 'text', '_bx_market_form_entry_input_sys_price_single', '_bx_market_form_entry_input_price_single', '_bx_market_form_entry_input_price_single_inf', 0, 0, 0, '', '', '', '', '', '', 'Float', '', 1, 0),
  319. ('bx_market', 'bx_market', 'price_recurring', '', '#!bx_market_prices', 0, 'select', '_bx_market_form_entry_input_sys_price_recurring', '_bx_market_form_entry_input_price_recurring', '_bx_market_form_entry_input_price_recurring_inf', 0, 0, 0, '', '', '', '', '', '', 'Float', '', 1, 0),
  320. ('bx_market', 'bx_market', 'duration_recurring', 'month', '#!bx_market_durations', 0, 'select', '_bx_market_form_entry_input_sys_duration_recurring', '_bx_market_form_entry_input_duration_recurring', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  321. ('bx_market', 'bx_market', 'trial_recurring', '', '', 0, 'text', '_bx_market_form_entry_input_sys_trial_recurring', '_bx_market_form_entry_input_trial_recurring', '_bx_market_form_entry_input_trial_recurring_inf', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  322. ('bx_market', 'bx_market', 'added', '', '', 0, 'datetime', '_bx_market_form_entry_input_sys_added', '_bx_market_form_entry_input_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  323. ('bx_market', 'bx_market', 'changed', '', '', 0, 'datetime', '_bx_market_form_entry_input_sys_changed', '_bx_market_form_entry_input_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  324. ('bx_market', 'bx_market', 'header_beg_single', '', '', 0, 'block_header', '_bx_market_form_entry_input_sys_header_beg_single', '_bx_market_form_entry_input_header_beg_single', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  325. ('bx_market', 'bx_market', 'header_beg_recurring', '', '', 0, 'block_header', '_bx_market_form_entry_input_sys_header_beg_recurring', '_bx_market_form_entry_input_header_beg_recurring', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  326. ('bx_market', 'bx_market', 'header_beg_privacy', '', '', 0, 'block_header', '_bx_market_form_entry_input_sys_header_beg_privacy', '_bx_market_form_entry_input_header_beg_privacy', '', 0, 1, 0, '', '', '', '', '', '', '', '', 1, 0),
  327. ('bx_market', 'bx_market', 'header_end_single', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_single', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  328. ('bx_market', 'bx_market', 'header_end_recurring', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_recurring', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  329. ('bx_market', 'bx_market', 'header_end_privacy', '', '', 0, 'block_end', '_bx_market_form_entry_input_sys_header_end_privacy', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  330. ('bx_market', 'bx_market', 'warning_single', '_bx_market_err_not_accept_payments_single', '', 0, 'value', '_bx_market_form_entry_input_sys_warning_single', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  331. ('bx_market', 'bx_market', 'warning_recurring', '_bx_market_err_not_accept_payments_recurring', '', 0, 'value', '_bx_market_form_entry_input_sys_warning_recurring', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  332. ('bx_market', 'bx_market', 'subentries', '', '', 0, 'custom', '_bx_market_form_entry_input_sys_subentries', '_bx_market_form_entry_input_subentries', '_bx_market_form_entry_input_subentries_inf', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  333. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  334. ('bx_market_entry_add', 'title', 2147483647, 1, 1),
  335. ('bx_market_entry_add', 'name', 2147483647, 1, 2),
  336. ('bx_market_entry_add', 'cat', 2147483647, 1, 3),
  337. ('bx_market_entry_add', 'text', 2147483647, 1, 4),
  338. ('bx_market_entry_add', 'pictures', 2147483647, 1, 5),
  339. ('bx_market_entry_add', 'files', 2147483647, 1, 6),
  340. ('bx_market_entry_add', 'header_beg_single', 2147483647, 1, 7),
  341. ('bx_market_entry_add', 'warning_single', 2147483647, 1, 8),
  342. ('bx_market_entry_add', 'price_single', 2147483647, 1, 9),
  343. ('bx_market_entry_add', 'header_end_single', 2147483647, 1, 10),
  344. ('bx_market_entry_add', 'header_beg_recurring', 2147483647, 1, 11),
  345. ('bx_market_entry_add', 'warning_recurring', 2147483647, 1, 12),
  346. ('bx_market_entry_add', 'duration_recurring', 2147483647, 1, 13),
  347. ('bx_market_entry_add', 'price_recurring', 2147483647, 1, 14),
  348. ('bx_market_entry_add', 'trial_recurring', 2147483647, 1, 15),
  349. ('bx_market_entry_add', 'header_end_recurring', 2147483647, 1, 16),
  350. ('bx_market_entry_add', 'header_beg_privacy', 2147483647, 1, 17),
  351. ('bx_market_entry_add', 'allow_view_to', 2147483647, 1, 18),
  352. ('bx_market_entry_add', 'allow_purchase_to', 2147483647, 1, 19),
  353. ('bx_market_entry_add', 'allow_comment_to', 2147483647, 1, 20),
  354. ('bx_market_entry_add', 'allow_vote_to', 2147483647, 1, 21),
  355. ('bx_market_entry_add', 'header_end_privacy', 2147483647, 1, 22),
  356. ('bx_market_entry_add', 'notes', 2147483647, 1, 23),
  357. ('bx_market_entry_add', 'notes_purchased', 2147483647, 1, 24),
  358. ('bx_market_entry_add', 'location', 2147483647, 1, 25),
  359. ('bx_market_entry_add', 'subentries', 2147483647, 1, 26),
  360. ('bx_market_entry_add', 'do_publish', 2147483647, 1, 27),
  361. ('bx_market_entry_delete', 'delete_confirm', 2147483647, 1, 1),
  362. ('bx_market_entry_delete', 'do_submit', 2147483647, 1, 2),
  363. ('bx_market_entry_edit', 'title', 2147483647, 1, 1),
  364. ('bx_market_entry_edit', 'name', 2147483647, 1, 2),
  365. ('bx_market_entry_edit', 'cat', 2147483647, 1, 3),
  366. ('bx_market_entry_edit', 'text', 2147483647, 1, 4),
  367. ('bx_market_entry_edit', 'pictures', 2147483647, 1, 5),
  368. ('bx_market_entry_edit', 'files', 2147483647, 1, 6),
  369. ('bx_market_entry_edit', 'header_beg_single', 2147483647, 1, 7),
  370. ('bx_market_entry_edit', 'warning_single', 2147483647, 1, 8),
  371. ('bx_market_entry_edit', 'price_single', 2147483647, 1, 9),
  372. ('bx_market_entry_edit', 'header_end_single', 2147483647, 1, 10),
  373. ('bx_market_entry_edit', 'header_beg_recurring', 2147483647, 1, 11),
  374. ('bx_market_entry_edit', 'warning_recurring', 2147483647, 1, 12),
  375. ('bx_market_entry_edit', 'duration_recurring', 2147483647, 1, 13),
  376. ('bx_market_entry_edit', 'price_recurring', 2147483647, 1, 14),
  377. ('bx_market_entry_edit', 'trial_recurring', 2147483647, 1, 15),
  378. ('bx_market_entry_edit', 'header_end_recurring', 2147483647, 1, 16),
  379. ('bx_market_entry_edit', 'header_beg_privacy', 2147483647, 1, 17),
  380. ('bx_market_entry_edit', 'allow_view_to', 2147483647, 1, 18),
  381. ('bx_market_entry_edit', 'allow_purchase_to', 2147483647, 1, 19),
  382. ('bx_market_entry_edit', 'allow_comment_to', 2147483647, 1, 20),
  383. ('bx_market_entry_edit', 'allow_vote_to', 2147483647, 1, 21),
  384. ('bx_market_entry_edit', 'header_end_privacy', 2147483647, 1, 22),
  385. ('bx_market_entry_edit', 'notes', 2147483647, 1, 23),
  386. ('bx_market_entry_edit', 'notes_purchased', 2147483647, 1, 24),
  387. ('bx_market_entry_edit', 'location', 2147483647, 1, 25),
  388. ('bx_market_entry_edit', 'subentries', 2147483647, 1, 26),
  389. ('bx_market_entry_edit', 'do_submit', 2147483647, 1, 27),
  390. ('bx_market_entry_view', 'cat', 2147483647, 1, 1),
  391. ('bx_market_entry_view', 'added', 2147483647, 1, 2),
  392. ('bx_market_entry_view', 'changed', 2147483647, 1, 3),
  393. ('bx_market_entry_view_full', 'cat', 2147483647, 1, 1),
  394. ('bx_market_entry_view_full', 'added', 2147483647, 1, 2),
  395. ('bx_market_entry_view_full', 'changed', 2147483647, 1, 3),
  396. ('bx_market_entry_view_full', 'notes', 2147483647, 1, 4);
  397. -- PRE-VALUES
  398. INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
  399. ('bx_market_cats', '_bx_market_pre_lists_cats', 'bx_market', '0'),
  400. ('bx_market_prices', '_bx_market_pre_lists_prices', 'bx_market', '0'),
  401. ('bx_market_durations', '_bx_market_pre_lists_durations', 'bx_market', '0');
  402. INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
  403. ('bx_market_cats', '', 0, '_sys_please_select', ''),
  404. ('bx_market_cats', '1', 1, '_bx_market_cat_administration', ''),
  405. ('bx_market_cats', '2', 2, '_bx_market_cat_adult', ''),
  406. ('bx_market_cats', '3', 3, '_bx_market_cat_advertisement', ''),
  407. ('bx_market_cats', '4', 4, '_bx_market_cat_affiliates', ''),
  408. ('bx_market_cats', '5', 5, '_bx_market_cat_authentication', ''),
  409. ('bx_market_cats', '6', 6, '_bx_market_cat_calendars', ''),
  410. ('bx_market_cats', '7', 7, '_bx_market_cat_communication', ''),
  411. ('bx_market_cats', '8', 8, '_bx_market_cat_content', ''),
  412. ('bx_market_cats', '9', 9, '_bx_market_cat_conversion', ''),
  413. ('bx_market_cats', '10', 10, '_bx_market_cat_core_changes', ''),
  414. ('bx_market_cats', '11', 11, '_bx_market_cat_dating', ''),
  415. ('bx_market_cats', '12', 12, '_bx_market_cat_documentation', ''),
  416. ('bx_market_cats', '13', 13, '_bx_market_cat_ecommerce', ''),
  417. ('bx_market_cats', '14', 14, '_bx_market_cat_events', ''),
  418. ('bx_market_cats', '15', 15, '_bx_market_cat_feedback', ''),
  419. ('bx_market_cats', '16', 16, '_bx_market_cat_flash', ''),
  420. ('bx_market_cats', '17', 17, '_bx_market_cat_games', ''),
  421. ('bx_market_cats', '18', 18, '_bx_market_cat_graphics', ''),
  422. ('bx_market_cats', '19', 19, '_bx_market_cat_hosting', ''),
  423. ('bx_market_cats', '20', 20, '_bx_market_cat_integrations', ''),
  424. ('bx_market_cats', '21', 21, '_bx_market_cat_location', ''),
  425. ('bx_market_cats', '22', 22, '_bx_market_cat_management', ''),
  426. ('bx_market_cats', '23', 23, '_bx_market_cat_mobile', ''),
  427. ('bx_market_cats', '24', 24, '_bx_market_cat_multimedia', ''),
  428. ('bx_market_cats', '25', 25, '_bx_market_cat_music', ''),
  429. ('bx_market_cats', '26', 26, '_bx_market_cat_navigation', ''),
  430. ('bx_market_cats', '27', 27, '_bx_market_cat_other', ''),
  431. ('bx_market_cats', '28', 28, '_bx_market_cat_performance', ''),
  432. ('bx_market_cats', '29', 29, '_bx_market_cat_photos', ''),
  433. ('bx_market_cats', '30', 30, '_bx_market_cat_search', ''),
  434. ('bx_market_cats', '31', 31, '_bx_market_cat_security', ''),
  435. ('bx_market_cats', '32', 32, '_bx_market_cat_services', ''),
  436. ('bx_market_cats', '33', 33, '_bx_market_cat_social', ''),
  437. ('bx_market_cats', '34', 34, '_bx_market_cat_spam_prevention', ''),
  438. ('bx_market_cats', '35', 35, '_bx_market_cat_statistics', ''),
  439. ('bx_market_cats', '36', 36, '_bx_market_cat_templates', ''),
  440. ('bx_market_cats', '37', 37, '_bx_market_cat_tools', ''),
  441. ('bx_market_cats', '38', 38, '_bx_market_cat_translations', ''),
  442. ('bx_market_cats', '39', 39, '_bx_market_cat_video', ''),
  443. ('bx_market_prices', '0', 0, '_bx_market_cat_price_0', ''),
  444. ('bx_market_prices', '1', 1, '_bx_market_cat_price_1', ''),
  445. ('bx_market_prices', '2', 2, '_bx_market_cat_price_2', ''),
  446. ('bx_market_prices', '3', 3, '_bx_market_cat_price_3', ''),
  447. ('bx_market_prices', '4', 4, '_bx_market_cat_price_4', ''),
  448. ('bx_market_prices', '5', 5, '_bx_market_cat_price_5', ''),
  449. ('bx_market_durations', 'day', 1, '_bx_market_cat_duration_day', ''),
  450. ('bx_market_durations', 'week', 2, '_bx_market_cat_duration_week', ''),
  451. ('bx_market_durations', 'month', 3, '_bx_market_cat_duration_month', ''),
  452. ('bx_market_durations', 'year', 4, '_bx_market_cat_duration_year', '');
  453. -- COMMENTS
  454. 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
  455. ('bx_market', 'bx_market', 'bx_market_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-product&id={object_id}', '', 'bx_market_products', 'id', 'author', 'title', 'comments', 'BxMarketCmts', 'modules/boonex/market/classes/BxMarketCmts.php');
  456. -- VOTES
  457. INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  458. ('bx_market', 'bx_market_votes', 'bx_market_votes_track', '604800', '1', '5', '0', '1', 'bx_market_products', 'id', 'author', 'rate', 'votes', 'BxMarketVote', 'modules/boonex/market/classes/BxMarketVote.php');
  459. -- SCORES
  460. 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
  461. ('bx_market', 'bx_market', 'bx_market_scores', 'bx_market_scores_track', '604800', '0', 'bx_market_products', 'id', 'author', 'score', 'sc_up', 'sc_down', 'BxMarketScore', 'modules/boonex/market/classes/BxMarketScore.php');
  462. -- REPORTS
  463. INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  464. ('bx_market', 'bx_market_reports', 'bx_market_reports_track', '1', 'page.php?i=view-product&id={object_id}', 'bx_market_products', 'id', 'author', 'reports', '', '');
  465. -- VIEWS
  466. 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
  467. ('bx_market', 'bx_market_views_track', '86400', '1', 'bx_market_products', 'id', 'author', 'views', '', '');
  468. -- FAFORITES
  469. 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
  470. ('bx_market', 'bx_market_favorites_track', '1', '1', '1', 'page.php?i=view-product&id={object_id}', 'bx_market_products', 'id', 'author', 'favorites', '', '');
  471. -- FEATURED
  472. INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES
  473. ('bx_market', '1', '1', 'page.php?i=view-product&id={object_id}', 'bx_market_products', 'id', 'author', 'featured', '', '');
  474. -- CONTENT INFO
  475. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  476. ('bx_market', '_bx_market', 'bx_market', 'added', 'edited', 'deleted', '', ''),
  477. ('bx_market_cmts', '_bx_market_cmts', 'bx_market', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  478. INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
  479. ('bx_market', 'bx_market_administration', 'id', '', ''),
  480. ('bx_market', 'bx_market_common', 'id', '', '');
  481. -- SEARCH EXTENDED
  482. INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
  483. ('bx_market', 'bx_market', 'bx_market', '_bx_market_search_extended', 1, '', ''),
  484. ('bx_market_cmts', 'bx_market_cmts', 'bx_market', '_bx_market_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
  485. -- STUDIO: page & widget
  486. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  487. (3, 'bx_market', '_bx_market', '_bx_market', 'bx_market@modules/boonex/market/|std-icon.svg');
  488. SET @iPageId = LAST_INSERT_ID();
  489. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  490. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  491. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  492. (@iPageId, 'bx_market', '{url_studio}module.php?name=bx_market', '', 'bx_market@modules/boonex/market/|std-icon.svg', '_bx_market', '', '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";}');
  493. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  494. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));