diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-04-19 07:22:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-04-19 07:22:51 +0000 |
commit | 9f82fee1b7daec3bce4dc7524364cafdbb7eadc3 (patch) | |
tree | f84c5f39fc2dc70bd7a0e937bcb38a99b99d6bf5 /modules | |
parent | 39bed948ae86708130c6e8d7d5c0b5d573195b11 (diff) | |
download | brdo-9f82fee1b7daec3bce4dc7524364cafdbb7eadc3.tar.gz brdo-9f82fee1b7daec3bce4dc7524364cafdbb7eadc3.tar.bz2 |
- Fixed broken query in the statistics module. Fix by Gary Lawrence Murphy.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/statistics.module | 4 | ||||
-rw-r--r-- | modules/statistics/statistics.module | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/modules/statistics.module b/modules/statistics.module index 0022de5be..7dec3f05d 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -850,7 +850,6 @@ function statistics_page() { /* Generates the statistics user page */ function statistics_page_user($uid = 0, $date = 0, $all = 0) { - if (!$date) { $date = time(); } @@ -885,9 +884,8 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { function statistics_summary($dbfield, $dbrows) { /* valid dbfields: totalcount, daycount, timestamp */ - $output = ""; - $result = db_query_range("SELECT statistics.nid,node.title FROM statistics LEFT JOIN node ON statistics.nid = node.nid ORDER BY %s DESC LIMIT", $dbfield, 0, $dbrows); + $result = db_query_range("SELECT n.nid, n.title FROM statistics s LEFT JOIN node n ON s.nid = n.nid ORDER BY %s DESC", $dbfield, 0, $dbrows); while ($nid = db_fetch_array($result)) { $content = node_load(array("nid" => $nid["nid"])); $links = link_node($content, 1); diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 0022de5be..7dec3f05d 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -850,7 +850,6 @@ function statistics_page() { /* Generates the statistics user page */ function statistics_page_user($uid = 0, $date = 0, $all = 0) { - if (!$date) { $date = time(); } @@ -885,9 +884,8 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { function statistics_summary($dbfield, $dbrows) { /* valid dbfields: totalcount, daycount, timestamp */ - $output = ""; - $result = db_query_range("SELECT statistics.nid,node.title FROM statistics LEFT JOIN node ON statistics.nid = node.nid ORDER BY %s DESC LIMIT", $dbfield, 0, $dbrows); + $result = db_query_range("SELECT n.nid, n.title FROM statistics s LEFT JOIN node n ON s.nid = n.nid ORDER BY %s DESC", $dbfield, 0, $dbrows); while ($nid = db_fetch_array($result)) { $content = node_load(array("nid" => $nid["nid"])); $links = link_node($content, 1); |