forked from opencaching/opencaching-pl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
articles.php
84 lines (71 loc) · 2.77 KB
/
articles.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
74
75
76
77
78
79
80
81
82
83
84
<?php
/* * *************************************************************************
./articles.php
-------------------
begin : Mon June 14 2004
copyright : (C) 2004 The OpenCaching Group
forum contact at : http://www.opencaching.com/phpBB2
* ************************************************************************* */
/* * *************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* ************************************************************************* */
/* * **************************************************************************
Unicode Reminder ăĄă˘
Display documents/articles with a minimum of code and no preprocessing
used template(s): articles/*, sitemap
parameter(s): page specifies the document which should be
displayed
* ************************************************************************** */
//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('./graphs/cachetypes-oc.php');
tpl_set_var('oc_statistics_link', genStatPieUrl());
break;
default:
break;
}
if (file_exists($stylepath . '/articles/' . $article . '.inc.php')) {
require_once $stylepath . '/articles/' . $article . '.inc.php';
}
$tplname = 'articles/' . $article;
}
}
if ((date('m') == 4) and ( date('d') == 1)) {
tpl_set_var('list_of_news', tr('PrimaAprilis'));
tpl_set_var('news', tr('PMOnly'));
$tplname = 'news';
}
tpl_set_var('language4js', $lang);
//make the template and send it out
tpl_BuildTemplate();
?>