execute(array(WT_GED_ID, WT_SCRIPT_NAME, $page_parameter))->fetchOne();
// Only record one hit per session
if ($page_parameter && empty($_SESSION['SESSION_PAGE_HITS'][WT_SCRIPT_NAME.$page_parameter])) {
$_SESSION['SESSION_PAGE_HITS'][WT_SCRIPT_NAME.$page_parameter]=true;
if (is_null($hitCount)) {
$hitCount=1;
WT_DB::prepare(
"INSERT INTO `##hit_counter` (gedcom_id, page_name, page_parameter, page_count) VALUES (?, ?, ?, ?)"
)->execute(array(WT_GED_ID, WT_SCRIPT_NAME, $page_parameter, $hitCount));
} else {
$hitCount++;
WT_DB::prepare(
"UPDATE `##hit_counter` SET page_count=?".
" WHERE gedcom_id=? AND page_name=? AND page_parameter=?"
)->execute(array($hitCount, WT_GED_ID, WT_SCRIPT_NAME, $page_parameter));
}
}
} else {
$hitCount=1;
}
//replace the numbers with their images
if (array_key_exists('0', $WT_IMAGES)) {
for ($i=0;$i<10;$i++) {
$hitCount = str_replace("$i","
","$hitCount");
}
} else {
$hitCount="{$hitCount}";
}
if ($TEXT_DIRECTION=='rtl') {
$hitCount=getLRM().$hitCount.getLRM();
}
unset($page_name, $page_parameter);