[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1888] fix statistics to use userids instead of userna
From: |
Clint Adams |
Subject: |
[Librefm-commits] [1888] fix statistics to use userids instead of usernames |
Date: |
Wed, 03 Jun 2009 14:49:42 +0000 |
Revision: 1888
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1888
Author: clint
Date: 2009-06-03 14:49:42 +0000 (Wed, 03 Jun 2009)
Log Message:
-----------
fix statistics to use userids instead of usernames
Modified Paths:
--------------
trunk/nixtape/data/Statistic.php
trunk/nixtape/user-stats.php
Modified: trunk/nixtape/data/Statistic.php
===================================================================
--- trunk/nixtape/data/Statistic.php 2009-06-03 14:49:39 UTC (rev 1887)
+++ trunk/nixtape/data/Statistic.php 2009-06-03 14:49:42 UTC (rev 1888)
@@ -43,7 +43,7 @@
if ($field == 'track') {
$query .= (!is_null($constraint)) ? ' artist = ' .
$adodb->qstr($constraint) : null;
} else {
- $query .= (!is_null($constraint)) ? ' username = ' .
$adodb->qstr($constraint) : null;
+ $query .= (!is_null($constraint)) ? ' userid = ' .
($constraint) : null;
}
$query .= ' GROUP BY ' . $field . ' ORDER BY count DESC LIMIT '
. $limit;
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
@@ -81,7 +81,7 @@
if( strpos($connect_string , 'mysql' ) === 0 ) $query = 'SELECT
COUNT(*) as count,DATE(FROM_UNIXTIME(time)) as date FROM ' . $table;
$query .= (!is_null($constraint)) ? ' WHERE ' : null;
- $query .= (!is_null($constraint)) ? ' username = ' .
$adodb->qstr($constraint) : null;
+ $query .= (!is_null($constraint)) ? ' username = ' .
($constraint) : null;
$query .= ' GROUP BY date ORDER BY date DESC LIMIT ' . $limit;
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
try {
Modified: trunk/nixtape/user-stats.php
===================================================================
--- trunk/nixtape/user-stats.php 2009-06-03 14:49:39 UTC (rev 1887)
+++ trunk/nixtape/user-stats.php 2009-06-03 14:49:42 UTC (rev 1888)
@@ -43,12 +43,12 @@
$smarty->assign('stat_barwidth', 320);
try {
- $aUserPlayStat = Statistic::GeneratePlayStats('Scrobbles', 'artist',
40, $user->name, 300);
+ $aUserPlayStat = Statistic::GeneratePlayStats('Scrobbles', 'artist',
40, $user->uniqueid, 300);
$smarty->assign('user_playstats',$aUserPlayStat);
} catch (exception $e) {}
try {
- $aUserDayStat = Statistic::generatePlayByDays('Scrobbles', 40,
$user->name, 300);
+ $aUserDayStat = Statistic::generatePlayByDays('Scrobbles', 40,
$user->uniqueid, 300);
$smarty->assign('user_daystats',$aUserDayStat);
} catch (exception $e) {}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1888] fix statistics to use userids instead of usernames,
Clint Adams <=