$file, 'url' => 'file/' . rawurlencode($file), 'shareUrl' => 'share/' . rawurlencode($file), 'date' => filemtime($path), 'type' => strtolower(pathinfo($file, PATHINFO_EXTENSION)) ]; } } // Tri usort($files, function($a, $b) use ($sortBy, $sortDesc) { $result = $sortBy === 'date' ? $b['date'] - $a['date'] : strcasecmp($a['name'], $b['name']); return $sortDesc ? $result : -$result; }); // Pagination $offset = $page * FILES_PER_PAGE; return array_slice($files, $offset, FILES_PER_PAGE); } if (!$authenticated) { // Afficher le formulaire de connexion include 'header.php'; ?>
Galerie de fichiers
Chargement...