From ce6e8aa9aec6d417530169f7d2d60be3093179ec Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 3 Jan 2010 08:55:43 +0000 Subject: [PATCH] updates for the danbooru theme --- contrib/rating/main.php | 9 +++++++++ themes/danbooru/comment.theme.php | 7 ++++--- themes/danbooru/layout.class.php | 1 + themes/danbooru/style.css | 7 +++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/contrib/rating/main.php b/contrib/rating/main.php index 755590b3..92c26af2 100644 --- a/contrib/rating/main.php +++ b/contrib/rating/main.php @@ -144,6 +144,15 @@ class Ratings implements Extension { return $set; } + public static function rating_to_human($rating) { + switch($rating) { + case "s": return "Safe"; + case "q": return "Questionable"; + case "e": return "Explicit"; + default: return "Unknown"; + } + } + // FIXME: this is a bit ugly and guessey, should have proper options private function can_rate() { global $config, $user; diff --git a/themes/danbooru/comment.theme.php b/themes/danbooru/comment.theme.php index c961f7db..ff728eac 100644 --- a/themes/danbooru/comment.theme.php +++ b/themes/danbooru/comment.theme.php @@ -40,7 +40,8 @@ class CustomCommentListTheme extends CommentListTheme { } $p = autodate($image->posted); - $comment_html = "Date $p $s User $un
Tags $t

 "; + $r = class_exists("Ratings") ? "Rating ".Ratings::rating_to_human($image->rating) : ""; + $comment_html = "Date $p $s User $un $s $r
Tags $t

 "; $comment_limit = $config->get_int("comment_list_count", 10); $comment_count = count($comments); if($comment_limit > 0 && $comment_count > $comment_limit) { @@ -103,12 +104,12 @@ class CustomCommentListTheme extends CommentListTheme { "href='".make_link("comment/delete/$i_comment_id/$i_image_id")."'>Del)" : ""; $h_imagelink = $trim ? ">>>\n" : ""; if($trim) { - return "

$h_userlink $h_dellink
Posted $h_posted
$h_comment

"; + return "

$h_userlink $h_dellink
$h_posted
$h_comment

"; } else { return " - +
$h_userlink
Posted $h_posted$h_dellink
$h_userlink
$h_posted$h_dellink
$h_comment
"; diff --git a/themes/danbooru/layout.class.php b/themes/danbooru/layout.class.php index ca26e920..75fc5edf 100644 --- a/themes/danbooru/layout.class.php +++ b/themes/danbooru/layout.class.php @@ -142,6 +142,7 @@ class Layout { $custom_sublinks .= "
  • Help
  • "; break; case "tags": + case "alias": $custom_sublinks .= "
  • Map
  • "; $custom_sublinks .= "
  • Alphabetic
  • "; $custom_sublinks .= "
  • Popularity
  • "; diff --git a/themes/danbooru/style.css b/themes/danbooru/style.css index 29031b05..0cbb2a79 100644 --- a/themes/danbooru/style.css +++ b/themes/danbooru/style.css @@ -150,6 +150,13 @@ content:"More .comment { margin-bottom:8px; } +.comment .meta { +width: 150px; +color: gray; +} +.comment TD { +text-align: left; +} .withleft { margin-left:160px; }