[themes] add search link to rating

This commit is contained in:
discomrade 2024-06-12 23:20:50 +00:00 committed by Shish
parent f7047350b9
commit 1ad6acf37c
3 changed files with 15 additions and 15 deletions

View file

@ -53,11 +53,12 @@ class CustomViewPostTheme extends ViewPostTheme
}
if (Extension::is_enabled(RatingsInfo::KEY)) {
if ($image['rating'] === null || $image['rating'] == "?") {
$image['rating'] = "?";
$rating = $image['rating'];
if ($rating === null) {
$rating = "?";
}
$h_rating = Ratings::rating_to_human($image['rating']);
$html .= "<br>Rating: $h_rating";
$h_rating = Ratings::rating_to_human($rating);
$html .= "<br>Rating: <a href='".search_link(["rating=$rating"])."'>$h_rating</a>";
}
return $html;

View file

@ -54,14 +54,12 @@ class CustomViewPostTheme extends ViewPostTheme
}
if (Extension::is_enabled(RatingsInfo::KEY)) {
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";
$rating = $image['rating'];
if ($rating === null) {
$rating = "?";
}
$h_rating = Ratings::rating_to_human($rating);
$html .= "<br>Rating: <a href='".search_link(["rating=$rating"])."'>$h_rating</a>";
}
return $html;

View file

@ -58,11 +58,12 @@ class CustomViewPostTheme extends ViewPostTheme
}
if (Extension::is_enabled(RatingsInfo::KEY)) {
if ($image['rating'] === null || $image['rating'] == "?") {
$image['rating'] = "?";
$rating = $image['rating'];
if ($rating === null) {
$rating = "?";
}
$h_rating = Ratings::rating_to_human($image['rating']);
$html .= "<br>Rating: $h_rating";
$h_rating = Ratings::rating_to_human($rating);
$html .= "<br>Rating: <a href='".search_link(["rating=$rating"])."'>$h_rating</a>";
}
return $html;