· 9 years ago · Nov 09, 2016, 10:54 AM
1mysqli_query($link,'SET NAMES '.core::request('DB_CHARSET'));
2mysqli_query($link,"SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';");
3
4mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."roles` (
5 `id_role` int(10) unsigned NOT NULL AUTO_INCREMENT,
6 `name` varchar(45) DEFAULT NULL,
7 `description` varchar(245) DEFAULT NULL,
8 `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
9 PRIMARY KEY (`id_role`),
10 UNIQUE KEY `".core::request('TABLE_PREFIX')."roles_UK_name` (`name`)
11) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
12
13
14mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."access` (
15 `id_access` int(10) unsigned NOT NULL AUTO_INCREMENT,
16 `id_role` int(10) unsigned NOT NULL,
17 `access` varchar(100) NOT NULL,
18 PRIMARY KEY (`id_access`)
19) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
20
21
22mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."users` (
23 `id_user` int(10) unsigned NOT NULL AUTO_INCREMENT,
24 `name` varchar(145) DEFAULT NULL,
25 `seoname` varchar(145) DEFAULT NULL,
26 `email` varchar(145) NOT NULL,
27 `paypal_email` varchar(145) DEFAULT NULL,
28 `password` varchar(64) NOT NULL,
29 `description` text NULL DEFAULT NULL,
30 `status` int(1) NOT NULL DEFAULT '0',
31 `id_role` int(10) unsigned DEFAULT '1',
32 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
33 `last_modified` datetime DEFAULT NULL,
34 `logins` int(10) UNSIGNED NOT NULL DEFAULT '0',
35 `last_login` datetime DEFAULT NULL,
36 `last_ip` bigint DEFAULT NULL,
37 `user_agent` varchar(40) DEFAULT NULL,
38 `token` varchar(40) DEFAULT NULL,
39 `token_created` datetime DEFAULT NULL,
40 `token_expires` datetime DEFAULT NULL,
41 `api_token` varchar(40) DEFAULT NULL,
42 `hybridauth_provider_name` varchar(40) NULL DEFAULT NULL,
43 `hybridauth_provider_uid` varchar(245) NULL DEFAULT NULL,
44 `signature` varchar(245) NULL DEFAULT NULL,
45 `subscriber` tinyint(1) NOT NULL DEFAULT '1',
46 `has_image` tinyint(1) NOT NULL DEFAULT '0',
47 `failed_attempts` int(10) UNSIGNED NOT NULL DEFAULT '0',
48 `last_failed` datetime DEFAULT NULL,
49 `VAT_number` VARCHAR(65) NULL DEFAULT NULL,
50 `country` VARCHAR(3) NULL DEFAULT NULL,
51 `city` VARCHAR(65) NULL DEFAULT NULL,
52 `postal_code` VARCHAR(20) NULL DEFAULT NULL,
53 `address` VARCHAR(150) NULL DEFAULT NULL,
54 `google_authenticator` varchar(40) DEFAULT NULL,
55 PRIMARY KEY (`id_user`),
56 UNIQUE KEY `".core::request('TABLE_PREFIX')."users_UK_email` (`email`),
57 UNIQUE KEY `".core::request('TABLE_PREFIX')."users_UK_token` (`token`),
58 UNIQUE KEY `".core::request('TABLE_PREFIX')."users_UK_api_token` (`api_token`),
59 UNIQUE KEY `".core::request('TABLE_PREFIX')."users_UK_seoname` (`seoname`),
60 UNIQUE KEY `".core::request('TABLE_PREFIX')."users_UK_provider_AND_uid` (`hybridauth_provider_name`,`hybridauth_provider_uid`)
61) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
62
63
64mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."categories` (
65 `id_category` int(10) unsigned NOT NULL AUTO_INCREMENT,
66 `name` varchar(145) NOT NULL,
67 `order` int(2) unsigned NOT NULL DEFAULT '0',
68 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
69 `id_category_parent` int(10) unsigned NOT NULL DEFAULT '0',
70 `parent_deep` int(2) unsigned NOT NULL DEFAULT '0',
71 `seoname` varchar(145) NOT NULL,
72 `description` text NULL,
73 `last_modified` DATETIME NULL,
74 `has_image` tinyint(1) NOT NULL DEFAULT '0',
75 PRIMARY KEY (`id_category`) USING BTREE,
76 UNIQUE KEY `".core::request('TABLE_PREFIX')."categories_UK_seo_name` (`seoname`)
77) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
78
79
80mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."visits` (
81 `id_visit` int(10) unsigned NOT NULL AUTO_INCREMENT,
82 `id_product` int(10) unsigned DEFAULT NULL,
83 `id_user` int(10) unsigned DEFAULT NULL,
84 `id_affiliate` int(10) unsigned DEFAULT NULL,
85 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
86 `ip_address` bigint DEFAULT NULL,
87 PRIMARY KEY (`id_visit`),
88 KEY `".core::request('TABLE_PREFIX')."visits_IK_id_user` (`id_user`),
89 KEY `".core::request('TABLE_PREFIX')."visits_IK_id_product` (`id_product`)
90) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
91
92
93mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."config` (
94 `group_name` VARCHAR(128) NOT NULL,
95 `config_key` VARCHAR(128) NOT NULL,
96 `config_value` LONGTEXT,
97 PRIMARY KEY (`config_key`),
98 UNIQUE KEY `".core::request('TABLE_PREFIX')."config_IK_group_name_AND_config_key` (`group_name`,`config_key`)
99) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET')." ;");
100
101
102mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."content` (
103 `id_content` int(10) unsigned NOT NULL AUTO_INCREMENT,
104 `locale` varchar(8) NOT NULL DEFAULT 'en_US',
105 `order` int(2) unsigned NOT NULL DEFAULT '0',
106 `title` varchar(145) NOT NULL,
107 `seotitle` varchar(145) NOT NULL,
108 `description` LONGTEXT NULL,
109 `from_email` varchar(145) NULL,
110 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
111 `type` enum('page','email','help') NOT NULL,
112 `status` tinyint(1) NOT NULL DEFAULT '0',
113 PRIMARY KEY (`id_content`)
114) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
115
116
117//////////////Tables for eShop
118
119mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."products` (
120 `id_product` int(10) unsigned NOT NULL AUTO_INCREMENT,
121 `id_user` int(10) unsigned DEFAULT NULL,
122 `id_category` int(10) unsigned DEFAULT NULL,
123 `title` varchar(145) NOT NULL,
124 `seotitle` varchar(145) NOT NULL,
125 `skins` varchar(245) NOT NULL,
126 `url_demo` varchar(145) NOT NULL,
127 `url_buy` varchar(245),
128 `description` text NOT NULL,
129 `email_purchase_notes` text NOT NULL,
130 `version` varchar(10) NOT NULL,
131 `currency` char(3) NOT NULL,
132 `price` decimal(10,2) NOT NULL DEFAULT '0',
133 `price_offer` decimal(10,2) NOT NULL DEFAULT '0',
134 `offer_valid` DATETIME NULL,
135 `featured` DATETIME NULL,
136 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
137 `updated` DATETIME NULL,
138 `status` tinyint(1) NOT NULL DEFAULT '0',
139 `has_images` tinyint(1) NOT NULL DEFAULT '0',
140 `file_name` varchar(40) DEFAULT NULL,
141 `support_days` int(10) NOT NULL DEFAULT '0',
142 `licenses` int(10) NOT NULL DEFAULT '1',
143 `license_days` int(10) NOT NULL DEFAULT '0',
144 `rate` FLOAT( 4, 2 ) NULL DEFAULT NULL,
145 `affiliate_percentage` decimal(14,3) NOT NULL DEFAULT '0',
146 PRIMARY KEY (`id_product`),
147 KEY `".core::request('TABLE_PREFIX')."products_IK_id_user` (`id_user`),
148 KEY `".core::request('TABLE_PREFIX')."products_IK_id_category` (`id_category`)
149) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
150
151
152mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."orders` (
153 `id_order` int(10) unsigned NOT NULL AUTO_INCREMENT,
154 `id_user` int(10) unsigned NOT NULL,
155 `id_product` int(10) unsigned NULL,
156 `id_coupon` int(10) unsigned NULL,
157 `paymethod` VARCHAR(20) DEFAULT NULL,
158 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
159 `currency` char(3) NOT NULL,
160 `amount` DECIMAL(14,3) NOT NULL DEFAULT '0',
161 `amount_net` DECIMAL(14,3) NOT NULL DEFAULT '0',
162 `gateway_fee` DECIMAL(14,3) NOT NULL DEFAULT '0',
163 `ip_address` bigint DEFAULT NULL,
164 `txn_id` VARCHAR(255) DEFAULT NULL,
165 `pay_date` DATETIME NULL,
166 `support_date` DATETIME NULL,
167 `status` tinyint(1) NOT NULL DEFAULT '0',
168 `notes` VARCHAR( 245 ) NULL DEFAULT NULL,
169 `VAT` DECIMAL(14,3) NOT NULL DEFAULT '0.000',
170 `VAT_amount` DECIMAL(14,3) NOT NULL DEFAULT '0',
171 `VAT_number` VARCHAR(65) NULL DEFAULT NULL,
172 `country` VARCHAR(3) NULL DEFAULT NULL,
173 `city` VARCHAR(65) NULL DEFAULT NULL,
174 `postal_code` VARCHAR(20) NULL DEFAULT NULL,
175 `address` VARCHAR(150) NULL DEFAULT NULL,
176 PRIMARY KEY (`id_order`),
177 KEY `".core::request('TABLE_PREFIX')."orders_IK_id_user` (`id_user`),
178 KEY `".core::request('TABLE_PREFIX')."orders_IK_status` (`status`)
179)ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
180
181
182mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."licenses` (
183 `id_license` int(10) unsigned NOT NULL AUTO_INCREMENT,
184 `id_product` int(10) unsigned NOT NULL,
185 `id_user` int(10) unsigned NOT NULL,
186 `id_order` int(10) unsigned NOT NULL,
187 `license` varchar(40) DEFAULT NULL,
188 `domain` varchar(255) DEFAULT NULL,
189 `device_id` varchar(255) DEFAULT NULL,
190 `ip_address` bigint DEFAULT NULL,
191 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
192 `active_date` DATETIME NULL,
193 `valid_date` DATETIME NULL,
194 `license_check_date` DATETIME NULL,
195 `status` tinyint(1) NOT NULL DEFAULT '0',
196 PRIMARY KEY (`id_license`),
197 UNIQUE KEY `".core::request('TABLE_PREFIX')."licenses_UK_license` (`license`),
198 KEY `".core::request('TABLE_PREFIX')."licenses_IK_id_user` (`id_user`)
199) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
200
201
202mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."downloads` (
203 `id_download` int(10) unsigned NOT NULL AUTO_INCREMENT,
204 `id_order` int(10) unsigned NOT NULL,
205 `id_user` int(10) unsigned NOT NULL,
206 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
207 `ip_address` bigint DEFAULT NULL,
208 PRIMARY KEY (`id_download`),
209 KEY `".core::request('TABLE_PREFIX')."downloads_IK_id_user` (`id_user`),
210 KEY `".core::request('TABLE_PREFIX')."downloads_IK_id_order` (`id_order`)
211) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
212
213
214
215mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."tickets` (
216 `id_ticket` int(10) unsigned NOT NULL AUTO_INCREMENT,
217 `id_ticket_parent` int(10) unsigned NULL,
218 `id_product` int(10) unsigned NOT NULL,
219 `id_order` int(10) unsigned NOT NULL,
220 `id_user` int(10) unsigned NOT NULL,
221 `id_user_support` int(10) unsigned NULL,
222 `title` varchar(145) NOT NULL,
223 `description` text NOT NULL,
224 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
225 `read_date` DATETIME NULL,
226 `ip_address` bigint DEFAULT NULL,
227 `status` tinyint(1) NOT NULL DEFAULT '0',
228 PRIMARY KEY (`id_ticket`),
229 KEY `".core::request('TABLE_PREFIX')."tickets_IK_id_user` (`id_user`),
230 KEY `".core::request('TABLE_PREFIX')."tickets_IK_id_ticket_parent` (`id_ticket_parent`),
231 KEY `".core::request('TABLE_PREFIX')."tickets_IK_id_product` (`id_product`)
232) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
233
234
235mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."coupons` (
236 `id_coupon` int(10) unsigned NOT NULL AUTO_INCREMENT,
237 `id_product` int(10) unsigned NULL DEFAULT NULL,
238 `name` varchar(145) NOT NULL,
239 `notes` varchar(245) DEFAULT NULL,
240 `discount_amount` decimal(14,3) NOT NULL DEFAULT '0',
241 `discount_percentage` decimal(14,3) NOT NULL DEFAULT '0',
242 `number_coupons` int(10) DEFAULT NULL,
243 `valid_date` DATETIME NULL,
244 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
245 `status` tinyint(1) NOT NULL DEFAULT '0',
246 PRIMARY KEY (`id_coupon`),
247 UNIQUE KEY `".core::request('TABLE_PREFIX')."coupons_UK_name` (`name`)
248) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
249
250
251mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."posts` (
252 `id_post` int(10) unsigned NOT NULL AUTO_INCREMENT,
253 `id_user` int(10) unsigned NOT NULL,
254 `id_post_parent` int(10) unsigned NULL DEFAULT NULL,
255 `id_forum` int(10) unsigned NULL DEFAULT NULL,
256 `title` varchar(245) NOT NULL,
257 `seotitle` varchar(245) NOT NULL,
258 `description` longtext NOT NULL,
259 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
260 `ip_address` bigint DEFAULT NULL,
261 `status` tinyint(1) NOT NULL DEFAULT '0',
262 PRIMARY KEY (`id_post`) USING BTREE,
263 UNIQUE KEY `".core::request('TABLE_PREFIX')."posts_UK_seotitle` (`seotitle`),
264 KEY `".core::request('TABLE_PREFIX')."posts_IK_id_user` (`id_user`),
265 KEY `".core::request('TABLE_PREFIX')."posts_IK_id_post_parent` (`id_post_parent`),
266 KEY `".core::request('TABLE_PREFIX')."posts_IK_id_forum` (`id_forum`)
267) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
268
269
270mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."forums` (
271 `id_forum` int(10) unsigned NOT NULL AUTO_INCREMENT,
272 `name` varchar(145) NOT NULL,
273 `order` int(2) unsigned NOT NULL DEFAULT '0',
274 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
275 `id_forum_parent` int(10) unsigned NOT NULL DEFAULT '0',
276 `parent_deep` int(2) unsigned NOT NULL DEFAULT '0',
277 `seoname` varchar(145) NOT NULL,
278 `description` varchar(255) NULL,
279 PRIMARY KEY (`id_forum`) USING BTREE,
280 UNIQUE KEY `".core::request('TABLE_PREFIX')."forums_UK_seo_name` (`seoname`)
281) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
282
283mysqli_query($link,"CREATE TABLE IF NOT EXISTS ".core::request('TABLE_PREFIX')."reviews (
284 id_review int(10) unsigned NOT NULL AUTO_INCREMENT,
285 id_user int(10) unsigned NOT NULL,
286 id_order int(10) unsigned NOT NULL,
287 id_product int(10) unsigned NOT NULL,
288 rate int(2) unsigned NOT NULL DEFAULT '0',
289 description varchar(1000) NOT NULL,
290 created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
291 ip_address bigint DEFAULT NULL,
292 status tinyint(1) NOT NULL DEFAULT '0',
293 PRIMARY KEY (id_review) USING BTREE,
294 KEY ".core::request('TABLE_PREFIX')."reviews_IK_id_user (id_user),
295 KEY ".core::request('TABLE_PREFIX')."reviews_IK_id_order (id_order),
296 KEY ".core::request('TABLE_PREFIX')."reviews_IK_id_product (id_product)
297 ) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
298
299mysqli_query($link,"CREATE TABLE IF NOT EXISTS ".core::request('TABLE_PREFIX')."affiliates (
300 id_affiliate int(10) unsigned NOT NULL AUTO_INCREMENT,
301 id_user int(10) unsigned NOT NULL,
302 id_order int(10) unsigned NOT NULL,
303 id_order_payment int(10) unsigned,
304 id_product int(10) unsigned NOT NULL,
305 percentage decimal(14,3) NOT NULL DEFAULT '0',
306 amount decimal(14,3) NOT NULL DEFAULT '0',
307 currency char(3) NOT NULL,
308 created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
309 date_to_pay datetime DEFAULT NULL,
310 date_paid datetime DEFAULT NULL,
311 ip_address bigint DEFAULT NULL,
312 status tinyint(1) NOT NULL DEFAULT '0',
313 PRIMARY KEY (id_affiliate) USING BTREE,
314 KEY ".core::request('TABLE_PREFIX')."affiliates_IK_id_user (id_user),
315 KEY ".core::request('TABLE_PREFIX')."affiliates_IK_id_order (id_order),
316 KEY ".core::request('TABLE_PREFIX')."affiliates_IK_id_product (id_product)
317 ) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
318
319mysqli_query($link,"CREATE TABLE IF NOT EXISTS `".core::request('TABLE_PREFIX')."crontab` (
320 `id_crontab` int(10) unsigned NOT NULL AUTO_INCREMENT,
321 `name` varchar(50) NOT NULL,
322 `period` varchar(50) NOT NULL,
323 `callback` varchar(140) NOT NULL,
324 `params` varchar(255) DEFAULT NULL,
325 `description` varchar(255) DEFAULT NULL,
326 `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
327 `date_started` datetime DEFAULT NULL,
328 `date_finished` datetime DEFAULT NULL,
329 `date_next` datetime DEFAULT NULL,
330 `times_executed` bigint DEFAULT '0',
331 `output` varchar(50) DEFAULT NULL,
332 `running` tinyint(1) NOT NULL DEFAULT '0',
333 `active` tinyint(1) NOT NULL DEFAULT '1',
334 PRIMARY KEY (`id_crontab`),
335 UNIQUE KEY `".core::request('TABLE_PREFIX')."crontab_UK_name` (`name`)
336) ENGINE=MyISAM DEFAULT CHARSET=".core::request('DB_CHARSET').";");
337
338/**
339 * add basic content like emails
340 */
341mysqli_query($link,"INSERT INTO `".core::request('TABLE_PREFIX')."content` (`order`, `title`, `seotitle`, `description`, `from_email`, `type`, `status`)
342 VALUES
343(0, 'Change Password [SITE.NAME]', 'auth-remember', 'Hello [USER.NAME],\n\nFollow this link [URL.QL]\n\nThanks!!', '".core::request('ADMIN_EMAIL')."', 'email', 1),
344(0, 'Welcome to [SITE.NAME]!', 'auth-register', 'Welcome [USER.NAME],\n\nWe are really happy that you have joined us! [URL.QL]\n\nRemember your user details:\nEmail: [USER.EMAIL]\nPassword: [USER.PWD]\n\nWe do not have your original password anymore.\n\nRegards!', '".core::request('ADMIN_EMAIL')."', 'email', 1),
345(0, '[EMAIL.SENDER] wants to contact you!', 'contact-admin', 'Hello Admin,\n\n [EMAIL.SENDER]: [EMAIL.FROM], have a message for you:\n\n [EMAIL.SUBJECT]\n\n [EMAIL.BODY] \n\n Regards!', '".core::request('ADMIN_EMAIL')."', 'email', 1),
346(0, 'New reply: [TITLE]', 'new-reply', '[URL.QL]\n\n[DESCRIPTION]', '".core::request('ADMIN_EMAIL')."', 'email', 1),
347(0, 'Purchase Receipt for [PRODUCT.TITLE]', 'new-sale', '==== Order Details ====\nDate: [DATE]\nOrder ID: [ORDER.ID]\nName: [USER.NAME]\nEmail: [USER.EMAIL]\n\n==== Your Order ====\nProduct: [PRODUCT.TITLE]\nProduct Price: [PRODUCT.PRICE]\n\n[PRODUCT.NOTES][DOWNLOAD][EXPIRE][LICENSE]', '".core::request('ADMIN_EMAIL')."', 'email', 1),
348(0, 'Product updated [TITLE]', 'product-update', '==== Update Details ====\nVersion: [VERSION]\nProduct name: [TITLE][DOWNLOAD][EXPIRE]\n\n==== Product Page ====\n[URL.PRODUCT]', '".core::request('ADMIN_EMAIL')."', 'email', 1),
349(0, 'Ticket assigned to you: [TITLE]', 'assign-agent', '[URL.QL]\n\n[DESCRIPTION]', '".core::request('ADMIN_EMAIL')."', 'email', 1),
350(0, 'New review for [TITLE] [RATE]', 'review-product', '[URL.QL]\n\n[RATE]\n\n[DESCRIPTION]', '".core::request('ADMIN_EMAIL')."', 'email', 1),
351(0, 'New support ticket created `[TITLE]`', 'new-ticket', 'We have received your support inquiry. We will try to answer you within the next 24 working hours, thank you for your patience.\n\n[URL.QL]', '".core::request('ADMIN_EMAIL')."', 'email', 1),
352(0, 'Congratulations! New affiliate commission [AMOUNT]', 'affiliate-commission', 'Congratulations!,\n\n We just registered a sale from your affiliate link for the amount of [AMOUNT], check them all at your affiliate panel [URL.AFF]. \n\n Thanks for using our affiliate program!', '".core::request('ADMIN_EMAIL')."', 'email', 1),
353(0, 'Password Changed [SITE.NAME]', 'password-changed', 'Hello [USER.NAME],\n\nYour password has been changed.\n\nThese are now your user details:\nEmail: [USER.EMAIL]\nPassword: [USER.PWD]\n\nWe do not have your original password anymore.\n\nRegards!', '".core::request('ADMIN_EMAIL')."', 'email', 1),
354(0, 'Receipt for [ORDER.DESC] #[ORDER.ID]', 'new-order', 'Hello [USER.NAME],Thanks for buying [ORDER.DESC].\n\nPlease complete the payment here [URL.CHECKOUT]', '".core::request('ADMIN_EMAIL')."', 'email', 1),
355(0, 'There is a new reply on the forum', 'new-forum-answer', 'There is a new reply on a forum post where you participated.<br><br><a target=\"_blank\" href=\"[FORUM.LINK]\">Check it here</a><br><br>[FORUM.LINK]<br>', '".core::request('ADMIN_EMAIL')."', 'email', 1);");
356
357
358/**
359 * Access
360 */
361mysqli_query($link,"INSERT INTO `".core::request('TABLE_PREFIX')."roles` (`id_role`, `name`, `description`) VALUES (1, 'user', 'Normal user'), (5, 'translator', 'User + Translations'), (10, 'admin', 'Full access');");
362mysqli_query($link,"INSERT INTO `".core::request('TABLE_PREFIX')."access` (`id_access`, `id_role`, `access`) VALUES
363 (1, 10, '*.*'),
364 (2, 1, 'profile.*'),(3, 1, 'stats.user'),(8, 1, 'support.*'),
365 (4, 5, 'translations.*'),(5, 5, 'profile.*'),(6, 5, 'stats.user'),(7, 5, 'content.*');");
366
367/**
368 * Create user God/Admin
369 */
370$password = hash_hmac('sha256', core::request('ADMIN_PWD'), install::$hash_key);
371mysqli_query($link,"INSERT INTO `".core::request('TABLE_PREFIX')."users` (`id_user`, `name`, `seoname`, `email`, `password`, `status`, `id_role`)
372VALUES (1, 'admin', 'admin', '".core::request('ADMIN_EMAIL')."', '$password', 1, 10)");
373
374/**
375 * Configs to make the app work
376 * @todo refactor to use same coding standard
377 * @todo widgets examples? at least at sidebar, rss, text advert, pages, locations...
378 *
379 */
380mysqli_query($link,"INSERT INTO `".core::request('TABLE_PREFIX')."config` (`group_name`, `config_key`, `config_value`) VALUES
381('appearance', 'theme', 'default'),
382('appearance', 'theme_mobile', ''),
383('appearance', 'allow_query_theme', 0),
384('appearance', 'custom_css', 0),
385('appearance', 'custom_css_version', 0),
386('i18n', 'charset', 'utf-8'),
387('i18n', 'timezone', '".core::request('TIMEZONE')."'),
388('i18n', 'locale', '".core::request('LANGUAGE')."'),
389('i18n', 'allow_query_language', 0),
390('payment', 'thanks_page', ''),
391('payment', 'sandbox', 0),
392('payment', 'paypal_account', ''),
393('payment', 'paymill_private', ''),
394('payment', 'paymill_public', ''),
395('payment', 'stripe_private', ''),
396('payment', 'stripe_public', ''),
397('payment', 'stripe_address', '0'),
398('payment', 'stripe_alipay', '0'),
399('payment', 'alternative', ''),
400('payment', 'bitpay_apikey', ''),
401('payment', 'authorize_sandbox', '0'),
402('payment', 'authorize_login', ''),
403('payment', 'authorize_key', ''),
404('payment', 'twocheckout_sid', ''),
405('payment', 'twocheckout_secretword', ''),
406('payment', 'twocheckout_sandbox', 0),
407('payment', 'fraudlabspro', ''),
408('payment', 'paysbuy', ''),
409('payment', 'paysbuy_sandbox', '0'),
410('payment', 'mercadopago_client_id', ''),
411('payment', 'mercadopago_client_secret', ''),
412('general', 'api_key', '".core::generate_password(32)."'),
413('general', 'number_format', '%n'),
414('general', 'date_format', 'd-m-y'),
415('general', 'base_url', '".core::request('SITE_URL')."'),
416('general', 'maintenance', 0),
417('general', 'private_site', 0),
418('general', 'private_site_page', ''),
419('general', 'analytics', ''),
420('general', 'translate', ''),
421('general', 'menu', ''),
422('general', 'feed_elements', '20'),
423('general', 'site_name', '".core::request('SITE_NAME')."'),
424('general', 'site_description', ''),
425('general', 'products_per_page', '12'),
426('general', 'akismet_key', ''),
427('general', 'alert_terms', ''),
428('general', 'landing_page', ''),
429('general', 'blog', '0'),
430('general', 'blog_disqus', ''),
431('general', 'faq', '0'),
432('general', 'faq_disqus', ''),
433('general', 'forums', '0'),
434('general', 'minify', 0),
435('general', 'sort_by', 'published-asc'),
436('general', 'ocacu', '0'),
437('general', 'banned_words_replacement', 'xxx'),
438('general', 'banned_words', ''),
439('general', 'disallowbots', 0),
440('general', 'html_head', ''),
441('general', 'html_footer', ''),
442('general', 'eu_vat', 0),
443('general', 'vat_number', ''),
444('general', 'company_name', ''),
445('general', 'vat_excluded_countries', ''),
446('general', 'cookie_consent', 0),
447('general', 'captcha', ''),
448('general', 'recaptcha_active', ''),
449('general', 'recaptcha_secretkey', ''),
450('general', 'recaptcha_sitekey', ''),
451('general', 'cron', 1),
452('general', 'google_authenticator', 0),
453('image', 'allowed_formats', 'jpeg,jpg,png,'),
454('image', 'max_image_size', '5'),
455('image', 'height', ''),
456('image', 'width', '1200'),
457('image', 'height_thumb', '200'),
458('image', 'width_thumb', '200'),
459('image', 'quality', '90'),
460('image', 'watermark', '0'),
461('image', 'watermark_path', ''),
462('image', 'watermark_position', '0'),
463('image', 'aws_s3_active', 0),
464('image', 'aws_access_key', ''),
465('image', 'aws_secret_key', ''),
466('image', 'aws_s3_bucket', ''),
467('image', 'aws_s3_domain', ''),
468('product', 'formats', 'txt,doc,docx,pdf,tif,tiff,gif,psd,raw,wav,aif,mp3,rm,ram,wma,ogg,avi,wmv,mov,mp4,mkv,jpeg,jpg,png,zip,7z,7zip,rar,rar5,gzip,'),
469('product', 'max_size', '5'),
470('product', 'num_images', '5'),
471('product', 'products_in_home', '0'),
472('product', 'disqus', ''),
473('product', 'related', '5'),
474('product', 'reviews', '0'),
475('product', 'demo_theme', 'yeti'),
476('product', 'demo_resize', '1'),
477('product', 'download_hours', 72),
478('product', 'download_times', 3),
479('product', 'number_of_orders', 0),
480('product', 'qr_code', 0),
481('product', 'count_visits', 1),
482('email', 'notify_email', '".core::request('ADMIN_EMAIL')."'),
483('email', 'notify_name', '"."no-reply ".core::request('SITE_NAME')."'),
484('email', 'new_sale_notify', 0),
485('email', 'smtp_active', 0),
486('email', 'smtp_host', ''),
487('email', 'smtp_port', ''),
488('email', 'smtp_auth', 0),
489('email', 'smtp_secure', ''),
490('email', 'smtp_user', ''),
491('email', 'smtp_pass', ''),
492('email', 'elastic_active', 0),
493('email', 'elastic_username', ''),
494('email', 'elastic_password', ''),
495('affiliate', 'active', '0'),
496('affiliate', 'cookie', '90'),
497('affiliate', 'payment_days', '30'),
498('affiliate', 'payment_min', '50'),
499('affiliate', 'tos', ''),
500('social', 'config', '{\"debug_mode\":\"0\",\"providers\":{\"OpenID\":{\"enabled\":\"0\"},\"Yahoo\":{\"enabled\":\"0\",\"keys\":{\"key\":\"\",\"secret\":\"\"}},
501\"AOL\":{\"enabled\":\"0\"},\"Google\":{\"enabled\":\"0\",\"keys\":{\"id\":\"\",\"secret\":\"\"}},\"Facebook\":{\"enabled\":\"0\",\"keys\":{\"id\":\"\",\"secret\":\"\"}},
502\"Twitter\":{\"enabled\":\"0\",\"keys\":{\"key\":\"\",\"secret\":\"\"}},\"Live\":{\"enabled\":\"0\",\"keys\":{\"id\":\"\",\"secret\":\"\"}},\"MySpace\":{\"enabled\":\"0\",\"keys\":{\"key\":\"\",\"secret\":\"\"}},
503\"LinkedIn\":{\"enabled\":\"0\",\"keys\":{\"key\":\"\",\"secret\":\"\"}},\"Foursquare\":{\"enabled\":\"0\",\"keys\":{\"id\":\"\",\"secret\":\"\"}}},\"base_url\":\"\",\"debug_file\":\"\"}');");
504
505
506//base category
507mysqli_query($link,"INSERT INTO `".core::request('TABLE_PREFIX')."categories`
508 (`id_category` ,`name` ,`order` ,`id_category_parent` ,`parent_deep` ,`seoname` ,`description` )
509VALUES (1, 'Home category', 0 , 0, 0, 'all', 'root category');");
510
511
512//crontabs
513mysqli_query($link,"INSERT INTO `".core::request('TABLE_PREFIX')."crontab` (`name`, `period`, `callback`, `params`, `description`, `active`) VALUES
514('Sitemap', '0 3 * * *', 'Sitemap::generate', NULL, 'Regenerates the sitemap everyday at 3am',1),
515('Clean Cache', '0 5 * * *', 'Core::delete_cache', NULL, 'Once day force to flush all the cache.', 1),
516('Optimize DB', '0 4 1 * *', 'Core::optimize_db', NULL, 'once a month we optimize the DB', 1),
517('Unpaid Orders', '0 7 * * *', 'Cron_Order::unpaid', NULL, 'Notify by email unpaid orders 2 days after was created', 1);");