diff -ru modules.orig/download_count/download_count.module modules/download_count/download_count.module
--- modules.orig/download_count/download_count.module   2007-05-28 01:22:49.000000000 -0500
+++ modules/download_count/download_count.module        2007-05-19 16:45:34.000000000 -0500
@@ -138,8 +138,8 @@
 
   drupal_set_title(variable_get('download_counter_view_page_title', t('Download counter')));
 
-  $header[] = array('data' => t('filename'), 'field' => 'filename');
-  $header[] = array('data' => t('hits'), 'field' => 'count', 'sort' => 'desc');
+  $header[] = array('data' => t('filename'), 'field' => 'filename', 'sort' => 'desc');
+  $header[] = array('data' => t('hits'), 'field' => 'count');
   $header[] = array('data' => t('last download'), 'field' => 'timestamp');
   $header[] = array('data' => t('action'));
   
@@ -148,11 +148,13 @@
   $fileDirectoryPath = file_directory_path() . '/';
 
   if(user_access('view all downloads count')) {
-         $result = db_query("SELECT fd.filename, fd.count, fd.timestamp, f.nid, n.type FROM {file_downloads} fd JOIN {files} f ON f.filepath = CONCAT('%s', fd.filename) JOIN {node} n ON n.nid = f.nid"  . tablesort_sql($header), $fileDirectoryPath);
-       }
-       else {
-         $result = db_query("SELECT fd.filename, fd.count, fd.timestamp, f.nid, n.type FROM {file_downloads} fd JOIN {files} f ON f.filepath = CONCAT('%s', fd.filename) JOIN {node} n ON n.nid = f.nid WHERE n.uid = %d" . tablesort_sql($header), $fileDirectoryPath, $user->uid);
-       }
+    $result = db_query("SELECT filename, count, timestamp FROM {file_downloads}"  . tablesort_sql($header));
+    #$result = db_query("SELECT fd.filename, fd.count, fd.timestamp, f.nid, n.type FROM {file_downloads} fd JOIN {files} f ON f.filepath = CONCAT('%s', fd.filename) JOIN {node} n ON n.nid = f.nid"  . tablesort_sql($header), $fileDirectoryPath);
+  }
+  else {
+    $result = false;
+    #$result = db_query("SELECT fd.filename, fd.count, fd.timestamp, f.nid, n.type FROM {file_downloads} fd JOIN {files} f ON f.filepath = CONCAT('%s', fd.filename) JOIN {node} n ON n.nid = f.nid WHERE n.uid = %d" . tablesort_sql($header), $fileDirectoryPath, $user->uid);
+  }
 
   while ($file = db_fetch_object($result)) {
     $row = array();

