1 |
rabit |
1.1 |
<?php |
2 |
|
|
/*------------------------------------------------------------------------------ |
3 |
|
|
--- www.netfrag.org |
4 |
|
|
--- Setup and common functions include file. |
5 |
|
|
-------------------------------------------------------------------------------- |
6 |
|
|
--- rabit, 21:23 31.08.2004 |
7 |
rabit |
1.12 |
--- $Id: otd_html1.php.inc,v 1.11 2004/09/06 00:11:09 rabit Exp $ |
8 |
rabit |
1.1 |
------------------------------------------------------------------------------*/ |
9 |
|
|
|
10 |
|
|
//- REQUIRED: |
11 |
|
|
//- common, cms, xmlcp |
12 |
|
|
|
13 |
|
|
//------------------------------------------------------------------------------ |
14 |
|
|
//- Name of content render function: |
15 |
|
|
|
16 |
|
|
$otd_render = 'otd_html1_renderpage'; |
17 |
|
|
|
18 |
|
|
//------------------------------------------------------------------------------ |
19 |
rabit |
1.7 |
//- Configuration: |
20 |
rabit |
1.1 |
|
21 |
rabit |
1.7 |
//- Colour sceme: |
22 |
|
|
|
23 |
|
|
$otd_html1['colours'] = array( |
24 |
|
|
|
25 |
|
|
'bg' => 'white', |
26 |
|
|
'text' => 'black', |
27 |
|
|
|
28 |
|
|
'text2' => '#107080', |
29 |
|
|
|
30 |
|
|
// Link colours: |
31 |
|
|
'a' => '#506040', |
32 |
|
|
'a:hover' => '#5060a0', |
33 |
|
|
// 'a:visited' => '#506040', |
34 |
|
|
|
35 |
|
|
// Content colours: |
36 |
|
|
'bg11' => '#40d8c0', |
37 |
|
|
'bg12' => '#40e8e0', |
38 |
rabit |
1.11 |
'border1' => '#20a0c0', |
39 |
rabit |
1.7 |
|
40 |
|
|
// Page frame colours: |
41 |
|
|
'bg21' => '#a0c090', |
42 |
|
|
'bg22' => '#40c8b0', |
43 |
|
|
'border2' => '#40a080', |
44 |
|
|
|
45 |
|
|
); |
46 |
rabit |
1.1 |
|
47 |
|
|
//------------------------------------------------------------------------------ |
48 |
rabit |
1.9 |
//- Authorisation via HTTP: |
49 |
|
|
|
50 |
|
|
if(isset($_POST['un']) && isset($_POST['pw'])) { |
51 |
|
|
|
52 |
|
|
common_authorise($_POST['un'], $_POST['pw']); |
53 |
|
|
|
54 |
|
|
common_benchmark_addstep('otd_html1: authorisation test'); |
55 |
|
|
|
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
//------------------------------------------------------------------------------ |
59 |
rabit |
1.8 |
//- GET/POST variable encapsulation: |
60 |
rabit |
1.1 |
|
61 |
rabit |
1.8 |
if(isset($_GET['debug'])) |
62 |
|
|
$common_sessiondata['user_prefs']['debug'] = $_GET['debug']; |
63 |
|
|
|
64 |
|
|
if(isset($_GET['benchlist'])) |
65 |
|
|
$common_sessiondata['user_prefs']['benchlist'] = $_GET['benchlist']; |
66 |
|
|
|
67 |
|
|
//------------------------------------------------------------------------------ |
68 |
rabit |
1.1 |
//- XMLCP callbacks setup: |
69 |
|
|
|
70 |
|
|
xmlcp_registertagcallbacks('b', 'otd_html1_cb_xmlcp_start_bold', 'otd_html1_cb_xmlcp_end_bold'); |
71 |
rabit |
1.12 |
xmlcp_registertagcallbacks('br', 'otd_html1_cb_xmlcp_break'); |
72 |
rabit |
1.1 |
xmlcp_registertagcallbacks('h', 'otd_html1_cb_xmlcp_start_headline', 'otd_html1_cb_xmlcp_end_headline'); |
73 |
|
|
//xmlcp_registertagcallbacks('page', 'otd_html1_cb_xmlcp_start_page', 'otd_html1_cb_xmlcp_end_page'); |
74 |
|
|
xmlcp_registertagcallbacks('p', 'otd_html1_cb_xmlcp_start_paragraph', 'otd_html1_cb_xmlcp_end_paragraph'); |
75 |
joko |
1.4 |
xmlcp_registertagcallbacks('link', 'otd_html1_cb_xmlcp_start_link', 'otd_html1_cb_xmlcp_end_link'); |
76 |
rabit |
1.1 |
|
77 |
rabit |
1.8 |
//---------------------------------------------------------- |
78 |
|
|
//- XMLCP callbacks: |
79 |
|
|
|
80 |
rabit |
1.12 |
function otd_html1_cb_xmlcp_break($h_parser, $tagname, $attribs) { |
81 |
|
|
|
82 |
|
|
global $xmlcp_cdata; |
83 |
|
|
|
84 |
|
|
$xmlcp_cdata .= '<br />'; |
85 |
|
|
|
86 |
|
|
} |
87 |
|
|
|
88 |
rabit |
1.1 |
function otd_html1_cb_xmlcp_start_bold($h_parser, $tagname, $attribs) { |
89 |
|
|
|
90 |
|
|
global $xmlcp_cdata; |
91 |
|
|
|
92 |
|
|
$xmlcp_cdata .= '<b>'; |
93 |
|
|
|
94 |
|
|
} |
95 |
|
|
|
96 |
|
|
function otd_html1_cb_xmlcp_end_bold($h_parser, $tagname) { |
97 |
|
|
|
98 |
|
|
global $xmlcp_cdata; |
99 |
|
|
|
100 |
|
|
$xmlcp_cdata .= '</b>'; |
101 |
|
|
|
102 |
|
|
} |
103 |
|
|
|
104 |
|
|
function otd_html1_cb_xmlcp_start_headline($h_parser, $tagname, $attribs) { |
105 |
|
|
|
106 |
|
|
global $xmlcp_cdata; |
107 |
|
|
|
108 |
|
|
$xmlcp_cdata = ''; |
109 |
|
|
|
110 |
|
|
} |
111 |
|
|
|
112 |
|
|
function otd_html1_cb_xmlcp_end_headline($h_parser, $tagname) { |
113 |
|
|
|
114 |
|
|
global $xmlcp_cdata; |
115 |
|
|
|
116 |
|
|
otd_html1_headline(trim($xmlcp_cdata)); |
117 |
|
|
|
118 |
|
|
$xmlcp_cdata = ''; |
119 |
|
|
|
120 |
|
|
} |
121 |
|
|
|
122 |
|
|
/* |
123 |
rabit |
1.8 |
function otd_html1_cb_xmlcp_start_page($h_parser, $tagname, $attribs) { } |
124 |
rabit |
1.1 |
|
125 |
rabit |
1.8 |
function otd_html1_cb_xmlcp_end_page($h_parser, $tagname) { } |
126 |
rabit |
1.1 |
*/ |
127 |
|
|
|
128 |
|
|
function otd_html1_cb_xmlcp_start_paragraph($h_parser, $tagname, $attribs) { |
129 |
|
|
|
130 |
|
|
global $xmlcp_cdata; |
131 |
|
|
|
132 |
|
|
$xmlcp_cdata = ''; |
133 |
|
|
|
134 |
|
|
} |
135 |
|
|
|
136 |
|
|
function otd_html1_cb_xmlcp_end_paragraph($h_parser, $tagname) { |
137 |
|
|
|
138 |
|
|
global $xmlcp_cdata; |
139 |
|
|
|
140 |
|
|
otd_html1_paragraph(trim($xmlcp_cdata)); |
141 |
|
|
|
142 |
|
|
$xmlcp_cdata = ''; |
143 |
|
|
|
144 |
joko |
1.4 |
} |
145 |
|
|
|
146 |
|
|
function otd_html1_cb_xmlcp_start_link($h_parser, $tagname, $attribs) { |
147 |
|
|
|
148 |
rabit |
1.6 |
global $xmlcp_cdata; |
149 |
|
|
|
150 |
|
|
if(isset($attribs['keyname'])) { |
151 |
|
|
|
152 |
joko |
1.4 |
$attribs['url'] = common_get_baseurl() . '?ck=' . $attribs['keyname']; |
153 |
rabit |
1.6 |
|
154 |
joko |
1.4 |
} |
155 |
rabit |
1.6 |
|
156 |
joko |
1.10 |
$target = ''; |
157 |
|
|
if(isset($attribs['show']) && ($attribs['show'] == 'new')) { |
158 |
|
|
$target = 'target="_blank"'; |
159 |
|
|
} |
160 |
|
|
|
161 |
|
|
$link = '<a ' . $target . ' href="' . $attribs['url'] . '">'; // . trim($xmlcp_cdata); |
162 |
joko |
1.4 |
|
163 |
|
|
$xmlcp_cdata .= $link; |
164 |
rabit |
1.6 |
|
165 |
joko |
1.4 |
} |
166 |
|
|
|
167 |
|
|
function otd_html1_cb_xmlcp_end_link($h_parser, $tagname) { |
168 |
rabit |
1.6 |
|
169 |
|
|
global $xmlcp_cdata; |
170 |
|
|
|
171 |
|
|
$xmlcp_cdata .= '</a>'; |
172 |
|
|
|
173 |
rabit |
1.1 |
} |
174 |
|
|
|
175 |
rabit |
1.8 |
//------------------------------------------------------------------------------ |
176 |
rabit |
1.1 |
//- Content render functions: |
177 |
|
|
|
178 |
|
|
function otd_html1_renderpage($keyname, $language_id = 0) { |
179 |
|
|
|
180 |
rabit |
1.6 |
global $common, $common_sessiondata; |
181 |
rabit |
1.1 |
|
182 |
|
|
common_benchmark_addstep('otd_html1: render: start'); |
183 |
|
|
|
184 |
|
|
$list = cms_getlist('xmlpage', $keyname); |
185 |
|
|
|
186 |
|
|
common_benchmark_addstep('otd_html1: render: CMS get list'); |
187 |
|
|
|
188 |
|
|
$contentdata = cms_getcontent('xmlpage', $keyname, $language_id); |
189 |
|
|
|
190 |
|
|
common_benchmark_addstep('otd_html1: render: CMS get content'); |
191 |
|
|
|
192 |
|
|
$xml = $contentdata['content']; |
193 |
|
|
|
194 |
rabit |
1.2 |
otd_html1_pagehead(); |
195 |
|
|
|
196 |
|
|
common_benchmark_addstep('otd_html1: render: head'); |
197 |
|
|
|
198 |
rabit |
1.12 |
otd_html1_pageheader('• <a href="' . common_get_baseurl() . 'pages/otd_html1/userinfo.php">CMS test page</a>'); |
199 |
rabit |
1.1 |
|
200 |
|
|
common_benchmark_addstep('otd_html1: render: header'); |
201 |
|
|
|
202 |
|
|
if($xml) { |
203 |
|
|
|
204 |
|
|
$titledata = ''; |
205 |
|
|
|
206 |
|
|
for($i = 0; $i < count($list); $i++) { |
207 |
|
|
|
208 |
rabit |
1.8 |
$imgtag = otd_html1_get_imgtag('icons/flags/' . $list[$i][3] . '.gif', $list[$i][4], 14, 21); |
209 |
rabit |
1.1 |
|
210 |
rabit |
1.8 |
$titledata .= (($language_id == $list[$i][3]) ? $imgtag : '<a href="?li=' . $list[$i][3] . '" title="' . $list[$i][4] . '">' . $imgtag . '</a>') . ' '; |
211 |
rabit |
1.1 |
|
212 |
|
|
} |
213 |
|
|
|
214 |
|
|
otd_html1_pagetitle($contentdata['description'], $titledata . '<br />'); |
215 |
|
|
|
216 |
rabit |
1.2 |
$res = xmlcp_parse($xml); |
217 |
rabit |
1.1 |
|
218 |
rabit |
1.3 |
common_benchmark_addstep('otd_html1: render: xmlcp_parse() = ' . $res); |
219 |
rabit |
1.1 |
|
220 |
rabit |
1.6 |
// Only show debug outputs when set as preference: |
221 |
|
|
if($common_sessiondata['user_prefs']['debug']) { |
222 |
rabit |
1.1 |
|
223 |
rabit |
1.6 |
otd_html1_headline('Content list array:'); |
224 |
rabit |
1.3 |
otd_html1_codeparagraph('$list = ' . nl2br(htmlentities(print_r($list, true)))); |
225 |
rabit |
1.1 |
|
226 |
rabit |
1.6 |
otd_html1_headline('Content query result array:'); |
227 |
rabit |
1.3 |
otd_html1_codeparagraph('$contentdata = ' . nl2br(htmlentities(print_r($contentdata, true)))); |
228 |
rabit |
1.1 |
|
229 |
rabit |
1.6 |
otd_html1_headline('User preferences array:'); |
230 |
|
|
otd_html1_codeparagraph('$common_sessiondata[user_prefs] = ' . nl2br(htmlentities(print_r($common_sessiondata['user_prefs'], true)))); |
231 |
rabit |
1.1 |
|
232 |
rabit |
1.3 |
} |
233 |
|
|
|
234 |
rabit |
1.8 |
$extrapageinfocontents = 'Content item "<b>' . $contentdata['description'] . '</b>" (language: "<b>' . $contentdata['language_name'] . '</b>") created by <b>' . $contentdata['creator_name'] . '</b> on <b>' . date('Y/m/d, H:i:s', $contentdata['unixtime']) . '</b>. Last changes by <b>' . $contentdata['creator_name'] . '</b> on <b>' . date('d.m.Y, H:i:s', $contentdata['unixtime']) . '</b>.<br /> |
235 |
|
|
Page created by <b>rabit</b> on <b>2004/08/31, 21:23</b>. |
236 |
|
|
'; |
237 |
rabit |
1.1 |
|
238 |
|
|
} else { |
239 |
|
|
|
240 |
|
|
otd_html1_pagetitle('Bad content request'); |
241 |
|
|
|
242 |
rabit |
1.6 |
otd_html1_paragraph('Sorry, but the requested content is unknown. Please check your query and if the problem occours again try to contact a site administrator.'); |
243 |
rabit |
1.1 |
|
244 |
|
|
} |
245 |
|
|
|
246 |
|
|
common_benchmark_addstep('otd_html1: render: content'); |
247 |
|
|
|
248 |
rabit |
1.8 |
otd_html1_pagefooter($extrapageinfocontents); |
249 |
rabit |
1.1 |
|
250 |
rabit |
1.2 |
common_benchmark_addstep('otd_html1: render: footer'); |
251 |
|
|
|
252 |
|
|
otd_html1_pagefoot(); |
253 |
|
|
|
254 |
rabit |
1.1 |
} |
255 |
|
|
|
256 |
rabit |
1.8 |
//------------------------------------------------------------------------------ |
257 |
rabit |
1.6 |
//- HTML return functions: |
258 |
|
|
|
259 |
|
|
function otd_html1_get_imgtag($relativeurl, $alt, $height = '', $width = '') { |
260 |
|
|
|
261 |
|
|
global $common; |
262 |
|
|
|
263 |
|
|
return '<img alt="' . $alt . '" src="' . $common['site']['gfxurl'] . $relativeurl . '" style="border:0;' . ($height ? ' height:' . $height . 'px;' : '') . ($width ? ' width:' . $width . 'px;' : '') . '" />'; |
264 |
|
|
|
265 |
|
|
} |
266 |
|
|
|
267 |
rabit |
1.8 |
//------------------------------------------------------------------------------ |
268 |
rabit |
1.6 |
//- HTML output functions: |
269 |
rabit |
1.1 |
|
270 |
|
|
function otd_html1_authbox() { |
271 |
|
|
|
272 |
|
|
global $common_sessiondata; |
273 |
|
|
|
274 |
rabit |
1.2 |
$boxheight = 48; |
275 |
rabit |
1.7 |
$boxwidth = 240; |
276 |
rabit |
1.2 |
|
277 |
rabit |
1.6 |
if($common_sessiondata['user_auth']['authorised']) { |
278 |
rabit |
1.2 |
|
279 |
|
|
echo '<table cellspacing="0" cellpadding="2" class="f22" width="' . $boxwidth . '"> |
280 |
rabit |
1.1 |
<tr> |
281 |
rabit |
1.7 |
<th class="box2" height="' . $boxheight . '" width="40"><b>User<br />login</b></th> |
282 |
rabit |
1.3 |
<td align="center" valign="top" style="padding:4px;"> |
283 |
rabit |
1.2 |
<small> |
284 |
rabit |
1.6 |
You are logged in the ' . $common_sessiondata['user_auth']['logincount'] . '. time as <b>' . $common_sessiondata['user_auth']['name'] . '</b>. Login time was <b>' . date('H:i:s, d.m.Y', $common_sessiondata['user_auth']['logintime']) . '</b>.<br/ > |
285 |
|
|
Your rights are "<b>' . $common_sessiondata['user_auth']['rights'] . '</b>". |
286 |
rabit |
1.2 |
</small> |
287 |
|
|
</td> |
288 |
|
|
</table> |
289 |
|
|
'; |
290 |
|
|
|
291 |
|
|
} else { |
292 |
|
|
|
293 |
rabit |
1.7 |
echo '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" style="margin:0;"> |
294 |
rabit |
1.2 |
<table cellspacing="0" cellpadding="0" class="f22" width="' . $boxwidth . '"> |
295 |
|
|
<tr> |
296 |
rabit |
1.7 |
<th class="box2" height="' . $boxheight . '" rowspan="2" width="40"><b>User<br />login</b></th> |
297 |
rabit |
1.2 |
<td align="right">User name:</td> |
298 |
rabit |
1.1 |
<td rowspan="2"> </td> |
299 |
rabit |
1.7 |
<td><input name="un" size="8" type="text" tabindex="1" /></td> |
300 |
rabit |
1.5 |
<th class="box2" rowspan="2"><input type="submit" value="OK" tabindex="3" /></th> |
301 |
rabit |
1.1 |
</tr> |
302 |
|
|
<tr> |
303 |
rabit |
1.7 |
<td align="right">Password:</td><td><input name="pw" size="8" type="password" tabindex="2" /></td> |
304 |
rabit |
1.1 |
</tr> |
305 |
|
|
</table> |
306 |
|
|
</form> |
307 |
|
|
'; |
308 |
|
|
|
309 |
rabit |
1.2 |
} |
310 |
|
|
|
311 |
rabit |
1.1 |
} |
312 |
|
|
|
313 |
rabit |
1.2 |
function otd_html1_benchmarkbox() { |
314 |
|
|
|
315 |
|
|
global $common; |
316 |
rabit |
1.1 |
|
317 |
rabit |
1.2 |
$contents = ''; |
318 |
|
|
|
319 |
|
|
for($i = 0; $i < count($common['benchmark']); $i++) { |
320 |
rabit |
1.1 |
|
321 |
rabit |
1.2 |
$mtimesegs = explode(' ', $common['benchmark'][$i][1]); |
322 |
|
|
$contents .= substr('0' . ($i + 1), -2) . ': "<b>' . $common['benchmark'][$i][0] . '</b>": '; |
323 |
rabit |
1.1 |
|
324 |
rabit |
1.2 |
if($i) { |
325 |
rabit |
1.1 |
|
326 |
rabit |
1.2 |
$timediff = (float)($mtimesegs[1] - $lastmtimesegs[1]); |
327 |
|
|
$timediff += $mtimesegs[0] - $lastmtimesegs[0]; |
328 |
rabit |
1.1 |
|
329 |
rabit |
1.2 |
$contents .= '<b>+' . round($timediff * 1000000) / 1000 . '</b> ms<br /> |
330 |
rabit |
1.1 |
'; |
331 |
|
|
|
332 |
rabit |
1.2 |
} else { |
333 |
rabit |
1.1 |
|
334 |
rabit |
1.2 |
$contents .= 'Start time: <b>' . date('H:i:s', $mtimesegs[1]) . substr($mtimesegs[0], 1, 4) . '</b><br /> |
335 |
|
|
'; |
336 |
rabit |
1.1 |
|
337 |
rabit |
1.2 |
} |
338 |
rabit |
1.1 |
|
339 |
rabit |
1.2 |
$lastmtimesegs = $mtimesegs; |
340 |
rabit |
1.1 |
|
341 |
rabit |
1.2 |
} |
342 |
rabit |
1.1 |
|
343 |
rabit |
1.2 |
otd_html1_paragraph('<small> |
344 |
|
|
<b>Partial execution times:</b><br /> |
345 |
|
|
<br /> |
346 |
rabit |
1.3 |
' . $contents . '</small>', 'box1'); |
347 |
rabit |
1.1 |
|
348 |
rabit |
1.2 |
} |
349 |
rabit |
1.1 |
|
350 |
rabit |
1.2 |
function otd_html1_codeparagraph($contents) { |
351 |
rabit |
1.1 |
|
352 |
rabit |
1.3 |
echo '<p align="justify" class="hl12"> |
353 |
rabit |
1.2 |
<code> |
354 |
|
|
' . $contents . ' |
355 |
|
|
</code> |
356 |
|
|
</p> |
357 |
rabit |
1.1 |
'; |
358 |
|
|
|
359 |
rabit |
1.2 |
} |
360 |
rabit |
1.1 |
|
361 |
rabit |
1.2 |
function otd_html1_headline($caption) { |
362 |
|
|
|
363 |
rabit |
1.8 |
global $otd_html1; |
364 |
|
|
|
365 |
rabit |
1.9 |
echo '<p><span style="border-bottom:1px solid ' . $otd_html1['colours']['border1'] . '; padding-bottom:1px;"><b>' . $caption . '</b></span></p> |
366 |
rabit |
1.1 |
'; |
367 |
|
|
|
368 |
rabit |
1.2 |
} |
369 |
|
|
|
370 |
|
|
function otd_html1_pagefoot() { |
371 |
rabit |
1.1 |
|
372 |
rabit |
1.8 |
global $common_sessiondata; |
373 |
|
|
|
374 |
|
|
// As last show the benchmark list when set as preference: |
375 |
|
|
if($common_sessiondata['user_prefs']['benchlist']) { |
376 |
|
|
|
377 |
|
|
otd_html1_benchmarkbox(); |
378 |
|
|
|
379 |
|
|
} |
380 |
|
|
|
381 |
rabit |
1.2 |
echo '</body> |
382 |
rabit |
1.1 |
|
383 |
rabit |
1.2 |
</html> |
384 |
|
|
'; |
385 |
rabit |
1.1 |
|
386 |
rabit |
1.2 |
} |
387 |
rabit |
1.1 |
|
388 |
rabit |
1.8 |
function otd_html1_pagefooter($extrapageinfocontents = '') { |
389 |
rabit |
1.1 |
|
390 |
rabit |
1.8 |
global $common, $ID; |
391 |
rabit |
1.1 |
|
392 |
rabit |
1.7 |
$contentheight = 240; // Minimum height of content and navigation. |
393 |
|
|
|
394 |
rabit |
1.1 |
$endmtimesegs = explode(' ', microtime()); |
395 |
|
|
$startmtimesegs = explode(' ', $common['benchmark'][0][1]); |
396 |
|
|
$timediff = (float)($endmtimesegs[1] - $startmtimesegs[1]); |
397 |
|
|
$timediff += $endmtimesegs[0] - $startmtimesegs[0]; |
398 |
|
|
|
399 |
rabit |
1.8 |
otd_html1_paragraph('<small> |
400 |
|
|
' . ($extrapageinfocontents ? $extrapageinfocontents . '<br /> |
401 |
|
|
' : '') . 'CVS ID: "<b>' . $ID . '</b>" |
402 |
|
|
</small>', 'box1'); |
403 |
|
|
|
404 |
rabit |
1.2 |
echo '</td> |
405 |
rabit |
1.6 |
<td class="bg11" style="padding:0;"> |
406 |
rabit |
1.7 |
' . otd_html1_get_imgtag('blank.gif', '', $contentheight, 8) . ' |
407 |
rabit |
1.1 |
</td> |
408 |
|
|
</tr> |
409 |
rabit |
1.2 |
<tr class="bg11"> |
410 |
|
|
<td align="center"> |
411 |
|
|
<small> |
412 |
|
|
Page execution time:<br /> |
413 |
|
|
</small> |
414 |
|
|
<code>' . round($timediff * 100000) / 100 . '</code> ms.<br /> |
415 |
|
|
</td> |
416 |
rabit |
1.8 |
<td align="center" colspan="2"> |
417 |
|
|
<a href="http://validator.w3.org/check?uri=referer" target="_blank"><img alt="This page is valid XHTML 1.0" src="http://www.w3.org/Icons/valid-xhtml10" style="border:0;width:88px;height:31px;" /></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> |
418 |
rabit |
1.1 |
</td> |
419 |
|
|
</tr> |
420 |
|
|
</table> |
421 |
|
|
'; |
422 |
|
|
|
423 |
|
|
} |
424 |
|
|
|
425 |
rabit |
1.2 |
function otd_html1_pagehead() { |
426 |
rabit |
1.1 |
|
427 |
rabit |
1.7 |
global $otd_html1; |
428 |
|
|
|
429 |
rabit |
1.1 |
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
430 |
|
|
|
431 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
432 |
|
|
|
433 |
|
|
<head> |
434 |
|
|
<title>www.netfrag.org</title> |
435 |
|
|
<style type="text/css"><!-- |
436 |
rabit |
1.7 |
a { color:' . $otd_html1['colours']['a'] . '; font-weight:bold; text-decoration:none; } |
437 |
|
|
a:hover { color:' . $otd_html1['colours']['a:hover'] . '; } |
438 |
|
|
body { background-color:' . $otd_html1['colours']['bg'] . '; color:' . $otd_html1['colours']['text'] . '; margin:0; } |
439 |
|
|
body, input, table { font: 8pt verdana, serif; } |
440 |
rabit |
1.1 |
input { border:1px; } |
441 |
rabit |
1.11 |
.bb1 { background-color:' . $otd_html1['colours']['border1'] . '; } |
442 |
|
|
.bb2 { background-color:' . $otd_html1['colours']['border2'] . '; } |
443 |
rabit |
1.7 |
.bg11, .f11, .hl11 { background-color:' . $otd_html1['colours']['bg11'] . '; } |
444 |
|
|
.bg12, .box1, .f12, .hl12 { background-color:' . $otd_html1['colours']['bg12'] . '; } |
445 |
|
|
.bg21, .box2, .f21, .hl21 { background-color:' . $otd_html1['colours']['bg21'] . '; } |
446 |
|
|
.bg22, .f22, .hl22 { background-color:' . $otd_html1['colours']['bg22'] . '; } |
447 |
|
|
.box1, .f11, .f12 { border:1px solid ' . $otd_html1['colours']['border1'] . '; } |
448 |
|
|
.box2, .f21, .f22 { border:1px solid ' . $otd_html1['colours']['border2'] . '; } |
449 |
|
|
.box1, .box2, .hl11, .hl12, .hl21, .hl22 { padding:4px; } |
450 |
|
|
.c2 { color:' . $otd_html1['colours']['text2'] . '; } |
451 |
rabit |
1.1 |
--></style> |
452 |
|
|
</head> |
453 |
|
|
|
454 |
|
|
<body> |
455 |
|
|
'; |
456 |
|
|
|
457 |
|
|
} |
458 |
|
|
|
459 |
rabit |
1.8 |
function otd_html1_pageheader($extranavbarcontents = '', $extratoolbarcontents = '') { |
460 |
rabit |
1.1 |
|
461 |
rabit |
1.7 |
global $common_sessiondata, $otd_html1, $request_contentkey; |
462 |
rabit |
1.6 |
|
463 |
rabit |
1.7 |
$leftbarwidth = 144; // Inner width (w/o padding) of left bar. |
464 |
rabit |
1.6 |
|
465 |
|
|
$benchlist = $common_sessiondata['user_prefs']['benchlist']; |
466 |
|
|
$debug = $common_sessiondata['user_prefs']['debug']; |
467 |
|
|
|
468 |
rabit |
1.7 |
$urlprefix = $_SERVER['PATH_INFO'] . '?ck=' . $request_contentkey . '&'; |
469 |
|
|
|
470 |
|
|
echo '<table cellspacing="0" cellpadding="8" style="border-bottom:2px solid ' . $otd_html1['colours']['border2'] . '; border-top:2px solid ' . $otd_html1['colours']['border2'] . '; width:100%;"> |
471 |
rabit |
1.2 |
<tr> |
472 |
|
|
<td class="bg11" colspan="3"> |
473 |
rabit |
1.6 |
<table cellspacing="0" cellpadding="0" style="width:100%"> |
474 |
rabit |
1.1 |
<tr class="bg11"> |
475 |
rabit |
1.2 |
<th width="100%"> |
476 |
rabit |
1.9 |
<span style="border-bottom:2px solid black; font-size:22pt; letter-spacing:-2pt; padding-bottom:3px;"> |
477 |
|
|
www.<span class="c2">N</span>et<span class="c2">F</span>rag.<span class="c2">o</span>rg</span> |
478 |
rabit |
1.7 |
<p style="margin-top:6px;"> |
479 |
rabit |
1.2 |
<small>NetFrag and friends</small> |
480 |
|
|
</p> |
481 |
rabit |
1.1 |
</th> |
482 |
rabit |
1.7 |
<td> |
483 |
|
|
' . otd_html1_get_imgtag('blank.gif', '', 1, 8) . ' |
484 |
|
|
</td> |
485 |
rabit |
1.2 |
<td> |
486 |
rabit |
1.1 |
'; |
487 |
|
|
|
488 |
|
|
otd_html1_authbox(); |
489 |
|
|
|
490 |
|
|
echo '</td> |
491 |
|
|
</tr> |
492 |
rabit |
1.2 |
</table> |
493 |
|
|
</td> |
494 |
|
|
</tr> |
495 |
|
|
<tr> |
496 |
rabit |
1.7 |
<td class="bg11" style="border-top:2px solid ' . $otd_html1['colours']['border1'] . ';" valign="top"> |
497 |
rabit |
1.8 |
<div class="box2" style="margin-bottom:16px;"><big><b>N</b>a<b>F</b>igati<b>o</b>n:</big></div> |
498 |
rabit |
1.7 |
<div style="margin-bottom:32px;"> |
499 |
rabit |
1.8 |
• <a href="' . common_get_baseurl() . '">Home page</a><br /> |
500 |
rabit |
1.12 |
' . ($extranavbarcontents ? '<br /> |
501 |
|
|
' . $extranavbarcontents . '<br /> |
502 |
|
|
' : '') . otd_html1_get_imgtag('blank.gif', '', 1, $leftbarwidth) . ' |
503 |
rabit |
1.7 |
</div> |
504 |
rabit |
1.8 |
<div class="box2" style="margin-bottom:16px;"><big>Info & tools:</big></div> |
505 |
|
|
' . ($extratoolbarcontents ? $extratoolbarcontents . '<br /> |
506 |
|
|
<br /> |
507 |
|
|
' : '') . '• Benchmark list: [<a href="' . $urlprefix . 'benchlist=' . ($benchlist ? '0">off' : '1">on') . '</a>]<br /> |
508 |
rabit |
1.7 |
• Debug outputs: [<a href="' . $urlprefix . 'debug=' . ($debug ? '0">off' : '1">on') . '</a>]<br /> |
509 |
rabit |
1.1 |
</td> |
510 |
rabit |
1.11 |
<td style="border:2px solid ' . $otd_html1['colours']['border1'] . '; padding:8px;" valign="top"> |
511 |
rabit |
1.2 |
'; |
512 |
|
|
|
513 |
|
|
} |
514 |
rabit |
1.1 |
|
515 |
rabit |
1.8 |
function otd_html1_pagetitle($title, $extracontents = '') { |
516 |
rabit |
1.1 |
|
517 |
rabit |
1.8 |
echo '<table cellspacing="0" cellpadding="4" class="box1" style="width:100%;"> |
518 |
|
|
<tr> |
519 |
|
|
<td><big><b>• ' . $title . '</b> </big></td> |
520 |
|
|
<td align="right">' . ($extracontents ? $extracontents : '') . '</td> |
521 |
|
|
</tr> |
522 |
|
|
</table> |
523 |
rabit |
1.1 |
'; |
524 |
|
|
|
525 |
|
|
} |
526 |
|
|
|
527 |
|
|
function otd_html1_paragraph($contents, $class = '') { |
528 |
|
|
|
529 |
|
|
echo '<p align="justify"' . ($class ? ' class="' . $class . '"' : '') . '> |
530 |
|
|
' . $contents . ' |
531 |
|
|
</p> |
532 |
|
|
'; |
533 |
|
|
|
534 |
|
|
} |
535 |
|
|
|
536 |
rabit |
1.11 |
function otd_html1_table($columnnames, $rows) { |
537 |
|
|
|
538 |
|
|
echo '<table cellpadding="4" cellspacing="1" class="bb1"> |
539 |
|
|
<tr class="bg11"> |
540 |
|
|
'; |
541 |
|
|
|
542 |
|
|
for($x = 0; $x < count($columnnames); $x++) { |
543 |
|
|
|
544 |
|
|
echo '<th>' . $columnnames[$x] . '</th>'; |
545 |
|
|
|
546 |
|
|
} |
547 |
|
|
|
548 |
|
|
echo ' |
549 |
|
|
</tr> |
550 |
|
|
'; |
551 |
|
|
|
552 |
|
|
for($y = 0; $y < count($rows); $y++) { |
553 |
|
|
|
554 |
|
|
echo '<tr class="bg12"> |
555 |
|
|
'; |
556 |
|
|
|
557 |
|
|
for($x = 0; $x < count($columnnames); $x++) { |
558 |
|
|
|
559 |
|
|
echo '<td>' . $rows[$y][$x] . '</td> |
560 |
|
|
'; |
561 |
|
|
|
562 |
|
|
} |
563 |
|
|
|
564 |
|
|
echo '</tr> |
565 |
|
|
'; |
566 |
|
|
|
567 |
|
|
} |
568 |
|
|
|
569 |
|
|
echo '</table> |
570 |
|
|
'; |
571 |
|
|
|
572 |
|
|
} |
573 |
|
|
|
574 |
rabit |
1.1 |
//------------------------------------------------------------------------------ |
575 |
|
|
|
576 |
|
|
?> |