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

xjm’s picture

Patch at http://drupal.org/node/235844 might be a start for this.

WorldFallz’s picture

Status: Active » Closed (won't fix)

closing 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.