Minor improvements (#903)

This commit is contained in:
Roman Kelesidis 2023-09-17 16:17:10 +07:00 committed by GitHub
commit 119cf935a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 9 deletions

View file

@ -155,13 +155,13 @@ if ($search_imagick) {
} elseif (false !== stripos(PHP_OS, "WIN")) { } elseif (false !== stripos(PHP_OS, "WIN")) {
$path = 'c:/imagemagick/convert.exe'; $path = 'c:/imagemagick/convert.exe';
if (!@file_exists(amod_realpath($path))) { if (file_exists(amod_realpath($path))) {
$imagick = $path; $imagick = $path;
} }
} }
} }
if (!@file_exists(amod_realpath(trim($imagick)))) { if (file_exists(amod_realpath(trim($imagick)))) {
$new_attach['img_imagick'] = trim($imagick); $new_attach['img_imagick'] = trim($imagick);
} else { } else {
$new_attach['img_imagick'] = ''; $new_attach['img_imagick'] = '';

View file

@ -52,9 +52,9 @@ VALUES ('upload_dir', 'data/torrent_files'),
('img_display_inlined', '1'), ('img_display_inlined', '1'),
('img_max_width', '200'), ('img_max_width', '200'),
('img_max_height', '200'), ('img_max_height', '200'),
('img_link_width', '0'), ('img_link_width', '600'),
('img_link_height', '0'), ('img_link_height', '400'),
('img_create_thumbnail', '0'), ('img_create_thumbnail', '1'),
('img_min_thumb_filesize', '12000'), ('img_min_thumb_filesize', '12000'),
('img_imagick', '/usr/bin/convert'), ('img_imagick', '/usr/bin/convert'),
('use_gd2', '1'), ('use_gd2', '1'),

View file

@ -278,7 +278,8 @@ function display_attachments($post_id)
'IMG_SRC' => BB_ROOT . DL_URL . $attachments['_' . $post_id][$i]['attach_id'], 'IMG_SRC' => BB_ROOT . DL_URL . $attachments['_' . $post_id][$i]['attach_id'],
'IMG_THUMB_SRC' => $thumb_source, 'IMG_THUMB_SRC' => $thumb_source,
'FILESIZE' => $filesize, 'FILESIZE' => $filesize,
'COMMENT' => $comment 'COMMENT' => $comment,
'DOWNLOAD_COUNT' => declension((int)$attachments['_' . $post_id][$i]['download_count'], 'times'),
]); ]);
} }

View file

@ -2016,9 +2016,9 @@ function bb_captcha($mode, $callback = '')
$secret = $bb_cfg['captcha']['secret_key']; $secret = $bb_cfg['captcha']['secret_key'];
$public = $bb_cfg['captcha']['public_key']; $public = $bb_cfg['captcha']['public_key'];
$cp_theme = $bb_cfg['captcha']['theme']; $cp_theme = $bb_cfg['captcha']['theme'] ?? 'light';
if (!$public && !$secret) { if (!$bb_cfg['captcha']['disabled'] && (!$public || !$secret)) {
bb_die($lang['CAPTCHA_SETTINGS']); bb_die($lang['CAPTCHA_SETTINGS']);
} }

View file

@ -35,7 +35,7 @@
</p> </p>
<p class="attach_link"> <p class="attach_link">
<a href="{postrow.attach.cat_thumb_images.IMG_SRC}" target="_blank"><b>{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}</b></a> <a href="{postrow.attach.cat_thumb_images.IMG_SRC}" target="_blank"><b>{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}</b></a>
<span class="attach_stats med">({postrow.attach.cat_thumb_images.FILESIZE})</span> <span class="attach_stats med">({postrow.attach.cat_thumb_images.FILESIZE}, {L_DOWNLOADED}: {postrow.attach.cat_thumb_images.DOWNLOAD_COUNT})</span>
</p> </p>
<!-- IF postrow.attach.cat_thumb_images.COMMENT --> <!-- IF postrow.attach.cat_thumb_images.COMMENT -->
<p class="attach_comment med"> <p class="attach_comment med">