From 4ef20bdf503ce30d40fb64e5e9f6d5f0e41bfbc5 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 23 Aug 2020 13:00:16 +0800 Subject: [PATCH] try to show disk name as folder in home page --- common.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common.php b/common.php index 9a0b966..0753402 100644 --- a/common.php +++ b/common.php @@ -263,6 +263,7 @@ function main($path) foreach ($disktags as $disktag) { $files['children'][$disktag]['folder'] = 1; $files['children'][$disktag]['name'] = $disktag; + $files['children'][$disktag]['showname'] = getConfig('diskname', $disktag); } if ($_GET['json']) { // return a json @@ -2332,7 +2333,7 @@ function render_list($path = '', $files = '') if ($_SERVER['admin'] or !isHideFile($file['name'])) { $filenum++; $FolderListStr = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . encode_str_replace($file['name'])), $FolderList); - $FolderListStr = str_replace('', str_replace('&','&', $file['name']), $FolderListStr); + $FolderListStr = str_replace('', str_replace('&','&', $file['showname']?$file['showname']:$file['name']), $FolderListStr); $FolderListStr = str_replace('', time_format($file['lastModifiedDateTime']), $FolderListStr); $FolderListStr = str_replace('', size_format($file['size']), $FolderListStr); while (strpos($FolderListStr, '')) $FolderListStr = str_replace('', $filenum, $FolderListStr);