<?
// register an event of the type
// "CHM file download" (download/manual)
// if it does not exist, it will be created
// register the event using the current visitor parameters
// check if the current visitor tried to download the file
// within the last hour
// get the event type ID
$rs = CStatEventType::GetByEvents($event1, $event2);
if ($ar = $rs->Fetch())
{
// get all events of this type for the current visitor
// for the last hour (3600 sec)
$rs = CStatEvent::GetListByGuest($_SESSION["SESS_GUEST_ID"],
$ar["TYPE_ID"], "", 3600);
// if no such event occurred
if (!($ar=$rs->Fetch()))
{
// add the event!
CStatEvent::AddCurrent("download", "manual");
}
}
?>