diff --git a/core/imageboard/image.php b/core/imageboard/image.php index 9840e891..7cfff9d5 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -546,6 +546,19 @@ class Image return $plte->text; } + /** + * Get the info for this image, formatted according to the + * configured template. + */ + public function get_info(): string + { + global $config; + $plte = new ParseLinkTemplateEvent($config->get_string(ImageConfig::INFO), $this); + send_event($plte); + return $plte->text; + } + + /** * Figure out where the full size image is on disk. */ diff --git a/ext/image/main.php b/ext/image/main.php index c4b3c808..b3ffa092 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -252,6 +252,7 @@ class ImageIO extends Extension //$sb->add_text_option(ImageConfig::ILINK, "Image link: "); //$sb->add_text_option(ImageConfig::TLINK, "
Thumbnail link: "); $sb->add_text_option(ImageConfig::TIP, "Image tooltip", true); + $sb->add_text_option(ImageConfig::INFO, "Image info", true); $sb->add_choice_option(ImageConfig::UPLOAD_COLLISION_HANDLER, self::COLLISION_OPTIONS, "Upload collision handler", true); if (function_exists(self::EXIF_READ_FUNCTION)) { $sb->add_bool_option(ImageConfig::SHOW_META, "Show metadata", true); diff --git a/ext/view/main.php b/ext/view/main.php index 6c314557..3431574d 100644 --- a/ext/view/main.php +++ b/ext/view/main.php @@ -109,7 +109,7 @@ class ViewImage extends Extension if ($image_info) { $html = (string)TR( TH("Info"), - TD($event->image->parse_link_template($image_info)) + TD($event->image->get_info()) ); $event->add_part($html, 85); }