diff --git a/themes/googleimage/views/layout/main.php b/themes/googleimage/views/layout/main.php index 1fffa5b..3702b2e 100644 --- a/themes/googleimage/views/layout/main.php +++ b/themes/googleimage/views/layout/main.php @@ -25,7 +25,7 @@ require_once __DIR__ . '/../../../../plugins/Html.php';
diff --git a/themes/googleimage/views/site/index.php b/themes/googleimage/views/site/index.php index e3fb748..efaece0 100644 --- a/themes/googleimage/views/site/index.php +++ b/themes/googleimage/views/site/index.php @@ -60,15 +60,22 @@ eof; } if (!empty($category['directories'])) { //两级目录支持 + $index = 0; foreach($category['directories'] as $dir) { echo << eof; if (!empty($dir['snapshot'])) { - echo << 0) { + echo << eof; + }else { + echo << +eof; + } }else if (!empty($dir['files'])) { $first_img = array_shift($dir['files']); if (!in_array($first_img['extension'], $imgExts)) { @@ -81,9 +88,15 @@ eof; } if (in_array($first_img['extension'], $imgExts)) { - echo << 0) { + echo << eof; + }else { + echo << +eof; + } }else { echo << @@ -96,20 +109,34 @@ eof; {$title} eof; + $index ++; } } if (!empty($category['files'])) { //一级目录支持 + $index = 0; foreach($category['files'] as $file) { if (!in_array($file['extension'], $imgExts)) {continue;} $title = !empty($file['title']) ? $file['title'] : $file['filename']; - echo << 0) { + echo << {$file['filename']} {$title} eof; + }else { + echo << + {$file['filename']} + {$title} + +eof; + } + + $index ++; } } ?>