forked from phpList/phplist-lan-help
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
74 lines (66 loc) · 2.11 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
73
<?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;
if (!isset($systemroot)) {
$systemroot = dirname(__FILE__).'/..';
}
require_once $systemroot.'/init.php';
require_once $systemroot.'/'.$GLOBALS["database_module"];
require_once $systemroot."/../texts/english.inc";
include_once $systemroot."/../texts/".$GLOBALS["language_module"];
include_once $systemroot."/languages.php";
require_once $systemroot."/defaultconfig.php";
require_once $systemroot.'/connect.php';
require_once $systemroot."/commonlib/lib/interfacelib.php";
include_once $systemroot."/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
print "<h3>phplist Help: $topic</h3>";
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>';