Modify

Opened 12 years ago

Closed 12 years ago

#147 closed Aufgabe (fixed)

Dateiliste für Downloads alphabetisch sortieren

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 Torsten Riemer)

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;
  }

Attachments (0)

Change History (2)

comment:1 by Torsten Riemer, 12 years ago

Description: modified (diff)

comment:2 by H. H. H., 12 years ago

Resolution: fixed
Status: newclosed

gefixt in r6074 mit array_multisort

Die Download Konstante ist nur im Frontend verfügbar!

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.