Browse Source

Update func.common.php

давайте сделаем по-человечески, чтоб при загрузке фотографий они сортировались по имени, а не в случайном порядке (или в порядке последнего изменения).
pull/3/head
Lev Andronov 10 months ago committed by GitHub
parent
commit
8ad46b5d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      functions/func.common.php

32
functions/func.common.php

@ -613,23 +613,19 @@
$files = array();
$thumbs = array();
if ($handle = opendir($dir))
{
while (false !== ($file = readdir($handle)))
{
$nameParts = explode('.', $file);
$ext = strtolower(end($nameParts));
if ($file != "." && $file != ".." && in_array($ext, $images_ext))
{
if (! is_dir($dir . "/" . $file))
{
$files[] = $file;
$thumbs[] = make_thumbnail(array('link' => $dir_abs . $file, 'size' => 't128x128'));
}
}
}
closedir($handle);
$img_files = scandir($dir);
foreach ($img_files as $file) {
$nameParts = explode('.', $file);
$ext = strtolower(end($nameParts));
if ($file != "." && $file != ".." && in_array($ext, $images_ext))
{
if (! is_dir($dir . "/" . $file))
{
$files[] = $file;
$thumbs[] = make_thumbnail(array('link' => $dir_abs . $file, 'size' => 'f128x128'));
}
}
}
//$return = array(
@ -1418,4 +1414,4 @@
return $fixed;
}
}
?>
?>

Loading…
Cancel
Save