From 58fd4e5ad3e70a0112a0a2be38bd8b09d082d298 Mon Sep 17 00:00:00 2001 From: Luke Last Date: Sun, 11 Sep 2005 19:58:59 +0000 Subject: Fixed "most viewed" block. http://drupal.org/node/30943 --- video.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video.module b/video.module index c49428a..ac10642 100644 --- a/video.module +++ b/video.module @@ -557,8 +557,8 @@ function video_block($op = 'list', $delta = 0) { * string HTML content for a block */ function video_block_list($type = 'top') { - $orderby = ($type == 'new') ? 'n.created' : 'v.download_counter'; - return node_title_list(db_query_range(db_rewrite_sql("SELECT DISTINCT(n.nid), n.title FROM {node} n, {video} v WHERE n.type = 'video' AND n.status = 1 AND n.moderate = 0 ORDER by $orderby DESC"),0, 10)); + $orderby = ($type == 'new') ? 'n.created' : 'v.download_counter + v.play_counter'; + return node_title_list(db_query_range(db_rewrite_sql("SELECT n.nid, n.title FROM {node} n, {video} v WHERE n.nid = v.nid AND n.type = 'video' AND n.status = 1 AND n.moderate = 0 ORDER BY $orderby DESC"),0, 10)); } /** -- cgit v1.2.3