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

Diff of /nfo/site/htdocs/inc/common/common.php.inc

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

revision 1.2 by rabit, Mon Aug 30 02:16:19 2004 UTC revision 1.4 by bd, Mon Aug 30 10:42:20 2004 UTC
# Line 4  Line 4 
4  --- Setup and common functions include file.  --- Setup and common functions include file.
5  --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
6  --- rabit, 04:31 24.08.2004  --- rabit, 04:31 24.08.2004
7  --- $$id$$  --- $Id$
8  ------------------------------------------------------------------------------*/  ------------------------------------------------------------------------------*/
9    
10  //------------------------------------------------------------------------------  //------------------------------------------------------------------------------
11  //- Benchmarking:  //- Benchmarking:
12    
13    // Create the benchmark steps array inside "$common":
14  $common['benchmark'] = array();  $common['benchmark'] = array();
15    
16  function common_benchmark_addstep($caption) {  function common_benchmark_addstep($caption) {
# Line 162  global $common, $common_sessiondata; Line 163  global $common, $common_sessiondata;
163    $timestamp = date('YmdHis', $common_sessiondata['birthtime']);    $timestamp = date('YmdHis', $common_sessiondata['birthtime']);
164    $useragent = $_SERVER['HTTP_USER_AGENT'];    $useragent = $_SERVER['HTTP_USER_AGENT'];
165    
166    $sql = "INSERT INTO hits (id, timestamp, address, entryurl, referer, sessionid, useragent, requestcount) VALUES (DEFAULT, FROM_UNIXTIME('$unixtime'), '$address', '$entryurl', '$referer', '$sessionid', '$useragent', '1');";    $sql = "INSERT INTO hits (id, timestamp, address, entryurl, referer, sessionid, useragent, requestcount) VALUES (NULL, FROM_UNIXTIME('$unixtime'), '$address', '$entryurl', '$referer', '$sessionid', '$useragent', '1');";
167    
168    $res = mysql_query($sql);    $res = mysql_query($sql);
169      if ($errstr = mysql_error()) {
170        print $errstr . "\n";
171      }
172    
173    if(!$res) return false;    if(!$res) return false;
174    
# Line 334  global $common; Line 338  global $common;
338    
339    common_benchmark_addstep('COMMON: PAGE: start');    common_benchmark_addstep('COMMON: PAGE: start');
340    
341    $contentdata = cms_getcontent('xmlpage', $keyname);    $list = cms_getlist('xmlpage', $keyname);
342    
343      common_benchmark_addstep('COMMON: PAGE: CMS get list');
344    
345      $contentdata = cms_getcontent('xmlpage', $keyname, $language_id);
346    
347    common_benchmark_addstep('COMMON: PAGE: CMS get content');    common_benchmark_addstep('COMMON: PAGE: CMS get content');
348    
# Line 346  global $common; Line 354  global $common;
354    
355    if($xml) {    if($xml) {
356    
357      common_pagetitle($contentdata['description']);      $titledata = '';
358    
359        for($i = 0; $i < count($list); $i++) {
360    
361          $titledata .= ($i ? ' · ' : '') . '<a href="?li=' . $list[$i][3] . '">' . $list[$i][4] . '</a>';
362    
363        }
364    
365        common_pagetitle($contentdata['description'], $titledata);
366    
367      xmlcp_xmlpage2html($xml);      xmlcp_xmlpage2html($xml);
368    
369      common_benchmark_addstep('COMMON: PAGE: xmlpage2html');      common_benchmark_addstep('COMMON: PAGE: xmlpage2html');
370    
371  /*  /*
372        common_headline('$list array, readable:');
373        common_codeparagraph('$list = ' . nl2br(htmlentities(print_r($list, true))));
374    
375      common_headline('$contentdata array, readable:');      common_headline('$contentdata array, readable:');
376      common_codeparagraph('$contentdata = ' . nl2br(htmlentities(print_r($contentdata, true))));      common_codeparagraph('$contentdata = ' . nl2br(htmlentities(print_r($contentdata, true))));
377    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

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