config.func.php
上传用户:feiyaoda
上传日期:2016-11-21
资源大小:9556k
文件大小:1k
- <?php
- function theme_list()
- {
- $path = './themes/';
- return get_list_folder($path);
- }
- function language_list()
- {
- $path = './lang/';
- return get_list_folder($path);
- }
- function get_list_folder($path)
- {
- $dp = opendir($path);
-
- if (!$dp)
- {
- trigger_error('Impossible to read language folder');
- return false;
- }
-
- while ($file = readdir($dp))
- {
- if ('.' == $file) continue;
- if ('..' == $file) continue;
-
- if (is_dir($path.$file)) $folders[] = $file;
- }
- closedir($dp);
-
- $str = implode('|',$folders);
-
- // removing last char
- unset($str[strlen($str)-1]);
-
- return $str;
- }