The snippet below can be a nice addition to the upload module. It gives
a table with all nodes uploaded on the system via the core API. It would
nice to have the possibility of managing (remove/edit) images from this
page via the upload module API. What do you think ?
global $base_url;
$result = db_query('SELECT DISTINCT n.uid, f .* FROM {files} f INNER JOIN {node} n ON f.nid = n.nid INNER JOIN {file_revisions} r ON f.fid = r.fid');
$header = array('Node', 'User', 'File', 'Type', 'Size');
$files = array();
while ($file = db_fetch_object($result)) {
$node = l('n','node/' . $file->nid);
$user = l('u','user/' . $file->uid);
$path = l($file->filename, $file->filepath);
$files[] = array($node,$user,$path,$file->filemime,$file->filesize);
}
print theme('table',$header,$files);
Comments
Comment #1
bradlis7 commentedI don't like "n" and "u", maybe instead you could use the username, and the node title?
This may not be the most optimized, but I've come up with something...
Comment #2
abir16 commentedIt's very nice code. I think I will use it in file upload service. Thanks.