110 |
|
|
111 |
$xml = $contentdata['content']; |
$xml = $contentdata['content']; |
112 |
|
|
113 |
|
otd_html1_pagehead(); |
114 |
|
|
115 |
|
common_benchmark_addstep('otd_html1: render: head'); |
116 |
|
|
117 |
otd_html1_pageheader(); |
otd_html1_pageheader(); |
118 |
|
|
119 |
common_benchmark_addstep('otd_html1: render: header'); |
common_benchmark_addstep('otd_html1: render: header'); |
133 |
|
|
134 |
otd_html1_pagetitle($contentdata['description'], $titledata . '<br />'); |
otd_html1_pagetitle($contentdata['description'], $titledata . '<br />'); |
135 |
|
|
136 |
xmlcp_xmlpage2html($xml); |
$res = xmlcp_parse($xml); |
137 |
|
|
138 |
common_benchmark_addstep('otd_html1: render: xmlpage2html'); |
common_benchmark_addstep('otd_html1: render: xmlpc_parse() = ' . $res); |
139 |
|
|
140 |
/* |
/* |
141 |
otd_html1_headline('$list array, readable:'); |
otd_html1_headline('$list array, readable:'); |
156 |
*/ |
*/ |
157 |
|
|
158 |
// Only show the informations when "devstate" is set: |
// Only show the informations when "devstate" is set: |
159 |
if($common['hostsetup']['devstate']) { |
// if($common['hostsetup']['devstate']) { |
160 |
|
|
161 |
otd_html1_paragraph('<small> |
otd_html1_paragraph('<small> |
162 |
<b>Content informations:</b><br /> |
<b>Content informations:</b><br /> |
168 |
XML content size: <b>' . strlen($xml) . '</b> bytes |
XML content size: <b>' . strlen($xml) . '</b> bytes |
169 |
</small>', 'box2'); |
</small>', 'box2'); |
170 |
|
|
171 |
} |
// } |
172 |
|
|
173 |
} else { |
} else { |
174 |
|
|
182 |
|
|
183 |
otd_html1_pagefooter(); |
otd_html1_pagefooter(); |
184 |
|
|
185 |
|
common_benchmark_addstep('otd_html1: render: footer'); |
186 |
|
|
187 |
|
// Only show the benchmark list when "devstate" is set: |
188 |
|
if($common['hostsetup']['devstate']) { |
189 |
|
|
190 |
|
otd_html1_benchmarkbox(); |
191 |
|
|
192 |
|
} |
193 |
|
|
194 |
|
otd_html1_pagefoot(); |
195 |
|
|
196 |
} |
} |
197 |
|
|
198 |
//---------------------------------------------------------- |
//---------------------------------------------------------- |
202 |
|
|
203 |
global $common_sessiondata; |
global $common_sessiondata; |
204 |
|
|
205 |
echo '<form action="" method="post" style="margin:0;"> |
$boxheight = 48; |
206 |
<table cellspacing="0" cellpadding="2" class="f22"> |
$boxwidth = 280; |
207 |
|
|
208 |
|
if($common_sessiondata['userdata']['authorised']) { |
209 |
|
|
210 |
|
echo '<table cellspacing="0" cellpadding="2" class="f22" width="' . $boxwidth . '"> |
211 |
<tr> |
<tr> |
212 |
<th class="box2" rowspan="2"><b>User<br />login</b></th> |
<th class="box2" height="' . $boxheight . '" width="44"><b>User<br />login</b></th> |
213 |
<td rowspan="2"> </td> |
<td valign="top" style="padding:4px;"> |
214 |
<td>User:</td><td><input name="un" size="8" type="text" value="' . $common_sessiondata['userdata']['name'] . '" /></td> |
<small> |
215 |
|
You are logged in the ' . $common_sessiondata['userdata']['logincount'] . '. time as <b>' . $common_sessiondata['userdata']['name'] . '</b>. Login time was <b>' . date('H:i:s (d.m.Y)', $common_sessiondata['userdata']['logintime']) . '</b>.<br/ > |
216 |
|
Your rights are "<b>' . $common_sessiondata['userdata']['rights'] . '</b>". |
217 |
|
</small> |
218 |
|
</td> |
219 |
|
</table> |
220 |
|
'; |
221 |
|
|
222 |
|
} else { |
223 |
|
|
224 |
|
echo '<form action="" method="post" style="margin:0;"> |
225 |
|
<table cellspacing="0" cellpadding="0" class="f22" width="' . $boxwidth . '"> |
226 |
|
<tr> |
227 |
|
<th class="box2" height="' . $boxheight . '" rowspan="2" width="44"><b>User<br />login</b></th> |
228 |
|
<td align="right">User name:</td> |
229 |
<td rowspan="2"> </td> |
<td rowspan="2"> </td> |
230 |
<td class="box2" rowspan="2"><input type="submit" value="OK" /></td> |
<td><input name="un" size="10" type="text" value="' . $common_sessiondata['userdata']['name'] . '" /></td> |
231 |
|
<th class="box2" rowspan="2"><input type="submit" value="OK" /></th> |
232 |
</tr> |
</tr> |
233 |
<tr> |
<tr> |
234 |
<td>Pass:</td><td><input name="pw" size="8" type="password" /></td> |
<td align="right">Password:</td><td><input name="pw" size="10" type="password" /></td> |
235 |
</tr> |
</tr> |
236 |
</table> |
</table> |
237 |
</form> |
</form> |
238 |
'; |
'; |
239 |
|
|
240 |
|
} |
241 |
|
|
242 |
} |
} |
|
function otd_html1_codeparagraph($contents) { |
|
243 |
|
|
244 |
echo '<p align="justify" class="hl11"> |
function otd_html1_benchmarkbox() { |
|
<code> |
|
|
' . $contents . ' |
|
|
</code> |
|
|
</p> |
|
245 |
|
|
246 |
'; |
global $common; |
247 |
|
|
248 |
} |
$contents = ''; |
249 |
|
|
250 |
|
for($i = 0; $i < count($common['benchmark']); $i++) { |
251 |
|
|
252 |
function otd_html1_headline($caption) { |
$mtimesegs = explode(' ', $common['benchmark'][$i][1]); |
253 |
|
$contents .= substr('0' . ($i + 1), -2) . ': "<b>' . $common['benchmark'][$i][0] . '</b>": '; |
254 |
|
|
255 |
echo '<big><u>' . $caption . '</u></big> |
if($i) { |
256 |
|
|
257 |
|
$timediff = (float)($mtimesegs[1] - $lastmtimesegs[1]); |
258 |
|
$timediff += $mtimesegs[0] - $lastmtimesegs[0]; |
259 |
|
|
260 |
|
$contents .= '<b>+' . round($timediff * 1000000) / 1000 . '</b> ms<br /> |
261 |
'; |
'; |
262 |
|
|
263 |
} |
} else { |
264 |
|
|
265 |
function otd_html1_pagefooter() { |
$contents .= 'Start time: <b>' . date('H:i:s', $mtimesegs[1]) . substr($mtimesegs[0], 1, 4) . '</b><br /> |
266 |
|
'; |
267 |
|
|
268 |
global $common; |
} |
269 |
|
|
270 |
// Only show the benchmark list when "devstate" is set: |
$lastmtimesegs = $mtimesegs; |
|
if($common['hostsetup']['devstate']) { |
|
271 |
|
|
272 |
$contents = ''; |
} |
|
|
|
|
for($i = 0; $i < count($common['benchmark']); $i++) { |
|
273 |
|
|
274 |
$mtimesegs = explode(' ', $common['benchmark'][$i][1]); |
otd_html1_paragraph('<small> |
275 |
$contents .= substr('0' . ($i + 1), -2) . ': "<b>' . $common['benchmark'][$i][0] . '</b>": '; |
<b>Partial execution times:</b><br /> |
276 |
|
<br /> |
277 |
|
' . $contents . '</small>', 'box2'); |
278 |
|
|
279 |
if($i) { |
} |
280 |
|
|
281 |
$timediff = (float)($mtimesegs[1] - $lastmtimesegs[1]); |
function otd_html1_codeparagraph($contents) { |
|
$timediff += $mtimesegs[0] - $lastmtimesegs[0]; |
|
282 |
|
|
283 |
$contents .= '<b>+' . round($timediff * 1000000) / 1000 . '</b> ms<br /> |
echo '<p align="justify" class="hl11"> |
284 |
|
<code> |
285 |
|
' . $contents . ' |
286 |
|
</code> |
287 |
|
</p> |
288 |
'; |
'; |
289 |
|
|
290 |
} else { |
} |
291 |
|
|
292 |
$contents .= 'Start time: <b>' . date('H:i:s', $mtimesegs[1]) . substr($mtimesegs[0], 1, 4) . '</b><br /> |
function otd_html1_headline($caption) { |
293 |
|
|
294 |
|
echo '<big><u>' . $caption . '</u></big> |
295 |
'; |
'; |
296 |
|
|
297 |
} |
} |
298 |
|
|
299 |
$lastmtimesegs = $mtimesegs; |
function otd_html1_pagefoot() { |
300 |
|
|
301 |
} |
echo '</body> |
302 |
|
|
303 |
otd_html1_paragraph('<small> |
</html> |
304 |
<b>Partial execution times:</b><br /> |
'; |
|
<br /> |
|
|
' . $contents . '</small>', 'box2'); |
|
305 |
|
|
306 |
} |
} |
307 |
|
|
308 |
|
function otd_html1_pagefooter() { |
309 |
|
|
310 |
common_benchmark_addstep('COMMON: page footer'); |
global $common; |
311 |
|
|
312 |
$endmtimesegs = explode(' ', microtime()); |
$endmtimesegs = explode(' ', microtime()); |
313 |
$startmtimesegs = explode(' ', $common['benchmark'][0][1]); |
$startmtimesegs = explode(' ', $common['benchmark'][0][1]); |
316 |
|
|
317 |
$devstate = $common['hostsetup']['devstate']; |
$devstate = $common['hostsetup']['devstate']; |
318 |
|
|
319 |
echo '<table cellspacing="0" cellpadding="0" class="box1" width="100%"> |
echo '</td> |
320 |
|
<td class="bg11" width="8" rowspan="2" style="padding:0;"></td> |
321 |
|
</tr> |
322 |
<tr> |
<tr> |
323 |
<td valign="top"> |
<td class="bg11" nowrap="nowrap" style="border-bottom:2px solid #40e8e0;" valign="bottom"> |
324 |
Page execution time: <code>' . round($timediff * 100000) / 100 . '</code> ms.<br /> |
<div class="box2" style="margin-bottom:8px;"><big>Tools</big></div> |
325 |
[ ' . ($devstate ? '<a href="?devstate=0">devstate off</a>' : '<a href="?devstate=1">devstate on</a>') . ' ] |
• Benchmark list: [' . ($devstate ? '<a href="?devstate=0">off</a>' : '<a href="?devstate=1">on</a>') . '] |
326 |
</td> |
</td> |
|
<td align="right" valign="middle"><a href="http://validator.w3.org/check?uri=referer" target="_blank"><img alt="This page is valid XHTML 1.0" border="0" height="31" src="http://www.w3.org/Icons/valid-xhtml10" width="88" /></a> |
|
|
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a></td> |
|
327 |
</tr> |
</tr> |
328 |
</table> |
<tr class="bg11"> |
329 |
|
<td align="center"> |
330 |
|
<small> |
331 |
|
Page execution time:<br /> |
332 |
|
</small> |
333 |
|
<code>' . round($timediff * 100000) / 100 . '</code> ms.<br /> |
334 |
|
</td> |
335 |
|
<td align="right" colspan="2"> |
336 |
|
<a href="http://validator.w3.org/check?uri=referer" target="_blank"><img alt="This page is valid XHTML 1.0" border="0" height="31" src="http://www.w3.org/Icons/valid-xhtml10" width="88" /></a> |
337 |
|
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a> |
338 |
</td> |
</td> |
|
|
|
|
</tr> |
|
|
<tr> |
|
|
<td></td> |
|
|
<td width="100%"></td> |
|
|
<td></td> |
|
339 |
</tr> |
</tr> |
340 |
</table> |
</table> |
|
|
|
|
</body> |
|
|
|
|
|
</html> |
|
341 |
'; |
'; |
342 |
|
|
343 |
} |
} |
344 |
|
|
345 |
function otd_html1_pageheader() { |
function otd_html1_pagehead() { |
|
|
|
|
global $common, $common_sessiondata; |
|
346 |
|
|
347 |
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
348 |
|
|
367 |
</head> |
</head> |
368 |
|
|
369 |
<body> |
<body> |
|
|
|
370 |
'; |
'; |
371 |
|
|
372 |
} |
} |
373 |
|
|
374 |
function otd_html1_pagetitle($title, $additionalcontents = '') { |
function otd_html1_pageheader() { |
|
|
|
|
echo ' |
|
|
<table cellspacing="0" cellpadding="0" style="border-left:4px solid #20a0c0; border-top:4px solid #20a0c0; width:100%;"> |
|
375 |
|
|
376 |
|
echo '<table cellspacing="0" cellpadding="8" style="border-bottom:2px solid #40e8e0;" width="100%"> |
377 |
|
<tr> |
378 |
|
<td class="bg11" colspan="3"> |
379 |
|
<table cellspacing="0" cellpadding="0" width="100%"> |
380 |
<tr class="bg11"> |
<tr class="bg11"> |
381 |
|
<th width="100%"> |
382 |
<th colspan="2" style="padding:8px;"> |
<span style="border-bottom:2px solid black; font-size:24pt; letter-spacing:-2pt; padding-bottom:3px;"> |
383 |
<span style="border-bottom:2px solid black; letter-spacing:4pt; padding-bottom:4px;"> |
www.<font color="#107080">n</font>et<font color="#107080">f</font>rag.<font color="#107080">o</font>rg</span> |
384 |
<font size="5">www.netfrag.org</font> |
<p style="margin-top:4px;"> |
385 |
</span> |
<small>NetFrag and friends</small> |
386 |
<small><br /><br />NetFrag and friends</small> |
</p> |
387 |
</th> |
</th> |
388 |
|
<td> </td> |
389 |
<td style="border-right:4px solid #20a0c0; padding:8px;"> |
<td> |
390 |
'; |
'; |
391 |
|
|
392 |
otd_html1_authbox(); |
otd_html1_authbox(); |
393 |
|
|
394 |
echo '</td> |
echo '</td> |
|
|
|
395 |
</tr> |
</tr> |
396 |
|
</table> |
397 |
|
</td> |
398 |
|
</tr> |
399 |
<tr> |
<tr> |
400 |
<td class="bg11" nowrap="nowrap" width="120" style="border-bottom:4px solid #40e8e0; border-right:4px solid #20a0c0; border-top:4px solid #40e8e0; padding:8px;" valign="top"> |
<td class="bg11" nowrap="nowrap" style="border-top:2px solid #40e8e0;" valign="top" width="160"> |
401 |
...Navigation... |
'; |
402 |
|
|
403 |
|
echo '<div class="box2" style="margin-bottom:8px;"><big>Navigation</big></div> |
404 |
|
<a href="">Home page</a> |
405 |
</td> |
</td> |
406 |
|
<td rowspan="2" style="border:2px solid #20a0c0; padding:8px;"> |
407 |
|
'; |
408 |
|
|
409 |
|
} |
410 |
|
|
411 |
<td colspan="2" style="border-top:4px solid #20a0c0; padding:8px;"> |
function otd_html1_pagetitle($title, $additionalcontents = '') { |
412 |
|
|
413 |
<p class="box2"> |
echo '<p class="box2"> |
414 |
<big><b>• ' . $title . '</b> </big> |
<big><b>• ' . $title . '</b> </big> |
415 |
' . ($additionalcontents ? $additionalcontents . ' |
' . ($additionalcontents ? $additionalcontents . ' |
416 |
' : '') . '</p> |
' : '') . '</p> |
|
|
|
417 |
'; |
'; |
418 |
|
|
419 |
} |
} |
423 |
echo '<p align="justify"' . ($class ? ' class="' . $class . '"' : '') . '> |
echo '<p align="justify"' . ($class ? ' class="' . $class . '"' : '') . '> |
424 |
' . $contents . ' |
' . $contents . ' |
425 |
</p> |
</p> |
|
|
|
426 |
'; |
'; |
427 |
|
|
428 |
} |
} |