-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
170 lines (127 loc) · 4.56 KB
/
index.php
File metadata and controls
170 lines (127 loc) · 4.56 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
/************************************************
/************************************************
Diese Software wurde erstellt von Ralph Voigt, www.dukedrake.de
Das Kopieren, Verändern oder Weitergeben dieser oder anderer Dateien der Software
ist nur bei Inkenntnissetzen des Autors erlaubt (voigt@dukedrake.de)
initial version by R.Voigt 2012-2015
*************************************************
*************************************************/
// production version
error_reporting(0); @ini_set('display_errors', 0);
// debug version
// error_reporting(E_ALL);
header('content-type: text/html; charset=utf-8');
// setup multilanguage support
$pagelang = 'en';
$filelang = 'EN';
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $_SERVER['HTTP_ACCEPT_LANGUAGE'][0].$_SERVER['HTTP_ACCEPT_LANGUAGE'][1] == "de") {
$pagelang = 'de';
$filelang = '';
}
$query = "home";
if($_GET['query']) {
$lastin = strlen($_GET['query']) - 1;
$query = $_GET['query'][$lastin] == "/" ? substr($_GET['query'],0,-1) : $_GET['query'];
}
// check for languageversion
$checkfallback = false;
if ( !file_exists('html/'.$query.$filelang.'.html') && !file_exists('html/'.$query.$filelang.'.php') ) $checkfallback = true;
// check for corrupt query or load fallback version
if ( $checkfallback && (file_exists('html/'.$query.'.html') || file_exists('html/'.$query.'.php') ) ) $filelang = '';
elseif ( $checkfallback ) $query = "home";
// check if query is a module
$ptype = "html";
if ( file_exists('html/'.$query.$filelang.'.php') ) $ptype = "php";
include('pagedata.php');
$pageData = $pagelang == 'de' ? $pageDataDE : $pageDataEN;
foreach($pageData as $name => $page) $pageData[$name]['active'] = "";
$pageData[$query]['active'] = 'active';
$loadRightCol = false;
$addWidth = ' class="leftwide"';
if(!isset($pageData[$query]['norightcol']) || !$pageData[$query]['norightcol']) {
$loadRightCol = true;
$addWidth = '';
}
// prepare head details
$jsfiles = "";
if(isset($pageData[$query]['js']) && is_array($pageData[$query]['js'])) {
for($i=0;$i<count($pageData[$query]['js']);$i++) {
$jsfiles .= '<script src="' . $pageData[$query]['js'][$i] . '"></script>';
}
}
$topmenu = ' <ul class="nav"> ';
foreach($pageData as $name=>$cpage) {
if($cpage['type']=="top") {
$chref = isset($cpage['url']) ? $cpage['url'] : '/'.$name.'/';
$topmenu .= '
<li><a href="'.$chref.'" title="'.$cpage['linkdesc'].'" class="'.$name.' '.$cpage['active'].'">'.$cpage['linkname'].'</a></li>';
}
}
$topmenu .= ' </ul>';
include('pagehead.php');
$page .= '
<div id="fixedtop">
' . $topmenu . '
</div>
<div id="container">
<div id="title">
<a href="/">
<img alt="" title="plainfame CMS" src="/img/PFCMS_logo.png" style="box-shadow: 0px 0px 15px rgba(0,0,0,0.7); background: rgba(255,255,255,0.7); " />
</a>
</div>
' . $topmenu . '
<div id="content">
<div id="leftcontent"' . $addWidth . '>
';
// flush if page to prepare script
echo $page;
$page = "";
if($ptype == "php") {
include('html/'.$query.$filelang.'.php');
} else {
$page = file_get_contents('html/'.$query.$filelang.'.html');
}
$page .= '
</div>
';
if($loadRightCol) {
$page .= '
<div id="rightcontent">
<div id="rightcontenttop">';
$page .= file_get_contents('html/right.html');
$page .= '
</div>
<div id="fbbox">';
$page .= file_get_contents('html/infobox.html');
$page .= '
</div>
</div>
';
}
$page .= '
</div>
<div id="footer">
';
foreach($pageData as $name=>$cpage) {
if($cpage['type']=="bottom") {
$chref = isset($cpage['url']) ? $cpage['url'] : '/'.$name.'/';
$page .= '<a href="'.$chref.'" class="'.$cpage['active'].'" title="'.$cpage['linkdesc'].'">'.$cpage['linkname'].'</a> ';
}
}
$page .= '
</div>
</div>
</body>
</html>
';
echo $page;
/************************************************
/************************************************
Diese Software wurde erstellt von Ralph Voigt, www.dukedrake.de
Das Kopieren, Verändern oder Weitergeben dieser oder anderer Dateien der Software
ist nur bei Inkenntnissetzen des Autors erlaubt (voigt@dukedrake.de)
initial version by R.Voigt 2012-2015
*************************************************
*************************************************/
?>