Merge remote-tracking branch 'remotes/origin/rel_2.x'

Cette révision appartient à :
Daniel Seifert 2017-11-21 13:29:09 +01:00
révision 3b8e6097c0
16 fichiers modifiés avec 1002 ajouts et 378 suppressions

Fichier binaire non affiché.

Voir le fichier

@ -20,6 +20,4 @@ class d3_cfg_usersonline_licence extends d3_cfg_mod_licence
protected $_hasNewsletterForm = false;
protected $_sLogType = 2;
//protected $_sBlogFeed = "http://blog.oxidmodule.com/feeds/categories/46-Angebotsanfrage.rss";
}

Voir le fichier

@ -25,5 +25,9 @@ class d3_cfg_usersonline_Main extends d3_cfg_mod_main
protected $_blHasTestModeSwitch = false;
protected $_sMenuItemTitle = 'd3mxusersonline';
protected $_sMenuSubItemTitle = 'd3mxusersonline_settings';
//protected $_sDebugHelpTextIdent = 'D3_INQUIRY_MAIN_DEBUGACTIVE_DESC';
}

Voir le fichier

@ -14,9 +14,21 @@
class d3_usersonline_statistic extends d3_cfg_mod_main
{
protected $_blUseOwnOxid = false;
protected $_iExpTime = 600; // (in seconds)
protected $_sThisTemplate = 'd3_usersonline_statistic.tpl';
protected $_sMenuItemTitle = 'd3mxusersonline';
protected $_sMenuSubItemTitle = 'd3mxusersonline_analysis';
public $blGroupByClass = false;
public function render()
{
$this->blGroupByClass = oxRegistry::getConfig()->getRequestParameter('groupbyclass') == 'true';
$this->addTplParam('blGroupByClass', $this->blGroupByClass);
return parent::render();
}
/**
* @return array
*/
@ -24,7 +36,34 @@ class d3_usersonline_statistic extends d3_cfg_mod_main
{
/** @var d3usersonline $oUsersOnline */
$oUsersOnline = oxNew('d3usersonline');
$oUsersOnline->clearOldItems($this->_iExpTime);
return $oUsersOnline->getUserCount();
$oUsersOnline->clearOldItems();
return $oUsersOnline->getUserCount($this->blGroupByClass);
}
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);
}
}

Voir le fichier

@ -36,7 +36,7 @@ $aModule = array(
'en' => '',
),
'thumbnail' => 'picture.png',
'version' => '2.0.1.1',
'version' => '2.1.0.0',
'author' => 'D³ Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'http://www.oxidmodule.com/',
@ -61,13 +61,6 @@ $aModule = array(
'events' => array(
'onActivate' => 'd3install::checkUpdateStart',
),
'blocks' => array(
array(
'template' => 'layout/sidebar.tpl',
'block' => 'sidebar_categoriestree',
'file' => 'views/blocks/layout/d3usersonline_sidebar.tpl'
),
),
'd3FileRegister' => array(
'd3/d3usersonline/IntelliSenseHelper.php',
'd3/d3usersonline/metadata.php',

Voir le fichier

@ -32,6 +32,9 @@ class d3usersonline extends oxbase
protected $_httpXComingFrom = null;
protected $_httpComingFrom = null;
protected $_iDeleteThreshold = 30; // Zeitdifferenz zwischen 2 Löschaufträgen
protected $_iExpTime = 600; // Ablaufzeit für inaktive Benutzer
/**
* constructor
*/
@ -44,12 +47,19 @@ class d3usersonline extends oxbase
/**
* @param $iExpTime
*/
public function clearOldItems($iExpTime)
public function clearOldItems()
{
startProfile(__METHOD__);
$iExptime = time() - $iExpTime;
oxDb::getDb()->Execute("delete from ".$this->getViewName()." where timevisit < $iExptime");
$iTime = time();
$iLastDeleteTime = oxRegistry::getConfig()->getShopConfVar('iLastDeleteTime', null, 'd3usersonline');
if ($iTime > $iLastDeleteTime + $this->_iDeleteThreshold) {
$iExptime = $iTime - $this->_iExpTime;
oxDb::getDb()->Execute("delete from " . $this->getViewName() . " where timevisit < $iExptime");
oxRegistry::getConfig()->saveShopConfVar('int', 'iLastDeleteTime', $iTime, null, 'd3usersonline');
}
stopProfile(__METHOD__);
}
@ -57,13 +67,18 @@ class d3usersonline extends oxbase
/**
* @return array
*/
public function getUserCount()
public function getUserCount($blGroupByClass = false)
{
startProfile(__METHOD__);
$sSelect = "select count(oxid) AS counter, oxclass from ".
$this->getViewName()." GROUP BY oxclass ORDER BY counter desc";
$aRecords = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getArray($sSelect);
if ($blGroupByClass) {
$sSelect = "SELECT count(oxid) AS counter, oxclass FROM " .
$this->getViewName() . " GROUP BY oxclass ORDER BY counter DESC";
} else {
$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;
$aUserClasses = array();
@ -73,6 +88,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;
@ -94,7 +110,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);
@ -103,6 +120,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
*/

Voir le fichier

@ -20,7 +20,6 @@
class d3_oxcmp_utils_usersonline extends d3_oxcmp_utils_usersonline_parent
{
protected $_blIsComponent = true;
protected $_iExpTime = 600; // (in seconds)
protected $_sD3UsersOnlineModId = 'd3usersonline';
/**
@ -33,7 +32,7 @@ class d3_oxcmp_utils_usersonline extends d3_oxcmp_utils_usersonline_parent
if (d3_cfg_mod::get($this->_sD3UsersOnlineModId)->isActive()) {
/** @var d3usersonline $oUsersOnline */
$oUsersOnline = oxNew('d3usersonline');
$oUsersOnline->clearOldItems($this->_iExpTime);
$oUsersOnline->clearOldItems();
$oUsersOnline->setActTimeVisit();
$oUser = $this->getUser();

Voir le fichier

@ -22,20 +22,24 @@ class d3usersonline_update extends d3install_updatebase
{
public $sModKey = 'd3usersonline';
public $sModName = 'Users Online';
public $sModVersion = '2.0.1.1';
public $sModRevision = '43';
public $sBaseConf = 'Nv6RXZkcTl5NmIybDdzQldqUWo5dURBTXB4Tld3aHN3N2pmNmZacUljL0R4WUg2a1o4QUxLeVUrdjBSZ
WFud2VjRFJDa2ZvTHVaS2tpczAyZ0NGOGxwV3ZISHB3c0xRLzQ4Ny9kcTdDSjVQZDBYZ3VUMHFNaVg1R
3ZudGMzOGhsb01Sd1dTRG4xd0xscCtORC93VXJsWngrV200YktMSk93UENWNzJuT2NaT0U0UkJaQWdqa
nVKT0RwVFFzclYrT2JnckNGZjNieVRDSzcyV2Z2QktDR3RqNWJsemd6WURVMm1tbWl5cEJNMDFvR3JiS
2F5OHIvb0VoMUw1Nm9XdWdTc2FwVWpCVWFkZEllT1lGTzdiY2I0YUdNMmV3K3kyakZQMVRuUVJyUjhKO
DQ9';
public $sModVersion = '2.1.0.0';
public $sModRevision = '2100';
public $sBaseConf = 'qWOv2==Y0dBTjQ4SGQ5Z0wwRVduakMxL01XL1c2dWlpK0p0bEJQeGZEcldMN3hINm5jOTJCWmV6MWhyV
FVDVS9KQ3hwWUtUQmM3d1RVLzBVNGZISCsxVG0wWmVlNTlYOUNGQ0g2b2Z0NGlYQWZXZGprUXdZTzE0c
zRHbGJKaEx0aWZNc3ZSTC9FdU10eHhadDA1c3NZdFlaNmZGQWF0VzUzVWxRQllhTFYxdmQyQTBLekRRM
jhrdDB5M0RnWWJQM3NMSVhBQ2RkS1l2WWJPV3lTNlNWOEwrSGxHdElTMmhoZ2FPYUhQN0lVOEpDZmVwY
0JLWndPRjVidU4rQzM3V29lcXBuaFFGdEdQZGxZZUFyWjFIZkVXVnZpT0NzTkhjV2drRzJCVStIOHVRb
0xLMGJvTTN5Z2ZYV0ZMY2NtY1dCVGkra0M=';
public $sRequirements = '';
public $sBaseValue = '';
public $sMinModCfgVersion = '4.4.0.0';
protected $_aUpdateMethods = array(
array('check' => 'checkUsersOnlineTableExist',
'do' => 'updateUsersOnlineTableExist'),
array('check' => 'checkUsersOnlineTableEngine',
'do' => 'updateUsersOnlineTableEngine'),
array('check' => 'checkRenameFields',
'do' => 'fixRenameFields'),
array('check' => 'checkDeleteFields',
@ -89,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(
@ -107,6 +121,23 @@ DQ9';
'OXCLASS' => 'OXCLASS',
),
),
'CLASSPAGE' => array(
'sTableName' => 'd3usersonline',
'sType' => '',
'sName' => 'CLASSPAGE',
'aFields' => array(
'OXCLASS' => 'OXCLASS',
'OXPAGE' => 'OXPAGE',
),
),
'TIMEVISIT' => array(
'sTableName' => 'd3usersonline',
'sType' => '',
'sName' => 'TIMEVISIT',
'aFields' => array(
'TIMEVISIT' => 'TIMEVISIT',
),
),
);
public $aRenameFields = array(
@ -162,12 +193,39 @@ DQ9';
$blRet = true;
if ($this->checkUsersOnlineTableExist()) {
$blRet = $this->_addTable2('d3usersonline', $this->aFields, $this->aIndizes, 'users online', 'MyISAM');
$blRet = $this->_addTable2('d3usersonline', $this->aFields, $this->aIndizes, 'users online', 'InnoDB');
}
return $blRet;
}
/**
* @return bool true, if table has wrong engine
*/
public function checkUsersOnlineTableEngine()
{
/** @var d3installdbtable $oDbTable */
$oDbTable = oxNew('d3installdbtable', $this);
$aData = $oDbTable->getTableData('d3usersonline');
if (isset($aData) && count($aData) && isset($aData['ENGINE']) && $aData['ENGINE'] == 'InnoDB') {
return false;
}
return true;
}
/**
* @return bool
*/
public function updateUsersOnlineTableEngine()
{
/** @var d3installdbtable $oDbTable */
$oDbTable = oxNew('d3installdbtable', $this);
$blRet = $oDbTable->changeTableEngine('d3usersonline', 'InnoDB');
return $blRet;
}
/**
* @return bool
*/

Voir le fichier

@ -25,14 +25,24 @@ $iLangNr = 0;
$aLang = array(
'charset' => 'ISO-8859-15',
'd3mxusersonline' => 'Benutzer online',
'd3mxusersonline' => '<i class="fa fa-bar-chart"></i> Benutzer online',
'd3mxusersonline_settings' => 'Einstellungen',
'd3tbclussersonline_settings_main' => 'Grundeinstellungen',
'd3mxusersonline_analysis' => 'Auswertungen',
'd3tbclusersonline_currvisitors' => 'aktuelle Besucher',
'D3USERSONLINE_NOTACTIVE' => 'Modul ist nicht aktiv',
'D3_USERSONLINE_GROUPBYCLASS' => 'Besuche nur nach Shopseiten gruppieren',
'D3_USERSONLINE_USERSONLINE' => 'Benutzer online',
'D3_USERSONLINE_USER' => 'Benutzer',
'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',
);

Voir le fichier

@ -25,14 +25,24 @@ $iLangNr = 0;
$aLang = array(
'charset' => 'ISO-8859-15',
'd3mxusersonline' => 'Users Online',
'd3mxusersonline' => '<i class="fa fa-bar-chart"></i> Users online',
'd3mxusersonline_settings' => 'Settings',
'd3tbclussersonline_settings_main' => 'Main Settings',
'd3mxusersonline_analysis' => 'Analysis',
'd3tbclusersonline_currvisitors' => 'current visitors',
'D3USERSONLINE_NOTACTIVE' => "Module isn't active",
'D3_USERSONLINE_GROUPBYCLASS' => 'group visitors by shop pages only',
'D3_USERSONLINE_USERSONLINE' => 'Users online',
'D3_USERSONLINE_USER' => 'user',
'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',
);

Voir le fichier

@ -128,7 +128,7 @@
<td class="edittext ext_edittext" align="left">
<br>
<span class="d3modcfg_btn icon status_ok">
<input type="submit" name="save" value="[{oxmultilang ident="D3_INQUIRY_MAIN_SAVE"}]">
<input type="submit" name="save" value="[{oxmultilang ident="D3_USERSONLINE_SAVE"}]">
<span></span>
</span>
<br><br>
@ -142,13 +142,3 @@
</form>
[{include file="d3_cfg_mod_inc.tpl"}]
<script type="text/javascript">
if (parent.parent) {
parent.parent.sShopTitle = "[{$actshopobj->oxshops__oxname->getRawValue()|oxaddslashes}]";
parent.parent.sMenuItem = "[{oxmultilang ident="d3mxusersonline"}]";
parent.parent.sMenuSubItem = "[{oxmultilang ident="d3mxusersonline_settings"}]";
parent.parent.sWorkArea = "[{$_act}]";
parent.parent.setTitle();
}
</script>

Voir le fichier

@ -39,6 +39,10 @@
<style type="text/css">
<!--
div.box h3 {
margin-top: 20px;
}
fieldset {
border: 1px inset black;
background-color: #F0F0F0;
@ -98,12 +102,14 @@
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="actshop" value="[{$shop->id}]">
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
<input type="hidden" id="groupbyclass" name="groupbyclass" value="false">
</form>
[{d3modcfgcheck modid="d3usersonline"}][{/d3modcfgcheck}]
[{if $mod_d3usersonline}]
[{assign var="aUsersOnline" value=$oView->getUserCount()}]
<h3>[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</h3>
<input id="groupbyclasscheckbox" value="1" type="checkbox" [{if $blGroupByClass}]checked[{/if}] onchange="document.getElementById('groupbyclass').value = this.checked; document.getElementById('transfer').submit();"> <label for="groupbyclasscheckbox">[{oxmultilang ident="D3_USERSONLINE_GROUPBYCLASS"}]</label>
<h3>[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</h3>
<div class="content">
<table style="border-style: none; width: 100%;">
<tr>
@ -125,10 +131,14 @@
<tr>
<td>
[{if $aClassUser->classname}]
[{$aClassUser->classname|ucfirst}]:
[{$oView->getControllerTitle($aClassUser->classname)}]
[{else}]
undefined:
undefined
[{/if}]
[{if $aClassUser->page}]
"[{$aClassUser->page}]"
[{/if}]
:
</td>
<td style="text-align: right; font-weight: bold;">
[{$aClassUser->counter}]&nbsp;
@ -149,13 +159,3 @@
[{/if}]
[{include file="d3_cfg_mod_inc.tpl"}]
<script type="text/javascript">
if (parent.parent) {
parent.parent.sShopTitle = "[{$actshopobj->oxshops__oxname->getRawValue()|oxaddslashes}]";
parent.parent.sMenuItem = "[{oxmultilang ident="d3mxusersonline"}]";
parent.parent.sMenuSubItem = "[{oxmultilang ident="d3mxusersonline_settings"}]";
parent.parent.sWorkArea = "[{$_act}]";
parent.parent.setTitle();
}
</script>

Voir le fichier

@ -1,50 +0,0 @@
[{d3modcfgcheck modid="d3usersonline"}][{/d3modcfgcheck}]
[{if $mod_d3usersonline}]
[{if $oxcmp_user && $oxcmp_user->getFieldData('oxrights') == 'malladmin'}]
<div class="box">
<h3>[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</h3>
<div class="content">
<table style="border-style: none; width: 100%;">
<tr>
<td style="border-bottom: 1px solid silver;">
[{oxmultilang ident="D3_USERSONLINE_ALL"}]
</td>
<td style="border-bottom: 1px solid silver; text-align: right; font-weight: bold;">
[{$aUsersOnline.all}]&nbsp;
</td>
<td style="border-bottom: 1px solid silver; text-align: left;">
[{if $aUsersOnline.all == 1}]
[{oxmultilang ident="D3_USERSONLINE_USER"}]
[{else}]
[{oxmultilang ident="D3_USERSONLINE_USERS"}]
[{/if}]
</td>
</tr>
[{foreach from=$aUsersOnline.classes item="aClassUser"}]
<tr>
<td>
[{if $aClassUser->classname}]
[{$aClassUser->classname|ucfirst}]:
[{else}]
undefined:
[{/if}]
</td>
<td style="text-align: right; font-weight: bold;">
[{$aClassUser->counter}]&nbsp;
</td>
<td style="text-align: left;">
[{if $aClassUser->counter == 1}]
[{oxmultilang ident="D3_USERSONLINE_USER"}]
[{else}]
[{oxmultilang ident="D3_USERSONLINE_USERS"}]
[{/if}]
</td>
</tr>
[{/foreach}]
</table>
</div>
</div>
[{/if}]
[{/if}]
[{$smarty.block.parent}]

Fichier binaire non affiché.

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -1,3 +1,12 @@
=> 2.1.0.0
- Datenbank-Tabelle auf InnoDb geändert
- Tabellenindizes für optimierte Abfragen ergänzt
- Löschabfragen wegen mglw. hoher Datenbanklast begrenzt
- Besuchereinträge wurden um Seitendetails ergänzt
- Auswertung im Backend lässt sich zwischen bisheriger und neuer Gruppierung umschalten
- Auswertung im Frontend entfernt (#6828)
- fehlerhafte Übersetzung korrigiert (#6827)
=> 2.0.1.1
- Precheck für PHP 5.5 und 5.6 angepasst