aboutsummaryrefslogtreecommitdiffstats
path: root/admin/stats.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-09-18 21:56:56 +0000
committerplegall <plg@piwigo.org>2005-09-18 21:56:56 +0000
commitb1c5e25b5e4eed872230ebffe72cc7ece4533ee2 (patch)
tree9cd046c0f62256e839f18a7d8a88e67531d00c2c /admin/stats.php
parent2e8a34adc77cad3c4a8592057a2dd88e6f090e36 (diff)
- bug 107 fixed: crash when logging visit on a category containing "'"
character. Correction reported from branch 1.4 - bug fixed: in admin/stats, incorrect SQL queries gave no result. git-svn-id: http://piwigo.org/svn/trunk@868 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/stats.php')
-rw-r--r--admin/stats.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/admin/stats.php b/admin/stats.php
index 61e3fbe39..5e823a38d 100644
--- a/admin/stats.php
+++ b/admin/stats.php
@@ -80,8 +80,11 @@ while ( $row = mysql_fetch_array( $result ) )
$value = '';
if (isset($_GET['month']) && isset($_GET['year']) )
{
- $where_clause = "DATE_FORMAT(date,'%Y-%m-%d') = '".$row['d']."'";
- $value = substr($row['d'],8,2);
+ $where_clause = 'DAYOFMONTH(date) = '.$row['d'].'
+ AND MONTH(date) = '.$row['m'].'
+ AND YEAR(date) = '.$row['y'];
+ $week_day = $lang['day'][date('w', mktime(12,0,0,$row['m'],$row['d'],$row['y']))];
+ $value = $row['d'].' ('.$week_day.')';
}
else
{
@@ -97,12 +100,10 @@ while ( $row = mysql_fetch_array( $result ) )
// Number of pictures seen
$query = '
-SELECT COUNT(*) as p,
- FILE as f
+SELECT COUNT(*) as p
FROM '.HISTORY_TABLE.'
WHERE '.$where_clause.'
AND FILE = \'picture\'
- GROUP BY FILE
;';
$pictures = mysql_fetch_array(pwg_query( $query ));