> ------------------------------------------------------------------------------ See main.inc.php for release information EStat_PIP : classe to manage plugin public pages --------------------------------------------------------------------------- */ include_once('estat_root.class.inc.php'); include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCUserAgent.class.inc.php'); include_once(ESTAT_LIB.'statDB.class.inc.php'); class EStat_PIP extends EStat_root { public function __construct($prefixeTable, $filelocation) { parent::__construct($prefixeTable, $filelocation); $this->loadConfig(); $this->initEvents(); } public function initEvents() { parent::initEvents(); add_event_handler('pwg_log_allowed', array(&$this, 'logVisit'), 50, 3); } public function logVisit($do_log, $image_id=null, $image_type=null) { global $conf, $user, $page; if($do_log) { $statDB=new StatDBMonth($this->fileStatDir, self::FILE_MONTH, date('Y'), date('m')); if($statDB->open(ASDF_OPEN_WRITE)) { $ua=GPCUserAgent::parse($_SERVER['HTTP_USER_AGENT']); $statDB->addLog( array( 'date' => time(), 'IPadress' => $_SERVER['REMOTE_ADDR'], 'userId' => $user['id'], 'catId' => isset($page['category']['id'])?$page['category']['id']:0, 'imageId' => ($image_id!=null)?$image_id:0, 'section' => isset($page['section'])?$page['section']:'', 'tagsId' => ('tags'==$page['section'])?implode(',', $page['tag_ids']):'', 'userAgent' => $_SERVER['HTTP_USER_AGENT'], 'uaBrowser' => $ua[UA_DATA_BROWSER], 'uaEngine' => $ua[UA_DATA_ENGINE], 'uaOS' => $ua[UA_DATA_OS], 'uaType' => $ua[UA_DATA_BROWSER_TYPE], 'uaBrowserVersion' => $ua[UA_DATA_BROWSER_VERSION], 'uaEngineVersion' => $ua[UA_DATA_ENGINE_VERSION], 'uaOSVersion' => $ua[UA_DATA_OS_VERSION], 'screenSizeW' => 0, 'screenSizeH' => 0 ) ); $statDB->close(true); } $this->checkBuildStatPeriod(false, ($this->config['compress.public']=='y' and $this->config['compress.method']=='gz')); } return($do_log); } } //class ?>