Index: branches/RC/core/kernel/processors/main_processor.php =================================================================== diff -u -r10205 -r10305 --- branches/RC/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 10205) +++ branches/RC/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 10305) @@ -1125,4 +1125,34 @@ { return $this->Application->getCounter($params['name'], $params); } + + /** + * Increments PageHit counter + * + * @param Array $params + * @return int + */ + function RegisterPageHit($params) + { + if ($this->Application->ConfigValue('UsePageHitCounter')) { + $conn =& $this->Application->Conn; + $hitcounter = (int)$conn->GetOne('SELECT VariableValue FROM '.TABLE_PREFIX.'ConfigurationValues WHERE VariableName = '.$conn->qstr('PageHitCounter')) + 1; + $conn->Query('UPDATE LOW_PRIORITY '.TABLE_PREFIX.'ConfigurationValues SET VariableValue = '.$conn->qstr($hitcounter).' WHERE VariableName = '.$conn->qstr('PageHitCounter')); + } + } + + /** + * Gets PageHit counter + * + * @param Array $params + * @return int + */ + function PageHitCounter($params) + { + if (isset($this->ConfigHash['PageHitCounter'])) { + return $this->ConfigHash['PageHitCounter']; + } else { + return $this->Application->ConfigValue('PageHitCounter'); + } + } }