/[cvs]/nfo/site/htdocs/inc/otdef/otd_html1/otd_html1.php.inc
ViewVC logotype

Diff of /nfo/site/htdocs/inc/otdef/otd_html1/otd_html1.php.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by rabit, Fri Sep 3 23:06:23 2004 UTC revision 1.6 by rabit, Sat Sep 4 03:14:14 2004 UTC
# Line 93  global $xmlcp_cdata; Line 93  global $xmlcp_cdata;
93  }  }
94    
95  function otd_html1_cb_xmlcp_start_link($h_parser, $tagname, $attribs) {  function otd_html1_cb_xmlcp_start_link($h_parser, $tagname, $attribs) {
   global $xmlcp_cdata;  
96    
97    if ($attribs['keyname']) {  global $xmlcp_cdata;
98    
99      if(isset($attribs['keyname'])) {
100    
101      $attribs['url'] = common_get_baseurl() . '?ck=' . $attribs['keyname'];      $attribs['url'] = common_get_baseurl() . '?ck=' . $attribs['keyname'];
102    
103    }    }
104    $link = '<a href="' . $attribs['url'] . '"' . ($class ? ' class="' . $class . '"' : '') . '>' . trim($xmlcp_cdata);  
105      $link = '<a href="' . $attribs['url'] . '">'; // . trim($xmlcp_cdata);
106    
107    $xmlcp_cdata .= $link;    $xmlcp_cdata .= $link;
108    
109  }  }
110    
111  function otd_html1_cb_xmlcp_end_link($h_parser, $tagname) {  function otd_html1_cb_xmlcp_end_link($h_parser, $tagname) {
112    global $xmlcp_cdata;  
113    $xmlcp_cdata .= '</a>' . "\n";  global $xmlcp_cdata;
114    
115      $xmlcp_cdata .= '</a>';
116    
117  }  }
118    
119  //----------------------------------------------------------  //----------------------------------------------------------
# Line 113  function otd_html1_cb_xmlcp_end_link($h_ Line 121  function otd_html1_cb_xmlcp_end_link($h_
121    
122  function otd_html1_renderpage($keyname, $language_id = 0) {  function otd_html1_renderpage($keyname, $language_id = 0) {
123    
124  global $common;  global $common, $common_sessiondata;
125    
126    common_benchmark_addstep('otd_html1: render: start');    common_benchmark_addstep('otd_html1: render: start');
127    
# Line 141  global $common; Line 149  global $common;
149    
150      for($i = 0; $i < count($list); $i++) {      for($i = 0; $i < count($list); $i++) {
151    
152    /*
153        $imgtag = '<img alt="' . $list[$i][4] . '" border="0" height="12" src="' . $common['site']['gfxurl'] . 'icons/flags/' . $list[$i][3] . '.gif" width="17" />';        $imgtag = '<img alt="' . $list[$i][4] . '" border="0" height="12" src="' . $common['site']['gfxurl'] . 'icons/flags/' . $list[$i][3] . '.gif" width="17" />';
154    */
155          $imgtag = otd_html1_get_imgtag('icons/flags/' . $list[$i][3] . '.gif', $list[$i][4], 12, 17);
156    
157        $titledata .= ($i ? '        $titledata .= ($i ? '
158  ' : '') . (($language_id == $list[$i][3]) ? $imgtag : '<a href="?li=' . $list[$i][3] . '" title="' . $list[$i][4] . '">' . $imgtag . '</a>');  ' : '') . (($language_id == $list[$i][3]) ? $imgtag : '<a href="?li=' . $list[$i][3] . '" title="' . $list[$i][4] . '">' . $imgtag . '</a>');
# Line 154  global $common; Line 165  global $common;
165    
166      common_benchmark_addstep('otd_html1: render: xmlcp_parse() = ' . $res);      common_benchmark_addstep('otd_html1: render: xmlcp_parse() = ' . $res);
167    
168      if($common['hostsetup']['devstate']) {      // Only show debug outputs when set as preference:
169        if($common_sessiondata['user_prefs']['debug']) {
170    
171        otd_html1_headline('$list array, readable:');        otd_html1_headline('Content list array:');
172        otd_html1_codeparagraph('$list = ' . nl2br(htmlentities(print_r($list, true))));        otd_html1_codeparagraph('$list = ' . nl2br(htmlentities(print_r($list, true))));
173    
174        otd_html1_headline('$contentdata array, readable:');        otd_html1_headline('Content query result array:');
175        otd_html1_codeparagraph('$contentdata = ' . nl2br(htmlentities(print_r($contentdata, true))));        otd_html1_codeparagraph('$contentdata = ' . nl2br(htmlentities(print_r($contentdata, true))));
176    
177        otd_html1_headline('Content XML:');        otd_html1_headline('User preferences array:');
178        otd_html1_codeparagraph(nl2br(htmlentities($xml)));        otd_html1_codeparagraph('$common_sessiondata[user_prefs] = ' . nl2br(htmlentities(print_r($common_sessiondata['user_prefs'], true))));
   
 /*  
       otd_html1_headline('$common array, readable:');  
       otd_html1_codeparagraph('$common = ' . nl2br(htmlentities(print_r($common, true))));  
   
       otd_html1_headline('$common_sessiondata array, readable:');  
       otd_html1_codeparagraph('$common_sessiondata = ' . nl2br(htmlentities(print_r($common_sessiondata, true))));  
 */  
179    
180      }      }
181    
     // Only show the informations when "devstate" is set:  
 //    if($common['hostsetup']['devstate']) {  
   
182        otd_html1_paragraph('<small>        otd_html1_paragraph('<small>
183  "<b>' . $contentdata['description'] . '</b>" (language: "<b>' . $contentdata['language_name'] . '</b>") created by <b>' . $contentdata['creator_name'] . '</b> on <b>' . date('d.m.Y, H:i:s', $contentdata['unixtime']) . '</b>.<br />  "<b>' . $contentdata['description'] . '</b>" (language: "<b>' . $contentdata['language_name'] . '</b>") created by <b>' . $contentdata['creator_name'] . '</b> on <b>' . date('d.m.Y, H:i:s', $contentdata['unixtime']) . '</b>.<br />
184  Last changes by <b>' . $contentdata['creator_name'] . '</b> on <b>' . date('d.m.Y, 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>.
185  </small>', 'box1');  </small>', 'box1');
186    
 //    }  
   
187    } else {    } else {
188    
189      otd_html1_pagetitle('Bad content request');      otd_html1_pagetitle('Bad content request');
190    
191      otd_html1_paragraph('Sorry, but the requested content is unknown.');      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.');
192    
193    }    }
194    
# Line 199  Last changes by <b>' . $contentdata['cre Line 198  Last changes by <b>' . $contentdata['cre
198    
199    common_benchmark_addstep('otd_html1: render: footer');    common_benchmark_addstep('otd_html1: render: footer');
200    
201    // Only show the benchmark list when "devstate" is set:    // Only show the benchmark list when set as preference:
202    if($common['hostsetup']['devstate']) {    if($common_sessiondata['user_prefs']['benchlist']) {
203    
204      otd_html1_benchmarkbox();      otd_html1_benchmarkbox();
205    
# Line 211  Last changes by <b>' . $contentdata['cre Line 210  Last changes by <b>' . $contentdata['cre
210  }  }
211    
212  //----------------------------------------------------------  //----------------------------------------------------------
213  //- HTML Output functions:  //- HTML return functions:
214    
215    function otd_html1_get_imgtag($relativeurl, $alt, $height = '', $width = '') {
216    
217    global $common;
218    
219      return '<img alt="' . $alt . '" src="' . $common['site']['gfxurl'] . $relativeurl . '" style="border:0;' . ($height ? ' height:' . $height . 'px;' : '') . ($width ? ' width:' . $width . 'px;' : '') . '" />';
220    
221    }
222    
223    //----------------------------------------------------------
224    //- HTML output functions:
225    
226  function otd_html1_authbox() {  function otd_html1_authbox() {
227    
# Line 220  global $common_sessiondata; Line 230  global $common_sessiondata;
230    $boxheight = 48;    $boxheight = 48;
231    $boxwidth = 280;    $boxwidth = 280;
232    
233    if($common_sessiondata['userdata']['authorised']) {    if($common_sessiondata['user_auth']['authorised']) {
234    
235      echo '<table cellspacing="0" cellpadding="2" class="f22" width="' . $boxwidth . '">      echo '<table cellspacing="0" cellpadding="2" class="f22" width="' . $boxwidth . '">
236  <tr>  <tr>
237  <th class="box2" height="' . $boxheight . '" width="44"><b>User<br />login</b></th>  <th class="box2" height="' . $boxheight . '" width="44"><b>User<br />login</b></th>
238  <td align="center" valign="top" style="padding:4px;">  <td align="center" valign="top" style="padding:4px;">
239  <small>  <small>
240  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/ >  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/ >
241  Your rights are "<b>' . $common_sessiondata['userdata']['rights'] . '</b>".  Your rights are "<b>' . $common_sessiondata['user_auth']['rights'] . '</b>".
242  </small>  </small>
243  </td>  </td>
244  </table>  </table>
# Line 242  Your rights are "<b>' . $common_sessiond Line 252  Your rights are "<b>' . $common_sessiond
252  <th class="box2" height="' . $boxheight . '" rowspan="2" width="44"><b>User<br />login</b></th>  <th class="box2" height="' . $boxheight . '" rowspan="2" width="44"><b>User<br />login</b></th>
253  <td align="right">User name:</td>  <td align="right">User name:</td>
254  <td rowspan="2">&nbsp;</td>  <td rowspan="2">&nbsp;</td>
255  <td><input name="un" size="10" type="text" value="' . $common_sessiondata['userdata']['name'] . '" tabindex="1" /></td>  <td><input name="un" size="10" type="text" tabindex="1" /></td>
256  <th class="box2" rowspan="2"><input type="submit" value="OK" tabindex="3" /></th>  <th class="box2" rowspan="2"><input type="submit" value="OK" tabindex="3" /></th>
257  </tr>  </tr>
258  <tr>  <tr>
# Line 329  global $common; Line 339  global $common;
339    $timediff = (float)($endmtimesegs[1] - $startmtimesegs[1]);    $timediff = (float)($endmtimesegs[1] - $startmtimesegs[1]);
340    $timediff += $endmtimesegs[0] - $startmtimesegs[0];    $timediff += $endmtimesegs[0] - $startmtimesegs[0];
341    
   $devstate = $common['hostsetup']['devstate'];  
   
342    echo '</td>    echo '</td>
343  <td class="bg11" width="8" rowspan="2" style="padding:0;"></td>  <td class="bg11" style="padding:0;">
344  </tr>  ' . otd_html1_get_imgtag('blank.gif', '', 1, 8) . '
 <tr>  
 <td class="bg11" nowrap="nowrap" style="border-bottom:2px solid #40a080;" valign="bottom">  
 <div class="box2" style="margin-bottom:8px;"><big>Tools:</big></div>  
 &bull; Benchmark list: [' . ($devstate ? '<a href="?devstate=0">off</a>' : '<a href="?devstate=1">on</a>') . ']  
345  </td>  </td>
346  </tr>  </tr>
347  <tr class="bg11">  <tr class="bg11">
# Line 348  Page execution time:<br /> Line 352  Page execution time:<br />
352  <code>' . round($timediff * 100000) / 100 . '</code> ms.<br />  <code>' . round($timediff * 100000) / 100 . '</code> ms.<br />
353  </td>  </td>
354  <td align="right" colspan="2">  <td align="right" colspan="2">
355  <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://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>
356  <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>  <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>
357  </td>  </td>
358  </tr>  </tr>
359  </table>  </table>
# Line 388  input { border:1px; } Line 392  input { border:1px; }
392    
393  function otd_html1_pageheader() {  function otd_html1_pageheader() {
394    
395    echo '<table cellspacing="0" cellpadding="8" style="border-bottom:2px solid #40a080;" width="100%">  global $common_sessiondata;
396    
397      $leftbarwidth = 150; // Inner width (w/o padding) of left bar.
398    
399      $benchlist = $common_sessiondata['user_prefs']['benchlist'];
400      $debug = $common_sessiondata['user_prefs']['debug'];
401    
402      echo '<table cellspacing="0" cellpadding="8" style="border-bottom:2px solid #40a080; width:100%;">
403  <tr>  <tr>
404  <td class="bg11" colspan="3">  <td class="bg11" colspan="3">
405  <table cellspacing="0" cellpadding="0" width="100%">  <table cellspacing="0" cellpadding="0" style="width:100%">
406  <tr class="bg11">  <tr class="bg11">
407  <th width="100%">  <th width="100%">
408  <span style="border-bottom:2px solid black; font-size:24pt; letter-spacing:-2pt; padding-bottom:3px;">  <span style="border-bottom:2px solid black; font-size:24pt; letter-spacing:-2pt; padding-bottom:3px;">
# Line 412  www.<font color="#107080">n</font>et<fon Line 423  www.<font color="#107080">n</font>et<fon
423  </td>  </td>
424  </tr>  </tr>
425  <tr>  <tr>
426  <td class="bg11" nowrap="nowrap" style="border-top:2px solid #40a080;" valign="top" width="160">  <td class="bg11" style="border-top:2px solid #40a080;" valign="top">
427  ';  <p>
428    <div class="box2" style="margin-bottom:8px;"><big>Navigation:</big></div>
429    echo '<div class="box2" style="margin-bottom:8px;"><big>Navigation:</big></div>  &bull; <a href="">Home page</a><br />
430  &bull; <a href="">Home page</a>  ' . otd_html1_get_imgtag('blank.gif', '', 1, $leftbarwidth) . '
431    </p>
432    <p>
433    <div class="box2" style="margin-bottom:8px;"><big>Tools:</big></div>
434    &bull; Benchmark list: [' . ($benchlist ? '<a href="?benchlist=0">off</a>' : '<a href="?benchlist=1">on</a>') . ']<br />
435    &bull; Debug outputs: [' . ($debug ? '<a href="?debug=0">off</a>' : '<a href="?debug=1">on</a>') . ']<br />
436    </p>
437  </td>  </td>
438  <td rowspan="2" style="border:2px solid #3090a8; padding:8px;">  <td style="border:2px solid #3090a8; padding:8px;" valign="top">
439  ';  ';
440    
441  }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed