. * * @author Aggrosoft, Dł Data Development */ class d3ce_online_users extends oxI18n { /** * Object core table name * * @var string */ protected $_sCoreTbl = 'd3ce_online_users'; /** * Current class name * * @var string */ protected $_sClassName = 'd3ce_online_users'; public function __construct($aParams = null) { parent::__construct(); $this->init( 'd3ce_online_users' ); } public function clearOldItems($iExpTime) { $exptime = time() - $iExpTime; oxDb::getDb()->Execute("delete from ".$this->_sCoreTbl." where timevisit < $exptime"); } public function getActUserItem($sUserIPHash) { $sSelect = "select count(*) from $this->_sCoreTbl where visitor='".$sUserIPHash."'"; return oxDb::getDb()->getOne( $sSelect ); } public function getUserCount() { $sSelect = "select count(*) from ".$this->_sCoreTbl." order by timevisit desc"; $iCount = oxDb::getDb()->getOne($sSelect); return $iCount; } public function setActTimeVisit($sUserIpHash) { oxDb::getDb()->Execute("update ".$this->_sCoreTbl." set timevisit='".time()."', oxclass = '".$this->getConfig()->getActiveView()->getClassName()."' where visitor='".$sUserIpHash."'"); } public function insertActUser($sUserIpHash) { oxDb::getDb()->Execute("insert into ".$this->_sCoreTbl." (visitor,timevisit,oxclass) values ('".$sUserIpHash."','".time()."', '".$this->getConfig()->getActiveView()->getClassName()."')"); } }