Update displaying.php

This commit is contained in:
Roman Kelesidis 2024-07-06 16:05:50 +07:00
parent 987386e59b
commit 8d7f7ca598

View File

@ -238,12 +238,15 @@ function display_attachments($post_id)
$thumbnail = FALSE; $thumbnail = FALSE;
$link = FALSE; $link = FALSE;
// Shows the images in topic
if (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT && intval($attach_config['img_display_inlined'])) if (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT && intval($attach_config['img_display_inlined']))
{ {
if (intval($attach_config['img_link_width']) != 0 || intval($attach_config['img_link_height']) != 0) if (intval($attach_config['img_link_width']) != 0 || intval($attach_config['img_link_height']) != 0)
{ {
// Get image sizes
list($width, $height) = image_getdimension($filename); list($width, $height) = image_getdimension($filename);
// Check if image sizes is allowed
if ($width == 0 && $height == 0) if ($width == 0 && $height == 0)
{ {
$image = TRUE; $image = TRUE;
@ -262,12 +265,14 @@ function display_attachments($post_id)
} }
} }
// Checks if image is thumbnail
if (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT && $attachments['_' . $post_id][$i]['thumbnail'] == 1) if (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT && $attachments['_' . $post_id][$i]['thumbnail'] == 1)
{ {
$thumbnail = TRUE; $thumbnail = TRUE;
$image = FALSE; $image = FALSE;
} }
// Checks whether the image should be displayed as a link
if (!$image && !$thumbnail) if (!$image && !$thumbnail)
{ {
$link = TRUE; $link = TRUE;