change sort by date
This commit is contained in:
parent
361cb3849e
commit
d007101e08
18
index.php
18
index.php
|
@ -93,21 +93,23 @@
|
|||
</form>';
|
||||
echo '<br>';
|
||||
|
||||
if ($dh = opendir($dir))
|
||||
$files = glob($dir . '/*');
|
||||
usort($files, function($a, $b)
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
return filemtime($b) - filemtime($a);
|
||||
});
|
||||
|
||||
foreach($files as $path)
|
||||
{
|
||||
if (!str_ends_with($file, '.del') && $file != '.' && $file != '..')
|
||||
if (!str_ends_with($path, '.del'))
|
||||
{
|
||||
$mod = date("F d Y H:i:s", filemtime($dir . '/' . $file));
|
||||
echo '<div>' . $mod . ' <a href=index.php?open=' . urlencode($file) . '>' . $file .'</a></div>';
|
||||
$name = basename($path);
|
||||
$mod = date("F d Y H:i:s", filemtime($path));
|
||||
echo '<div>' . $mod . ' <a href=index.php?open=' . urlencode($name) . '>' . $name .'</a></div>';
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
echo '<br>';
|
||||
}
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue