Skip to content

Commit

Permalink
image properties references changed - fixes #30
Browse files Browse the repository at this point in the history
  • Loading branch information
Giraffaman committed Feb 24, 2024
1 parent e8aec2f commit 5c850b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion themes/pr0booru/comment.theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function display_comment_list(array $images, int $page_number, int $total
}
$p = autodate($image->posted);

$r = Extension::is_enabled(RatingsInfo::KEY) ? "<b>Rating</b> ".Ratings::rating_to_human($image->rating) : "";
$r = Extension::is_enabled(RatingsInfo::KEY) ? "<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_count = count($comments);
Expand Down
11 changes: 7 additions & 4 deletions themes/pr0booru/view.theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ private function build_stats(Image $image): string
}

if (Extension::is_enabled(RatingsInfo::KEY)) {
if ($image->rating === null || $image->rating == "?") {
$image->rating = "?";
if ($image['rating'] === null || $image['rating'] == "?") {
$image['rating'] = "?";
}
// @phpstan-ignore-next-line - ???
if (Extension::is_enabled(RatingsInfo::KEY)) {
$h_rating = Ratings::rating_to_human($image['rating']);
$html .= "<br>Rating: $h_rating";
}
$h_rating = Ratings::rating_to_human($image->rating);
$html .= "<br>Rating: $h_rating";
}

$imgUrl = "";
Expand Down

0 comments on commit 5c850b7

Please sign in to comment.