librefm-commits
[Top][All Lists]
Advanced

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

[Librefm-commits] [1170] fix a bit of breakage


From: Clint Adams
Subject: [Librefm-commits] [1170] fix a bit of breakage
Date: Sun, 03 May 2009 22:15:33 +0000

Revision: 1170
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1170
Author:   clint
Date:     2009-05-03 22:15:32 +0000 (Sun, 03 May 2009)
Log Message:
-----------
fix a bit of breakage

Modified Paths:
--------------
    trunk/nixtape/data/Statistic.php
    trunk/nixtape/data/TagCloud.php

Modified: trunk/nixtape/data/Statistic.php
===================================================================
--- trunk/nixtape/data/Statistic.php    2009-05-03 22:08:05 UTC (rev 1169)
+++ trunk/nixtape/data/Statistic.php    2009-05-03 22:15:32 UTC (rev 1170)
@@ -39,7 +39,7 @@
         if (!is_string($table))          return false;
         if (!is_integer($limit))         return false;
        $query = "SELECT $field, count(*) AS count FROM $table";
-        $query .= (!is_null($constraint) || ($table == "Scrobbles")) ? ' WHERE 
' : null;
+        $query .= (!is_null($constraint)) ? ' WHERE ' : null;
        if ($field == "track") {
         $query .= (!is_null($constraint)) ? ' artist = ' . 
$mdb2->quote($constraint, 'text') : null;
        } else {
@@ -79,7 +79,7 @@
        $query = "SELECT COUNT(*) as count, DATE(TO_TIMESTAMP(time)) as date 
FROM $table";
        if( strpos($connect_string , "mysql" ) === 0 ) $query = "SELECT 
COUNT(*) as count,DATE(FROM_UNIXTIME(time)) as date FROM $table";
        
-        $query .= (!is_null($constraint) || ($table == "Scrobbles")) ? ' WHERE 
' : null;
+        $query .= (!is_null($constraint)) ? ' WHERE ' : null;
                $query .= (!is_null($constraint)) ? ' username = ' . 
$mdb2->quote($constraint, 'text') : null;
         $query .= " GROUP BY date ORDER BY date DESC LIMIT $limit";
         $res = $mdb2->query($query);

Modified: trunk/nixtape/data/TagCloud.php
===================================================================
--- trunk/nixtape/data/TagCloud.php     2009-05-03 22:08:05 UTC (rev 1169)
+++ trunk/nixtape/data/TagCloud.php     2009-05-03 22:15:32 UTC (rev 1170)
@@ -39,7 +39,7 @@
         if (!is_integer($limit))         return false;
         $sizes = array('xx-large', 'x-large', 'large', 'medium', 'small', 
'x-small', 'xx-small');
         $query = "SELECT $field, count(*) AS count FROM $table";
-        $query .= (!is_null($constraint) || (($table == "Scrobbles") || 
($table == "Free_Scrobbles"))) ? ' WHERE ' : null;
+        $query .= (!is_null($constraint)) ? ' WHERE ' : null;
         if ($constrained_field) {
             $query .= (!is_null($constraint)) ? " $constrained_field  = " . 
$mdb2->quote($constraint, 'text') : null;
         } elseif ($field == "track") {





reply via email to

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