$files = scandir(PATH_COMIC);
foreach ($files as $one) {
if (is_dir(PATH_COMIC.'/'.$one) && $one!='.' && $one!='..') {
- $dirs[config__get_dir_index($one)][] = $one;
+ $dirs[get_dir_index($one)][] = $one;
}
}
$my_html->apply_template('browse.html',html::REMOVE_UNDEF_TAGS,html::OUTPUT_HTML);
+
+
+// ディレクトリ名から索引を求める
+function get_dir_index($name) {
+ global $config__dir_index;
+
+ $ret = '';
+
+ $f = mb_substr($name,0,1);
+ foreach ($config__dir_index as $var => $val) {
+ if (mb_strpos($val,$f) !== false) {
+ $ret = $var;
+ break;
+ }
+ if ($val == '') {
+ $ret = $var;
+ }
+ }
+
+ return $ret;
+}
+
+
?>
\ No newline at end of file