librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1885] fix statistics to use userids instead of userna


From: Clint Adams
Subject: [Librefm-commits] [1885] fix statistics to use userids instead of usernames
Date: Fri, 29 May 2009 20:04:23 +0000

Revision: 1885
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1885
Author:   clint
Date:     2009-05-29 20:04:22 +0000 (Fri, 29 May 2009)
Log Message:
-----------
fix statistics to use userids instead of usernames

Modified Paths:
--------------
    branches/stable/nixtape/data/Statistic.php
    branches/stable/nixtape/user-stats.php

Modified: branches/stable/nixtape/data/Statistic.php
===================================================================
--- branches/stable/nixtape/data/Statistic.php  2009-05-29 20:04:00 UTC (rev 
1884)
+++ branches/stable/nixtape/data/Statistic.php  2009-05-29 20:04:22 UTC (rev 
1885)
@@ -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: branches/stable/nixtape/user-stats.php
===================================================================
--- branches/stable/nixtape/user-stats.php      2009-05-29 20:04:00 UTC (rev 
1884)
+++ branches/stable/nixtape/user-stats.php      2009-05-29 20:04:22 UTC (rev 
1885)
@@ -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) {}
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]