Hello everyone. On one of my Drupal sites, I am usinng the upload module in conjunction with the book module to essentially serve as a download directory. Some of my nodes have large numbers of attachments (fifty or so). The setup is working fairly well so far, but lately, as I continue to upload stuff, my lists are becoming disorganized.
The upload module currently sorts the attachments (on the "view node" page) by upload date, I believe. I think this is the relevant code from upload.module
case 'view':
if ($node->files && user_access('view uploaded files')) {
$header = array(t('Attachment'), t('Size'));
$rows = array();
$previews = array();
// Build list of attached files
foreach ($node->files as $file) {
if ($file->list) {
$rows[] = array(
'<a href="'. check_url(($file->fid ? file_create_url($file->filepath) : url(file_create_filename($file->filename, file_create_path())))) .'">'. check_plain($file->filename) .'</a>',
format_size($file->filesize)
);
// We save the list of files still in preview for later
if (!$file->fid) {
$previews[] = $file;
}
}
}
Does anyone know how I might get the module to sort the uploads by NAME (alphabetically) rather than by upload date? I think there are PHP functions to sort arrays, but I am way out of my league there.