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) { |
149 |
} |
} |
150 |
|
|
151 |
//------------------------------------------------------------------------------ |
//------------------------------------------------------------------------------ |
152 |
|
//- URL parameter flags and variables: |
153 |
|
|
154 |
|
if(isset($_GET['devstate'])) $common_sessiondata['userdata']['devstate'] = $_GET['devstate']; |
155 |
|
|
156 |
|
if(isset($common_sessiondata['userdata']['devstate'])) $common['hostsetup']['devstate'] = $common_sessiondata['userdata']['devstate']; |
157 |
|
|
158 |
|
//------------------------------------------------------------------------------ |
159 |
//- Functions: |
//- Functions: |
160 |
|
|
161 |
function common_protocolhit() { |
function common_protocolhit() { |
170 |
$timestamp = date('YmdHis', $common_sessiondata['birthtime']); |
$timestamp = date('YmdHis', $common_sessiondata['birthtime']); |
171 |
$useragent = $_SERVER['HTTP_USER_AGENT']; |
$useragent = $_SERVER['HTTP_USER_AGENT']; |
172 |
|
|
173 |
$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');"; |
174 |
|
|
175 |
$res = mysql_query($sql); |
$res = mysql_query($sql); |
176 |
|
if ($errstr = mysql_error()) { |
177 |
|
print $errstr . "\n"; |
178 |
|
} |
179 |
|
|
180 |
if(!$res) return false; |
if(!$res) return false; |
181 |
|
|
345 |
|
|
346 |
common_benchmark_addstep('COMMON: PAGE: start'); |
common_benchmark_addstep('COMMON: PAGE: start'); |
347 |
|
|
348 |
$contentdata = cms_getcontent('xmlpage', $keyname); |
$list = cms_getlist('xmlpage', $keyname); |
349 |
|
|
350 |
|
common_benchmark_addstep('COMMON: PAGE: CMS get list'); |
351 |
|
|
352 |
|
$contentdata = cms_getcontent('xmlpage', $keyname, $language_id); |
353 |
|
|
354 |
common_benchmark_addstep('COMMON: PAGE: CMS get content'); |
common_benchmark_addstep('COMMON: PAGE: CMS get content'); |
355 |
|
|
361 |
|
|
362 |
if($xml) { |
if($xml) { |
363 |
|
|
364 |
common_pagetitle($contentdata['description']); |
$titledata = ''; |
365 |
|
|
366 |
|
for($i = 0; $i < count($list); $i++) { |
367 |
|
|
368 |
|
$titledata .= ($i ? ' · ' : '') . '<a href="?li=' . $list[$i][3] . '">' . $list[$i][4] . '</a>'; |
369 |
|
|
370 |
|
} |
371 |
|
|
372 |
|
common_pagetitle($contentdata['description'], $titledata); |
373 |
|
|
374 |
xmlcp_xmlpage2html($xml); |
xmlcp_xmlpage2html($xml); |
375 |
|
|
376 |
common_benchmark_addstep('COMMON: PAGE: xmlpage2html'); |
common_benchmark_addstep('COMMON: PAGE: xmlpage2html'); |
377 |
|
|
378 |
/* |
/* |
379 |
|
common_headline('$list array, readable:'); |
380 |
|
common_codeparagraph('$list = ' . nl2br(htmlentities(print_r($list, true)))); |
381 |
|
|
382 |
common_headline('$contentdata array, readable:'); |
common_headline('$contentdata array, readable:'); |
383 |
common_codeparagraph('$contentdata = ' . nl2br(htmlentities(print_r($contentdata, true)))); |
common_codeparagraph('$contentdata = ' . nl2br(htmlentities(print_r($contentdata, true)))); |
384 |
|
|