diff options
author | Luke Last <lukelast@30151.no-reply.drupal.org> | 2005-09-11 19:58:59 +0000 |
---|---|---|
committer | Luke Last <lukelast@30151.no-reply.drupal.org> | 2005-09-11 19:58:59 +0000 |
commit | 58fd4e5ad3e70a0112a0a2be38bd8b09d082d298 (patch) | |
tree | fe6ff2416242d41df108cf54edcb748358286199 | |
parent | 14038f3968e2eef79bff7884707d391d6ce8acff (diff) | |
download | video-58fd4e5ad3e70a0112a0a2be38bd8b09d082d298.tar.gz video-58fd4e5ad3e70a0112a0a2be38bd8b09d082d298.tar.bz2 |
Fixed "most viewed" block. http://drupal.org/node/30943
-rw-r--r-- | video.module | 4 |
1 files 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)); } /** |