Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
Progi1984 authored Mar 24, 2020
2 parents d5b7d52 + b7e0824 commit 9a15002
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<module>
<name>statslive</name>
<displayName><![CDATA[Visitors online]]></displayName>
<version><![CDATA[2.0.2]]></version>
<version><![CDATA[2.1.0]]></version>
<description><![CDATA[Adds a list of customers and visitors who are currently online to the Stats dashboard.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[analytics_stats]]></tab>
<is_configurable>0</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>
</module>
10 changes: 5 additions & 5 deletions statslive.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct()
{
$this->name = 'statslive';
$this->tab = 'analytics_stats';
$this->version = '2.0.2';
$this->version = '2.1.0';
$this->author = 'PrestaShop';
$this->need_instance = 0;

Expand Down Expand Up @@ -73,7 +73,7 @@ private function getCustomersOnline()
INNER JOIN `'._DB_PREFIX_.'customer` u ON u.id_customer = g.id_customer
WHERE cp.`time_end` IS NULL
'.Shop::addSqlRestriction(false, 'c').'
AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', cp.`time_start`)) < 900
AND cp.`time_start` > NOW() - INTERVAL 15 MINUTE
'.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').'
GROUP BY u.id_customer
ORDER BY u.firstname, u.lastname';
Expand All @@ -82,7 +82,7 @@ private function getCustomersOnline()
FROM `'._DB_PREFIX_.'connections` c
INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest
INNER JOIN `'._DB_PREFIX_.'customer` u ON u.id_customer = g.id_customer
WHERE TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', c.`date_add`)) < 900
WHERE c.`date_add` > NOW() - INTERVAL 15 MINUTE
'.Shop::addSqlRestriction(false, 'c').'
'.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').'
GROUP BY u.id_customer
Expand Down Expand Up @@ -114,7 +114,7 @@ private function getVisitorsOnline()
WHERE (g.id_customer IS NULL OR g.id_customer = 0)
'.Shop::addSqlRestriction(false, 'c').'
AND cp.`time_end` IS NULL
AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', cp.`time_start`)) < 900
AND cp.`time_start` > NOW() - INTERVAL 15 MINUTE
'.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').'
GROUP BY c.id_connections
ORDER BY c.date_add DESC';
Expand All @@ -124,7 +124,7 @@ private function getVisitorsOnline()
INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest
WHERE (g.id_customer IS NULL OR g.id_customer = 0)
'.Shop::addSqlRestriction(false, 'c').'
AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', c.`date_add`)) < 900
AND c.`date_add` > NOW() - INTERVAL 15 MINUTE
'.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').'
ORDER BY c.date_add DESC';
}
Expand Down

0 comments on commit 9a15002

Please sign in to comment.