From e910df8e6b48b53851b1ce08bacd0e4ada29a313 Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 27 Aug 2007 23:02:03 +0000 Subject: [PATCH] patch from Shuugo; Danbooru theme uses CSS rather than a table git-svn-id: file:///home/shish/svn/shimmie2/trunk@482 7f39781d-f577-437e-ae19-be835c7a54ca --- themes/danbooru/index.theme.php | 20 ++++++++++++++++++++ themes/danbooru/style.css | 25 ++++++++++++++++++++++--- themes/danbooru/themelet.class.php | 2 +- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/themes/danbooru/index.theme.php b/themes/danbooru/index.theme.php index 05ca6e7e..1e97674b 100644 --- a/themes/danbooru/index.theme.php +++ b/themes/danbooru/index.theme.php @@ -47,5 +47,25 @@ class CustomIndexTheme extends IndexTheme { return $h_search; } + + protected function build_table($images, $query) { + global $config; + + $width = $config->get_int('index_width'); + $height = $config->get_int('index_height'); + + $table = "
\n"; + for($i=0; $i<$height; $i++) { + for($j=0; $j<$width; $j++) { + $image = isset($images[$i*$width+$j]) ? $images[$i*$width+$j] : null; + if(!is_null($image)) { + $table .= "\t" . build_thumb_html($image, $query) . "\n"; + } + } + } + $table .= "
"; + + return $table; + } } ?> diff --git a/themes/danbooru/style.css b/themes/danbooru/style.css index b44497fb..2813f706 100644 --- a/themes/danbooru/style.css +++ b/themes/danbooru/style.css @@ -122,26 +122,45 @@ A:hover {text-decoration: underline;} .withleft { margin-left: 160px; } + +/*Shuugo: more danboorish*/ +div#paginator { + display: block; + padding: 2em 0 1em 0; + font-size: 1em; + text-align: center; + font-weight: bold; + clear: both; +} .paginator { margin: 16px; text-align: center; } -.paginator B { +div#paginator B { padding: 4px 8px 4px 8px; margin: 3px; } -.paginator A { +div#paginator A { padding: 4px 8px 4px 8px; margin: 3px; border: 1px solid #EEE; } -.paginator A:hover { +div#paginator A:hover { border: 1px solid #EEE; background: blue; color: white; } +span.thumb { + height: 220px; + width: 220px; + display: inline-block; + float: left; + text-align: center; + vertical-align: center; +} + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index 3dc3b483..1f9860ab 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -55,7 +55,7 @@ class Themelet { if(strlen($last_html) > 0) $ndots = "..."; else $ndots = ""; - return "

$prev_html $first_html $pdots $pages_html $ndots $last_html $next_html

"; + return "
$prev_html $first_html $pdots $pages_html $ndots $last_html $next_html
"; } } ?>