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) { |
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 |
|
|
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 |
|
|
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 |
|
|