forked from cunaedy/Cart-Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
73 lines (60 loc) · 2.33 KB
/
index.php
File metadata and controls
73 lines (60 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/************************************************
* Powered with qEngine v16.2 (c) C97.net
* All rights reserved
************************************************/
// check install/
if (file_exists('./install/')) {
die('If you have just installed Cart Engine, please delete the <b>"install/"</b> directory on your server before using Cart Engine v7.0 (build 2018.02.12). Or <a href="install/index.php">'
.'click here</a> to install Cart Engine for the first time.');
}
// very important file
require_once "./includes/user_init.php";
// get param?
$cmd = get_param('cmd');
switch ($cmd) {
case 'skin':
$skin = get_param('skin');
if (file_exists('./skins/'.$skin.'/outline.tpl')) {
$_SESSION[$db_prefix.'override_skin'] = $skin;
}
redir();
break;
case 'viewmode':
$view_mode = get_param('mode');
if ($view_mode == 'desktop') {
$_SESSION[$db_prefix.'view_mode'] = 'desktop';
} else {
$_SESSION[$db_prefix.'view_mode'] = 'mobile';
}
redir();
break;
case 'lang':
$l = get_param('lang');
$foo = sql_qquery("SELECT * FROM ".$db_prefix."language WHERE lang_id='$l' LIMIT 1");
if ($foo) {
$_SESSION[$db_prefix.'language'] = $l;
}
redir();
break;
}
// demo mode? -- if it is, check if it needs content reset
if (($config['demo_mode']) && ($config['last_autoexec'] != $sql_today)) {
require './includes/admin_func.php';
require $config['demo_path'].'/reset.php';
}
// auto exec (this block will be executed daily)
if ($config['last_autoexec'] != $sql_today) {
$d2 = convert_date($sql_today, 'sql', -1);
sql_query("DELETE FROM ".$db_prefix."user WHERE (user_id LIKE 'guest*%') AND (user_passwd='++XPRESS++') AND (user_since < '$d2')");
sql_query("UPDATE ".$db_prefix."config SET config_value='$sql_today' WHERE config_id='last_autoexec' LIMIT 1");
$n = time() - ($config['cart']['delete_old_orders'] * 24 * 3600);
if ($config['cart']['delete_old_orders']) {
sql_query("DELETE FROM ".$db_prefix."orders WHERE timeadd < $n");
}
}
// load tpl
$tpl = load_tpl('welcome.tpl');
$txt['main_body'] = quick_tpl($tpl, $txt);
generate_html_header($config['site_name'].' '.$config['cat_separator'].' '.$config['site_slogan']);
flush_tpl('_blank');