try to show disk name as folder in home page

pull/128/head
qkqpttgf 2020-08-23 13:00:16 +08:00 committed by GitHub
parent 7a86da6764
commit 4ef20bdf50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -263,6 +263,7 @@ function main($path)
foreach ($disktags as $disktag) { foreach ($disktags as $disktag) {
$files['children'][$disktag]['folder'] = 1; $files['children'][$disktag]['folder'] = 1;
$files['children'][$disktag]['name'] = $disktag; $files['children'][$disktag]['name'] = $disktag;
$files['children'][$disktag]['showname'] = getConfig('diskname', $disktag);
} }
if ($_GET['json']) { if ($_GET['json']) {
// return a json // return a json
@ -2332,7 +2333,7 @@ function render_list($path = '', $files = '')
if ($_SERVER['admin'] or !isHideFile($file['name'])) { if ($_SERVER['admin'] or !isHideFile($file['name'])) {
$filenum++; $filenum++;
$FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . encode_str_replace($file['name'])), $FolderList); $FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . encode_str_replace($file['name'])), $FolderList);
$FolderListStr = str_replace('<!--FileEncodeReplaceName-->', str_replace('&','&amp;', $file['name']), $FolderListStr); $FolderListStr = str_replace('<!--FileEncodeReplaceName-->', str_replace('&','&amp;', $file['showname']?$file['showname']:$file['name']), $FolderListStr);
$FolderListStr = str_replace('<!--lastModifiedDateTime-->', time_format($file['lastModifiedDateTime']), $FolderListStr); $FolderListStr = str_replace('<!--lastModifiedDateTime-->', time_format($file['lastModifiedDateTime']), $FolderListStr);
$FolderListStr = str_replace('<!--size-->', size_format($file['size']), $FolderListStr); $FolderListStr = str_replace('<!--size-->', size_format($file['size']), $FolderListStr);
while (strpos($FolderListStr, '<!--filenum-->')) $FolderListStr = str_replace('<!--filenum-->', $filenum, $FolderListStr); while (strpos($FolderListStr, '<!--filenum-->')) $FolderListStr = str_replace('<!--filenum-->', $filenum, $FolderListStr);