-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.php
72 lines (64 loc) · 2.19 KB
/
index.php
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
<?php
ob_start();
error_reporting(0);
if (!empty($_SERVER['ConfigFile']) && is_file($_SERVER['ConfigFile'])) {
# print '<!-- using '.$_SERVER["ConfigFile"].'-->'."\n";
include $_SERVER['ConfigFile'];
} elseif (is_file('../../config/config.php')) {
# print '<!-- using ../../config/config.php-->'."\n";
include '../../config/config.php';
} else {
print "Error, cannot find config file\n";
exit;
}
$now = gettimeofday();
$GLOBALS['pagestats'] = array();
$GLOBALS['pagestats']['time_start'] = $now['sec'] * 1000000 + $now['usec'];
$GLOBALS['pagestats']['number_of_queries'] = 0;
require_once dirname(__FILE__).'/../init.php';
require_once dirname(__FILE__).'/../'.$GLOBALS['database_module'];
require_once dirname(__FILE__).'/../inc/random_compat/random.php';
require_once dirname(__FILE__).'/../../texts/english.inc';
include_once dirname(__FILE__).'/../../texts/'.$GLOBALS['language_module'];
include_once dirname(__FILE__).'/../languages.php';
require_once dirname(__FILE__).'/../defaultconfig.php';
require_once dirname(__FILE__).'/../connect.php';
require_once dirname(__FILE__).'/../inc/interfacelib.php';
include_once dirname(__FILE__).'/../ui/'.$GLOBALS['ui'].'/pagetop_minimal.php';
# record the start time(usec) of script
if (!isset($_GET['topic'])) {
$topic = 'home';
} else {
$topic = $_GET['topic'];
}
preg_match("/([\w_]+)/", $topic, $regs);
$topic = $regs[1];
$include = '';
$en_include = '';
$topic = basename($topic);
if ($topic) {
if (is_file($_SESSION['adminlanguage']['iso'].'/'.$topic.'.php')) {
$include = $_SESSION['adminlanguage']['iso'].'/'.$topic.'.php';
}
if (is_file('en/'.$topic.'.php')) {
$en_include = 'en/'.$topic.'.php';
}
}
?>
<title>help</title>
</head>
<body>
<!-- content -->
<?php
if ($include) {
include $include;
} else {
if ($en_include && is_file($en_include)) {
print $GLOBALS['I18N']->get('Sorry, this help topic does not exist in your language. Below is the english version.').' '.'<i>'.$topic.'</i><hr/>';
include $en_include;
} else {
print $GLOBALS['I18N']->get('Sorry, this help topic does not exist in your language.').' '.'<i>'.$topic.'</i>';
}
}
ob_end_flush();
print '</body></html>';