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:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
|
<?php
error_reporting(E_ALL & ~E_NOTICE);
if (!defined('SCRIPTNAME')) {
echo 'Unzulässiger Scriptaufruf';
exit;
}
function get_tdata($tmplname) {
if(file_exists($tmplname)) {
$lines = implode("",file($tmplname));
return $lines;
} else {
print_scripterror("Fehler!", "Die Datei: $tmplname kann nicht geöffnet werden");
exit;
}
}
function get_tpldata($templatename) {
if(file_exists($templatename)) {
$templatecontent = file($templatename);
return $templatecontent;
} else {
print_scripterror("Fehler!", "Die Datei: $templatename kann nicht geöffnet werden");
exit;
}
}
function templateparser($templatedatei, $wertearray) {
if(is_array($wertearray)) {
foreach($wertearray as $key => $value) {
$suchmuster = "/<%%(".strtoupper($key).")%%>/si";
// Gefundene Platzhalter mit Werten aus $wertearray ersetzen
$templatedatei = preg_replace($suchmuster, $value, $templatedatei);
}
// Nicht ersetzte Platzhalter aus Template entfernen
$templatedatei = preg_replace("/((<%%)(.+?)(%%>))/si", '', $templatedatei);
}
return (implode("", $templatedatei));
}
function globaler_header($seitentitel ='', $zusatzcontent ='') {
$contentarray = array(
"SEITENTITEL" => $seitentitel,
"ZUSATZCONTENT" => $zusatzcontent
);
// Templatename
$templatecontent = get_tpldata("templates/header.html");
return $tp_content_out = templateparser($templatecontent, $contentarray);
}
function globallayoutoben($seitentitel = '', $navimenue = '', $navlink = '') {
$contentarray = array(
"SEITENUEBERSCHRIFT" => $seitentitel,
"MENUEAUSGABE" => get_navi($navimenue, $navlink)
);
// Templatename
$templatecontent = get_tpldata("templates/layoutoben.html");
return $tp_content_out = templateparser($templatecontent, $contentarray);
}
function globaler_footer() {
// Templatename
$contentarray = array(
"FOOTERCONTENT" => '© Laufdorf-Space 2009-2012'
);
$templatecontent = get_tpldata("templates/footer.html");
return $tp_content_out = templateparser($templatecontent, $contentarray);
}
function get_navi($navimenue = '' , $aktiverlink = '') {
if ($navimenue == 'HAUPTMENUE') {
$menuedaten = array(
'index' => 'Startseite',
'imprint' => 'Impressum',
'agb' => 'AGBs',
'contact' => 'Kontakt',
'technik' => 'Server Technik',
'webspace' => 'Webspace',
'server' => 'Server & vServer',
'domainpreise' => 'Domainpreise',
'downloads' => 'Dokumente & Downloads',
'fregeln' => 'Support Forum'
);
} elseif ($navimenue == 'FORENMENUE') {
$menuedaten = array(
'index' => 'Startseite',
'fregeln' => 'Regeln des Boardes',
'forum' => 'Supportforum'
);
}
while(list($key, $val) = each($menuedaten)) {
if ($key != $aktiverlink) {
$menuelinks .= "<a href=\"$key.php\">$val</a>\n";
} else {
$menuelinks .= "<div class=\"aktuell\">$val</div>\n";
}
}
return $menuelinks;
}
function print_scripterror($titel = '', $fehlertext = '') {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title><?php echo $titel; ?></title>
<style type="text/css">
body {
background-color: #f7f7f7;
font-family: Verdana, Arial;
font-size: 12px;
color: #000000;
}
.err {
background-color: #000000;
}
.errtop {
background-color: #ffcc00;
font-size: 12px;
color: #000000;
padding: 4px;
}
.errcont {
background-color: #ffffff;
font-size: 12px;
color: #000000;
padding: 4px;
}
</style>
</head>
<body>
<div align="center">
<table cellspacing="1" cellpadding="0" border="0" width="600" class="err">
<tr>
<td class="errtop"><b><?php echo $titel; ?></b></td>
</tr>
<tr>
<td class="errcont"><?php echo $fehlertext; ?></td>
</tr>
</table>
</div>
</body>
</html>
<?php
exit;
}
?> |