summaryrefslogtreecommitdiff
path: root/images.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2023-08-08 03:09:47 -0400
committerlolcat <will@lolcat.ca>2023-08-08 03:09:47 -0400
commit4559857380317d768ff8394db711eb5c894aa1f8 (patch)
tree2ed555b5ba104297642893ef5511d1d28f282842 /images.php
parent7c771c82c8e03b337f9f03ae2d4afc25d3f0faca (diff)
added brave image+video support
Diffstat (limited to 'images.php')
-rw-r--r--images.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/images.php b/images.php
index 2c0799e..ff420c9 100644
--- a/images.php
+++ b/images.php
@@ -62,8 +62,13 @@ foreach($results["image"] as $image){
'<div class="image-wrapper" title="' . htmlspecialchars($image["title"]) .'" data-json="' . htmlspecialchars(json_encode($image["source"])) . '">' .
'<div class="image">' .
'<a href="' . htmlspecialchars($image["source"][0]["url"]) . '" rel="noreferrer nofollow" class="thumb">' .
- '<img src="' . $frontend->htmlimage($image["source"][count($image["source"]) - 1]["url"], "thumb") . '" alt="thumbnail">' .
- '<div class="duration">' . $image["source"][0]["width"] . 'x' . $image["source"][0]["height"] . '</div>' .
+ '<img src="' . $frontend->htmlimage($image["source"][count($image["source"]) - 1]["url"], "thumb") . '" alt="thumbnail">';
+
+ if($image["source"][0]["width"] !== null){
+ $payload["images"] .= '<div class="duration">' . $image["source"][0]["width"] . 'x' . $image["source"][0]["height"] . '</div>';
+ }
+
+ $payload["images"] .=
'</a>' .
'<a href="' . htmlspecialchars($image["url"]) . '" rel="noreferrer nofollow">' .
'<div class="title">' . htmlspecialchars(parse_url($image["url"], PHP_URL_HOST)) . '</div>' .