diff --git a/inc/content.php b/inc/content.php index ec597e6..874e2b5 100644 --- a/inc/content.php +++ b/inc/content.php @@ -119,21 +119,23 @@ if (!empty($breadcrumb)) { echo ''; echo '
'; if (!empty($listCurrentDir) && $ci['ac'] !== 'view') { - foreach ($listCurrentDir as $value) { - $thumbnail = getThumbnail($path, $value); + $listCurrentDir = sortDir($listCurrentDir,$fullListDir); + foreach ($listCurrentDir as $key => $value) { + $thumbnail = getThumbnail($path, $key); if (empty($thumbnail)) { - echo '', $fullListDir[$value], ' '; + echo '', $value, ' '; } else { - echo 'Thumbnail of video', $fullListDir[$value], ' '; + echo 'Thumbnail of video', $value, ' '; } } } if (!empty($listCurrentFile) && $ci['ac'] !== 'view') { - foreach ($listCurrentFile as $value) { - if ($value == 'thumb.jpg') { + $listCurrentFile = sortFile($listCurrentFile, $fullListFile); + foreach ($listCurrentFile as $key => $value) { + if ($key == 'thumb') { continue; } - echo '', $path.$value, '', $fullListFile[str_replace('.jpg', '', $value)]['title'], ''; + echo '', $path.$key, '', $value, ''; } } echo '
'; diff --git a/index.php b/index.php index 6dac2d1..0f67774 100644 --- a/index.php +++ b/index.php @@ -34,8 +34,8 @@ $GLOBALS['config']['PAGECACHE'] = 'pagecache'; // php $GLOBALS['config']['DOWNLOAD_METHOD'] = 'xsendfile'; -if(file_exists('option.php')){ - require_once 'option.php'; +if (file_exists('option.php')) { + require_once 'option.php'; } if (get_magic_quotes_gpc()) { @@ -186,9 +186,9 @@ function n_print($data, $name = '') {
'; echo ' - ', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], ' + ', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], ' '; - echo '
', htmlentities(print_r($data, 1)), '
'; + echo '
',    htmlentities(print_r($data, 1)), '
'; echo '

'; @@ -276,6 +276,22 @@ function listCurrentDir($breadcrumb) { return glob("*", GLOB_ONLYDIR); } +function sortDir($listCurrentDir, $fullListDir) { + foreach ($listCurrentDir as $value) { + $rows[$value] = $fullListDir[$value]; + } + asort($rows); + return $rows; +} + +function sortFile($listCurrentFile, $fullListFile) { + foreach ($listCurrentFile as $value) { + $rows[str_replace('.jpg', '', $value)] = $fullListFile[str_replace('.jpg', '', $value)]['title']; + } + asort($rows); + return $rows; +} + function getQueue() { $allHash = glob("tmp/*.hash"); if ($allHash) {