add class specific user count

This commit is contained in:
Daniel Seifert 2011-10-20 20:03:48 +00:00
parent 56590c6232
commit 36143b9aa5
13 changed files with 369 additions and 26 deletions

5
.gitattributes vendored
View File

@ -1,12 +1,17 @@
* text=auto !eol
changed_full/XE420-XE448/out/basic/de/d3_usersonline_lang.php -text
changed_full/XE420-XE448/out/basic/tpl/_left.tpl -text
changed_full/XE420-XE448/out/basic/tpl/inc/d3usersonline.tpl -text
changed_full/XE450/out/azure/de/d3_usersonline_lang.php -text
changed_full/XE450/out/azure/tpl/inc/d3usersonline.tpl -text
changed_full/XE450/out/azure/tpl/layout/sidebar.tpl -text
changed_full/XE450/out/basic/de/d3_usersonline_lang.php -text
changed_full/XE450/out/basic/tpl/_left.tpl -text
changed_full/XE450/out/basic/tpl/inc/d3usersonline.tpl -text
changed_full/XE451-XE453/out/azure/de/d3_usersonline_lang.php -text
changed_full/XE451-XE453/out/azure/tpl/inc/d3usersonline.tpl -text
changed_full/XE451-XE453/out/azure/tpl/layout/sidebar.tpl -text
changed_full/XE451-XE453/out/basic/de/d3_usersonline_lang.php -text
changed_full/XE451-XE453/out/basic/tpl/_left.tpl -text
changed_full/XE451-XE453/out/basic/tpl/inc/d3usersonline.tpl -text
copy_this/core/d3usersonline.php -text

View File

@ -0,0 +1,34 @@
<?php
/**
* This Software is the property of OXID eSales and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license key
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* @link http://www.oxid-esales.com
* @package lang
* @copyright (C) OXID eSales AG 2003-2009
* @version OXID eShop PE
* $Id: lang.php 19866 2009-06-16 10:33:17Z alfonsas $
*/
$sLangName = 'Deutsch';
$iLangNr = 0;
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
'charset' => 'ISO-8859-15',
'D3_USERSONLINE_USERSONLINE' => 'Benutzer online',
'D3_USERSONLINE_USER' => 'Benutzer',
'D3_USERSONLINE_USERS' => 'Benutzer',
'D3_USERSONLINE_ALL' => 'gesamt',
);
/*
[{ oxmultilang ident='ACTIONS_MAIN_YOUWANTTODELETE' }]
*/

View File

@ -1,8 +1,37 @@
[{if $oxcmp_user && $oxcmp_user->oxuser__oxrights->value == 'malladmin'}]
<strong class="h2" id="test_LeftSideInfoHeader">Online</strong>
[{strip}]
<div class="partners" style="padding-left: 10px;">
[{$usersonline }] User(s)
</div>
[{/strip}]
<strong class="h2" id="test_LeftSideInfoHeader">[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</strong>
<div class="partners" style="padding-left: 10px;">
<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;">
<b>[{$aUsersOnline.all }]</b>
</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>[{$aClassUser->classname|ucfirst}]:</td>
<td style="text-align: right;">
<b>[{$aClassUser->counter}]</b>
</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>
[{/if}]

View File

@ -0,0 +1,34 @@
<?php
/**
* This Software is the property of OXID eSales and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license key
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* @link http://www.oxid-esales.com
* @package lang
* @copyright (C) OXID eSales AG 2003-2009
* @version OXID eShop PE
* $Id: lang.php 19866 2009-06-16 10:33:17Z alfonsas $
*/
$sLangName = 'Deutsch';
$iLangNr = 0;
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
'charset' => 'ISO-8859-15',
'D3_USERSONLINE_USERSONLINE' => 'Benutzer online',
'D3_USERSONLINE_USER' => 'Benutzer',
'D3_USERSONLINE_USERS' => 'Benutzer',
'D3_USERSONLINE_ALL' => 'gesamt',
);
/*
[{ oxmultilang ident='ACTIONS_MAIN_YOUWANTTODELETE' }]
*/

View File

@ -1,8 +1,39 @@
[{if $oxcmp_user && $oxcmp_user->oxuser__oxrights->value == 'malladmin'}]
<div class="box">
<h3>Online</h3>
<h3>[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</h3>
<div class="content">
[{$usersonline }] User(s)
<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;">
<b>[{$aUsersOnline.all }]</b>
</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>[{$aClassUser->classname|ucfirst}]:</td>
<td style="text-align: right;">
<b>[{$aClassUser->counter}]</b>
</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}]

View File

@ -0,0 +1,34 @@
<?php
/**
* This Software is the property of OXID eSales and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license key
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* @link http://www.oxid-esales.com
* @package lang
* @copyright (C) OXID eSales AG 2003-2009
* @version OXID eShop PE
* $Id: lang.php 19866 2009-06-16 10:33:17Z alfonsas $
*/
$sLangName = 'Deutsch';
$iLangNr = 0;
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
'charset' => 'ISO-8859-15',
'D3_USERSONLINE_USERSONLINE' => 'Benutzer online',
'D3_USERSONLINE_USER' => 'Benutzer',
'D3_USERSONLINE_USERS' => 'Benutzer',
'D3_USERSONLINE_ALL' => 'gesamt',
);
/*
[{ oxmultilang ident='ACTIONS_MAIN_YOUWANTTODELETE' }]
*/

View File

@ -1,8 +1,37 @@
[{if $oxcmp_user && $oxcmp_user->oxuser__oxrights->value == 'malladmin'}]
<strong class="h2" id="test_LeftSideInfoHeader">Online</strong>
[{strip}]
<div class="partners" style="padding-left: 10px;">
[{$usersonline }] User(s)
</div>
[{/strip}]
<strong class="h2" id="test_LeftSideInfoHeader">[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</strong>
<div class="partners" style="padding-left: 10px;">
<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;">
<b>[{$aUsersOnline.all }]</b>
</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>[{$aClassUser->classname|ucfirst}]:</td>
<td style="text-align: right;">
<b>[{$aClassUser->counter}]</b>
</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>
[{/if}]

View File

@ -0,0 +1,34 @@
<?php
/**
* This Software is the property of OXID eSales and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license key
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* @link http://www.oxid-esales.com
* @package lang
* @copyright (C) OXID eSales AG 2003-2009
* @version OXID eShop PE
* $Id: lang.php 19866 2009-06-16 10:33:17Z alfonsas $
*/
$sLangName = 'Deutsch';
$iLangNr = 0;
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
'charset' => 'ISO-8859-15',
'D3_USERSONLINE_USERSONLINE' => 'Benutzer online',
'D3_USERSONLINE_USER' => 'Benutzer',
'D3_USERSONLINE_USERS' => 'Benutzer',
'D3_USERSONLINE_ALL' => 'gesamt',
);
/*
[{ oxmultilang ident='ACTIONS_MAIN_YOUWANTTODELETE' }]
*/

View File

@ -1,8 +1,39 @@
[{if $oxcmp_user && $oxcmp_user->oxuser__oxrights->value == 'malladmin'}]
<div class="box">
<h3>Online</h3>
<h3>[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</h3>
<div class="content">
[{$usersonline }] User(s)
<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;">
<b>[{$aUsersOnline.all }]</b>
</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>[{$aClassUser->classname|ucfirst}]:</td>
<td style="text-align: right;">
<b>[{$aClassUser->counter}]</b>
</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}]

View File

@ -0,0 +1,34 @@
<?php
/**
* This Software is the property of OXID eSales and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license key
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* @link http://www.oxid-esales.com
* @package lang
* @copyright (C) OXID eSales AG 2003-2009
* @version OXID eShop PE
* $Id: lang.php 19866 2009-06-16 10:33:17Z alfonsas $
*/
$sLangName = 'Deutsch';
$iLangNr = 0;
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
'charset' => 'ISO-8859-15',
'D3_USERSONLINE_USERSONLINE' => 'Benutzer online',
'D3_USERSONLINE_USER' => 'Benutzer',
'D3_USERSONLINE_USERS' => 'Benutzer',
'D3_USERSONLINE_ALL' => 'gesamt',
);
/*
[{ oxmultilang ident='ACTIONS_MAIN_YOUWANTTODELETE' }]
*/

View File

@ -1,8 +1,37 @@
[{if $oxcmp_user && $oxcmp_user->oxuser__oxrights->value == 'malladmin'}]
<strong class="h2" id="test_LeftSideInfoHeader">Online</strong>
[{strip}]
<div class="partners" style="padding-left: 10px;">
[{$usersonline }] User(s)
</div>
[{/strip}]
<strong class="h2" id="test_LeftSideInfoHeader">[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</strong>
<div class="partners" style="padding-left: 10px;">
<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;">
<b>[{$aUsersOnline.all }]</b>
</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>[{$aClassUser->classname|ucfirst}]:</td>
<td style="text-align: right;">
<b>[{$aClassUser->counter}]</b>
</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>
[{/if}]

View File

@ -52,9 +52,28 @@ class d3usersonline extends oxI18n
public function getUserCount()
{
$sSelect = "select count(*) from ".$this->getViewName()." order by timevisit desc";
$iCount = oxDb::getDb()->getOne($sSelect);
return $iCount;
$sSelect = "select count(*) counter, oxclass from ".$this->getViewName()." GROUP BY oxclass ORDER BY counter desc";
$rs = oxDb::getDb(1)->Execute($sSelect);
$iAllCounter = 0;
$aUserClasses = array();
if ($rs != false && $rs->RecordCount() > 0)
{
while (!$rs->EOF)
{
$oTmp = new stdClass;
$oTmp->classname = $rs->fields['oxclass'];
$oTmp->counter = $rs->fields['counter'];
$iAllCounter += $rs->fields['counter'];
$aUserClasses['classes'][] = $oTmp;
$rs->moveNext();
}
}
$aUserClasses['all'] = $iAllCounter;
return $aUserClasses;
}
public function setActTimeVisit($sUserIpHash)

View File

@ -56,7 +56,7 @@ class d3_oxcmp_utils_usersonline extends d3_oxcmp_utils_usersonline_parent
$oUserOnline->insertActUser($this->_sUserIpHash);
}
$this->_oParent->_aViewData['usersonline'] = $oUserOnline->getUserCount();
$this->_oParent->_aViewData['aUsersOnline'] = $oUserOnline->getUserCount();
return $ret;
}