change sort by date
This commit is contained in:
parent
361cb3849e
commit
d007101e08
20
index.php
20
index.php
|
@ -93,21 +93,23 @@
|
||||||
</form>';
|
</form>';
|
||||||
echo '<br>';
|
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($path, '.del'))
|
||||||
{
|
{
|
||||||
if (!str_ends_with($file, '.del') && $file != '.' && $file != '..')
|
$name = basename($path);
|
||||||
{
|
$mod = date("F d Y H:i:s", filemtime($path));
|
||||||
$mod = date("F d Y H:i:s", filemtime($dir . '/' . $file));
|
echo '<div>' . $mod . ' <a href=index.php?open=' . urlencode($name) . '>' . $name .'</a></div>';
|
||||||
echo '<div>' . $mod . ' <a href=index.php?open=' . urlencode($file) . '>' . $file .'</a></div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
closedir($dh);
|
|
||||||
}
|
}
|
||||||
echo '<br>';
|
echo '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue