Opened 12 years ago
Last modified 12 years ago
#147 closed Aufgabe
Dateiliste für Downloads alphabetisch sortieren — at Version 1
| Reported by: | kaisa | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | modified-shop-2.0.0.0 |
| Component: | Admin | Version: | 1.06 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description (last modified by )
admin/ includes/functions/general.php
Dateiliste ist unsortiert. Das ist eine Katastrophe für den Benutzer, wenn man viele Dateien anbietet.
einfach ein asort() einbauen. Ich habe auch eine Erweiterung für die Dateigröße, damit die beim Download angezeigt werden kann für den Kunden.
Es wäre sinnvoll hier auch die Variable des Downloadordners aus der Config zu übernehmen. Wozu hat man die Konstanten?
admin/includes/functions/general.php
function xtc_getDownloads() {
$files = array ();
$dir = DIR_FS_CATALOG.'download/';
if ($fp = opendir($dir)) {
while ($file = readdir($fp)) {
if (is_file($dir.$file) && $file != '.htaccess') {
$size = filesize($dir.$file);
$files[] = array ('id' => $file, 'text' => $file.' | '.xtc_format_filesize($size), 'size' => $size, 'date' => date("F d Y H:i:s.", filemtime($dir.$file)));
} //if
} // while
closedir($fp);
}
asort($files, (int) $sort_flags=SORT_FLAG_CASE); // Case insensitive sorting
return $files;
}
Note:
See TracTickets
for help on using tickets.
