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

Fixed errors with backticks #5

Merged
merged 1 commit into from Dec 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions statslive.php
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 `cp.time_start` > NOW() - interval 900 second
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 `c.date_add` > NOW() - interval 900 second
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