forked from opencaching/opencaching-pl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharticles.php
More file actions
50 lines (45 loc) · 1.49 KB
/
articles.php
File metadata and controls
50 lines (45 loc) · 1.49 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
<?php
//prepare the templates and include all neccessary
require_once('./lib/common.inc.php');
//Preprocessing
if ($error == false) {
//get the article name to display
$article = '';
if (isset($_REQUEST['region'])) {
tpl_set_var('region', $_REQUEST['region']);
$region = $_REQUEST['region'];
}
if (isset($_REQUEST['page']) &&
(mb_strpos($_REQUEST['page'], '.') === false) &&
(mb_strpos($_REQUEST['page'], '/') === false) &&
(mb_strpos($_REQUEST['page'], '\\') === false)
) {
$article = $_REQUEST['page'];
}
if ($article == '') {
//no article specified => sitemap
$tplname = 'sitemap';
} else if (!file_exists($stylepath . '/articles/' . $article . '.tpl.php')) {
//article doesn't exists => sitemap
$tplname = 'sitemap';
} else {
//set article inside the articles-directory
switch ($_REQUEST['page']) {
case 'stat':
require_once($dynstylepath . 'charts_data.inc.php');
break;
case 's102':
$view->loadJQueryUI();
break;
default:
break;
}
if (file_exists($stylepath . '/articles/' . $article . '.inc.php')) {
require_once $stylepath . '/articles/' . $article . '.inc.php';
}
$tplname = 'articles/' . $article;
}
}
tpl_set_var('language4js', $lang);
//make the template and send it out
tpl_BuildTemplate();