diff -up release/project_release.install release_patched/project_release.install
--- release/project_release.install	2006-12-22 15:53:20.000000000 -0800
+++ release_patched/project_release.install	2007-01-30 09:40:34.000000000 -0800
@@ -19,6 +19,7 @@ function project_release_install() {
           version_minor int default NULL,
           version_patch int default NULL,
           version_extra varchar(255) default NULL,
+          downloads int unsigned default '0',
           PRIMARY KEY (nid),
           KEY project_releases_pid (pid)
         ) TYPE=MyISAM
@@ -56,6 +57,7 @@ function project_release_install() {
             version_minor int default NULL,
             version_patch int default NULL,
             version_extra varchar(255) default NULL,
+            downloads int default '0',
             PRIMARY KEY (nid),
             KEY project_releases_pid (pid)
           );");
@@ -147,3 +149,17 @@ function project_release_update_2() {
   }
   return $ret;
 }
+
+function project_release_update_3() {
+  $ret = array();
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      $ret[] = update_sql("ALTER TABLE {project_release_nodes} ADD downloads int unsigned default '0'");
+      break;
+    case 'pgsql':
+      db_add_column($ret, 'project_release_nodes', 'downloads', 'int', array('default' => 0));
+      break;
+  }
+  return $ret;
+}
diff -up release/project_release.module release_patched/project_release.module
--- release/project_release.module	2007-01-18 15:30:45.000000000 -0800
+++ release_patched/project_release.module	2007-01-30 10:18:21.000000000 -0800
@@ -56,6 +56,13 @@ function project_release_menu($may_cache
       'weight' => 1,
       'type' => MENU_NORMAL_ITEM,
     );
+  $items[] = array(
+        'path' => 'dlcounter/'.arg(1),
+        'callback' => 'project_count_download',
+        'callback arguments' => arg(1),
+        'type' => MENU_CALLBACK,
+        'access' => true,
+      ); 
     drupal_add_css(drupal_get_path('module', 'project_release') .'/project_release.css');
     project_release_get_api_taxonomy();
   }
@@ -723,7 +730,7 @@ function project_release_view($node, $te
     $output .= t('Nightly development snapshot from !tag', array('!tag' => check_plain($node->tag))) . '<br />';
   }
   if ($node->file_path) {
-    $output .= '<small>' . t('Download: !file', array('!file' => project_release_download_link($node->file_path))) . '</small><br />';
+    $output .= '<small>' . t('Download: !file', array('!file' => project_release_download_counter_link($node->nid, $node->file_path))) . '</small><br />';
     $output .= '<small>' . t('Size: !size', array('!size' => format_size(filesize(file_create_path($node->file_path))))) . '</small><br />';
     $output .= '<small>' . t('md5_file hash: !file_hash', array('!file_hash' => $node->file_hash)) . '</small><br />';
   }
@@ -733,6 +740,9 @@ function project_release_view($node, $te
   if ($node->file_date  && ($node->file_date != $node->created)) {
     $output .= '<small>' . t('Last updated: !changed', array('!changed' => format_date($node->file_date))) . '</small><br />';
   }
+  if ($node->downloads) {
+    $output .= '<small>' . t('Download count: '.$node->downloads).'</small><br />';
+  }
   $node->content['release_info'] = array(
     '#value' => '<div class="project-release">' . $output . '</div>',
     '#weight' => -1,
@@ -1331,7 +1341,7 @@ function project_release_table($project,
 
   while ($release = db_fetch_object($result)) {
     $links = array();
-    $links['project_release_download'] = project_release_download_link($release->file_path, t('Download'), TRUE);
+    $links['project_release_download_counter'] = project_release_download_counter_link($release->nid, $release->file_path, t('Download'), TRUE);
     $links['project_release_notes'] = array(
       'title' => t('Release notes'),
       'href' => "node/$release->nid",
@@ -1531,3 +1541,27 @@ function project_release_download_link($
     return l($link_text, $link_path);
   }
 }
+
+function project_release_download_counter_link($nid, $file_path, $link_text = NULL, $as_array = FALSE) {
+  if (empty($link_text)) {
+    $link_text = basename($file_path);
+  }
+  $link_path = 'dlcounter/' . $nid;
+  if ($as_array) {
+    return array(
+      'title' => $link_text,
+      'href' => $link_path,
+    );
+  }
+  else {
+    return l($link_text, $link_path);
+  }
+}
+
+function project_count_download($nid) {
+  $sql = "UPDATE {project_release_nodes} SET downloads=downloads+1 WHERE nid = %d";
+  db_query($sql, $nid);
+  $node = node_load($nid);
+  $url = project_release_download_link($node->file_path, '', true);
+  header("Location: ".$url['href']);
+}
