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