-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
66 lines (54 loc) · 1.94 KB
/
index.php
File metadata and controls
66 lines (54 loc) · 1.94 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
<?php
/************************************************
* Powered with qEngine v17 (c) C97.net
* All rights reserved
************************************************/
// check install/
if (file_exists('./install/')) {
die('If you have just installed qEngine, please delete the <b>"install/"</b> directory on your server before using qEngine v17 (build 2019.07.26).<br />Or <a href="install/index.php">'
.'click here</a> to install qEngine 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) {
sql_query("UPDATE ".$db_prefix."config SET config_value='$sql_today' WHERE config_id='last_autoexec' LIMIT 1");
}
// 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');