/[drupal]/contributions/sandbox/dikini/filebrowser/filestore2.inc
ViewVC logotype

Contents of /contributions/sandbox/dikini/filebrowser/filestore2.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Fri Nov 19 12:06:07 2004 UTC (5 years ago) by dikini
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -0 lines
File MIME type: text/x-php

Added INSTALL
added ids
1 <?php
2 /*$Id*/
3
4 /*
5 * file browser for filestore
6 *
7 */
8 function filestore2_filebrowser($tid){
9 $result = pager_query('SELECT f.nid, n.title, n.teaser, f.version, f.downloads, fs.filename
10 FROM {filestore2} f, {fscache} fs, {node} n
11 INNER JOIN {term_node} tn ON n.nid = tn.nid ' . node_access_join_sql() .
12 ' WHERE f.fsid = fs.fsid AND f.nid = n.nid AND n.type = "filestore2" AND tn.tid = %d AND ' . node_access_where_sql() .
13 ' ORDER BY f.downloads DESC', variable_get('files_per_page', 15), 0, NULL, $tid);
14
15 $i=0;
16 while($fitem = db_fetch_object($result)) {
17 $i++;
18 $rows[] = array($i .".", l($fitem->title, "node/". $fitem->nid,array("class"=>'file_node_title')),
19 l("<img src='/modules/filebrowser/file.gif' />", "filestore2/download/". $fitem->nid,array("title"=>$fitem->filename))
20 , $fitem->teaser, $fitem->version);
21 }
22 return array('header' =>array("", array("data" => t("title")), array("data" => t("file")), array("data" => t("description")), array("data" => t("ver"))),
23 'rows' => $rows);
24
25 }
26 ?>

  ViewVC Help
Powered by ViewVC 1.1.2