aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Last <lukelast@30151.no-reply.drupal.org>2005-09-11 19:58:59 +0000
committerLuke Last <lukelast@30151.no-reply.drupal.org>2005-09-11 19:58:59 +0000
commit58fd4e5ad3e70a0112a0a2be38bd8b09d082d298 (patch)
treefe6ff2416242d41df108cf54edcb748358286199
parent14038f3968e2eef79bff7884707d391d6ce8acff (diff)
downloadvideo-58fd4e5ad3e70a0112a0a2be38bd8b09d082d298.tar.gz
video-58fd4e5ad3e70a0112a0a2be38bd8b09d082d298.tar.bz2
Fixed "most viewed" block. http://drupal.org/node/30943
-rw-r--r--video.module4
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));
}
/**