updates for the danbooru theme

This commit is contained in:
Shish 2010-01-03 08:55:43 +00:00
parent 3bb3ee2e86
commit ce6e8aa9ae
4 changed files with 21 additions and 3 deletions

View file

@ -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;

View file

@ -40,7 +40,8 @@ class CustomCommentListTheme extends CommentListTheme {
}
$p = autodate($image->posted);
$comment_html = "<b>Date</b> $p $s <b>User</b> $un<br><b>Tags</b> $t<p>&nbsp;";
$r = class_exists("Ratings") ? "<b>Rating</b> ".Ratings::rating_to_human($image->rating) : "";
$comment_html = "<b>Date</b> $p $s <b>User</b> $un $s $r<br><b>Tags</b> $t<p>&nbsp;";
$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</a>)" : "";
$h_imagelink = $trim ? "<a href='".make_link("post/view/$i_image_id")."'>&gt;&gt;&gt;</a>\n" : "";
if($trim) {
return "<p class='comment'>$h_userlink $h_dellink<br/><b>Posted $h_posted</b><br/>$h_comment</p>";
return "<p class='comment'>$h_userlink $h_dellink<br/>$h_posted<br/>$h_comment</p>";
}
else {
return "
<table class='comment'><tr>
<td style='width: 150px;'>$h_userlink<br/><b>Posted $h_posted</b>$h_dellink</td>
<td class='meta'>$h_userlink<br/>$h_posted$h_dellink</td>
<td>$h_comment</td>
</tr></table>
";

View file

@ -142,6 +142,7 @@ class Layout {
$custom_sublinks .= "<li><a href='".make_link("wiki/wiki")."'>Help</a></li>";
break;
case "tags":
case "alias":
$custom_sublinks .= "<li><a href='".make_link('tags/map')."'>Map</a></li>";
$custom_sublinks .= "<li><a href='".make_link('tags/alphabetic')."'>Alphabetic</a></li>";
$custom_sublinks .= "<li><a href='".make_link('tags/popularity')."'>Popularity</a></li>";

View file

@ -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;
}