diff --git a/.own_navi.example b/.own_navi.example index d96f3e4..caa5207 100644 --- a/.own_navi.example +++ b/.own_navi.example @@ -5,7 +5,7 @@ # 名称 -TITLE="子目录显示名称" +TITLE=NO # 标记 hot vip new recommend MARK=new diff --git a/nav.php b/nav.php index f721118..de07029 100644 --- a/nav.php +++ b/nav.php @@ -1,6 +1,6 @@ $dir) { + if (count($dirs[$group]) <= 0) { + unset($dirs[$group]); + } +} + /** * 获取文件 * @param string $filename @@ -142,6 +149,9 @@ function getConf(array $dirs) : array { unset($dirs[c('NAV_DEFAULT_GROUP', '默认分组')][$dir]); } foreach ($confs as $key => $value) { + if ($key === 'TITLE' && $value === '') { + $value = $dir; + } $dirs[$cur_group][$dir][strtolower($key)] = $value; } } @@ -183,7 +193,7 @@ function c(string $key, $default = false) { if (isset($GLOBALS['config'][$key])) { return $GLOBALS['config'][$key]; }else{ - return defined($key) ? constant($key) : false; + return defined($key) ? constant($key) : $default; } }