Closed (won't fix)
Project:
Download Count
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 May 2007 at 05:52 UTC
Updated:
30 May 2010 at 20:09 UTC
Hello
i need to show table made by views, and 'download count' column that would show how many times files from node were downloaded...
i started reading views docs how to do this, but my ideas ended up with thiss little function, that shows count for only first file in node:
function download_count_views_tables() {
$tables['files'] = array (
"name" => "files",
"join" => array(
"left" => array(
"table" => "node",
"field" => "nid"
),
"right" => array(
"field" => "nid"
),
),
);
$tables['file_downloads'] = array (
"name" => "file_downloads",
'fields' => array(
'count' => array(
'name' => t('Files: Download Count'),
'sortable' => true,
'help' => t('Times file were downloaded from that node'),
),
),
"join" => array(
"left" => array(
"table" => "files",
"field" => "filename"
),
"right" => array(
"field" => "filename"
),
),
);
return $tables;
}
Any hints how to make this count all files?
Comments
Comment #1
xjmPatch at http://drupal.org/node/235844 might be a start for this.
Comment #2
WorldFallz commentedclosing due to new maintainer and an unsupported version. A new 6.x-2.x version (that includes views2 integration) is forthcoming, please open new issues against that version when available if necessary.