diff --git a/copy_this/modules/d3/d3usersonline/controllers/admin/d3_usersonline_statistic.php b/copy_this/modules/d3/d3usersonline/controllers/admin/d3_usersonline_statistic.php index 13c2b0b..e39df09 100644 --- a/copy_this/modules/d3/d3usersonline/controllers/admin/d3_usersonline_statistic.php +++ b/copy_this/modules/d3/d3usersonline/controllers/admin/d3_usersonline_statistic.php @@ -31,4 +31,31 @@ class d3_usersonline_statistic extends d3_cfg_mod_main $oUsersOnline->clearOldItems($this->_iExpTime); return $oUsersOnline->getUserCount(); } + + public function getControllerTitle($sControllerIdent) + { + $oLang = oxRegistry::getLang(); + $sTranslationIdent = 'D3_USERSONLINE_CLASS_'.strtoupper($sControllerIdent); + $sTranslation = $oLang->translateString( + $sTranslationIdent, + null, + false + ); + + if ($sTranslation !== $sTranslationIdent) { + return $sTranslation; + } else { + $sTranslationIdent = 'PAGE_TITLE_'.strtoupper($sControllerIdent); + $sTranslation = $oLang->translateString( + $sTranslationIdent, + null, + true + ); + if ($sTranslation !== $sTranslationIdent) { + return $sTranslation; + } + } + + return ucfirst($sControllerIdent); + } } diff --git a/copy_this/modules/d3/d3usersonline/models/d3usersonline.php b/copy_this/modules/d3/d3usersonline/models/d3usersonline.php index 0bf24b4..65f9dce 100644 --- a/copy_this/modules/d3/d3usersonline/models/d3usersonline.php +++ b/copy_this/modules/d3/d3usersonline/models/d3usersonline.php @@ -70,8 +70,8 @@ class d3usersonline extends oxbase { startProfile(__METHOD__); - $sSelect = "select count(oxid) AS counter, oxclass from ". - $this->getViewName()." GROUP BY oxclass ORDER BY counter desc"; + $sSelect = "select count(oxid) AS counter, oxclass, oxpage from ". + $this->getViewName()." GROUP BY oxclass, oxpage ORDER BY counter desc"; $aRecords = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getAll($sSelect); $iAllCounter = 0; @@ -82,6 +82,7 @@ class d3usersonline extends oxbase $oTmp = new stdClass; $oTmp->classname = $aRecord['OXCLASS']; + $oTmp->page = $aRecord['OXPAGE']; $oTmp->counter = $aRecord['COUNTER']; $iAllCounter += $aRecord['COUNTER']; $aUserClasses['classes'][] = $oTmp; @@ -103,7 +104,8 @@ class d3usersonline extends oxbase $aValues = array( 'timevisit' => time(), - 'oxclass' => oxRegistry::getConfig()->getActiveView()->getClassName() + 'oxclass' => oxRegistry::getConfig()->getActiveView()->getClassName(), + 'oxpage' => $this->getPageIdent(), ); $this->assign($aValues); @@ -112,6 +114,51 @@ class d3usersonline extends oxbase stopProfile(__METHOD__); } + /** + * @return null|string + */ + public function getPageIdent() + { + switch (strtolower(oxRegistry::getConfig()->getActiveView()->getClassName())) + { + case 'details': + case 'oxwarticledetails': + if (($oView = oxRegistry::getConfig()->getActiveView()) + && method_exists($oView, 'getProduct') + ) { + return $oView->getProduct()->getFieldData('oxtitle'); + } + return null; + case 'alist': + case 'manufacturerlist': + case 'vendorlist': + if (($oView = oxRegistry::getConfig()->getActiveView()) + && method_exists($oView, 'getTitle') + ) { + return $oView->getTitle(); + } + return null; + case 'search': + return oxRegistry::getConfig()->getRequestParameter('searchparam'); + case 'content': + if (($oView = oxRegistry::getConfig()->getActiveView()) + && method_exists($oView, 'getContent') + ) { + return $oView->getContent()->getFieldData('oxtitle'); + } + return null; + case 'tag': + if (($oView = oxRegistry::getConfig()->getActiveView()) + && method_exists($oView, 'getTag') + ) { + return $oView->getTag(); + } + return null; + } + + return null; + } + /** * @return string */ diff --git a/copy_this/modules/d3/d3usersonline/setup/d3usersonline_update.php b/copy_this/modules/d3/d3usersonline/setup/d3usersonline_update.php index 841067b..d2f8df4 100644 --- a/copy_this/modules/d3/d3usersonline/setup/d3usersonline_update.php +++ b/copy_this/modules/d3/d3usersonline/setup/d3usersonline_update.php @@ -93,6 +93,16 @@ DQ9'; 'sExtra' => '', 'blMultilang' => false, ), + 'OXPAGE' => array( + 'sTableName' => 'd3usersonline', + 'sFieldName' => 'OXPAGE', + 'sType' => 'VARCHAR(32)', + 'blNull' => false, + 'sDefault' => false, + 'sComment' => '', + 'sExtra' => '', + 'blMultilang' => false, + ), ); public $aIndizes = array( @@ -111,6 +121,15 @@ DQ9'; 'OXCLASS' => 'OXCLASS', ), ), + 'CLASSPAGE' => array( + 'sTableName' => 'd3usersonline', + 'sType' => '', + 'sName' => 'CLASSPAGE', + 'aFields' => array( + 'OXCLASS' => 'OXCLASS', + 'OXPAGE' => 'OXPAGE', + ), + ), 'TIMEVISIT' => array( 'sTableName' => 'd3usersonline', 'sType' => '', diff --git a/copy_this/modules/d3/d3usersonline/views/admin/de/d3usersonline_lang.php b/copy_this/modules/d3/d3usersonline/views/admin/de/d3usersonline_lang.php index a6818d9..45c7093 100644 --- a/copy_this/modules/d3/d3usersonline/views/admin/de/d3usersonline_lang.php +++ b/copy_this/modules/d3/d3usersonline/views/admin/de/d3usersonline_lang.php @@ -36,4 +36,12 @@ $aLang = array( 'D3_USERSONLINE_USERS' => 'Benutzer', 'D3_USERSONLINE_ALL' => 'gesamt', 'D3_USERSONLINE_SAVE' => 'Speichern', + 'D3_USERSONLINE_CLASS_ALIST' => 'Artikelliste aus Kategorie', + 'D3_USERSONLINE_CLASS_MANUFACTURERLIST' => 'Artikelliste aus Hersteller', + 'D3_USERSONLINE_CLASS_VENDORLIST' => 'Artikelliste aus Lieferant', + 'D3_USERSONLINE_CLASS_CONTENT' => 'Informationstext', + 'D3_USERSONLINE_CLASS_OXWARTICLEDETAILS' => 'Detailseite', + 'D3_USERSONLINE_CLASS_DETAILS' => 'Detailseite', + 'D3_USERSONLINE_CLASS_START' => 'Startseite', + 'D3_USERSONLINE_CLASS_TAGS' => 'Stichwort', ); diff --git a/copy_this/modules/d3/d3usersonline/views/admin/en/d3usersonline_lang.php b/copy_this/modules/d3/d3usersonline/views/admin/en/d3usersonline_lang.php index 64d6f52..0e038e7 100644 --- a/copy_this/modules/d3/d3usersonline/views/admin/en/d3usersonline_lang.php +++ b/copy_this/modules/d3/d3usersonline/views/admin/en/d3usersonline_lang.php @@ -36,4 +36,12 @@ $aLang = array( 'D3_USERSONLINE_USERS' => 'users', 'D3_USERSONLINE_ALL' => 'all', 'D3_USERSONLINE_SAVE' => 'save', + 'D3_USERSONLINE_CLASS_ALIST' => 'article list from category', + 'D3_USERSONLINE_CLASS_MANUFACTURERLIST' => 'article list from manufacturer', + 'D3_USERSONLINE_CLASS_VENDORLIST' => 'article list from vendor', + 'D3_USERSONLINE_CLASS_CONTENT' => 'information text', + 'D3_USERSONLINE_CLASS_OXWARTICLEDETAILS' => 'details page', + 'D3_USERSONLINE_CLASS_DETAILS' => 'details page', + 'D3_USERSONLINE_CLASS_START' => 'start page', + 'D3_USERSONLINE_CLASS_TAGS' => 'tag', ); diff --git a/copy_this/modules/d3/d3usersonline/views/admin/tpl/d3_usersonline_statistic.tpl b/copy_this/modules/d3/d3usersonline/views/admin/tpl/d3_usersonline_statistic.tpl index 921b1eb..9ceffeb 100644 --- a/copy_this/modules/d3/d3usersonline/views/admin/tpl/d3_usersonline_statistic.tpl +++ b/copy_this/modules/d3/d3usersonline/views/admin/tpl/d3_usersonline_statistic.tpl @@ -125,10 +125,14 @@