From 9906a77e07351cd0093ba8cd9e3a029477e5e746 Mon Sep 17 00:00:00 2001 From: Astrid van Eerd Date: Wed, 20 Nov 2024 12:16:20 +0100 Subject: [PATCH] [K6.3] Make whatsapp icon clickable and hide private attachments in edit history (#9768) * Make whatsapp icon clickable * Hide private attachments in edit history --- src/libraries/kunena/src/User/KunenaUser.php | 2 +- .../layouts/topic/edit/history/default.php | 63 +++++++++++-------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/libraries/kunena/src/User/KunenaUser.php b/src/libraries/kunena/src/User/KunenaUser.php index e631e00861b..61d79707f54 100644 --- a/src/libraries/kunena/src/User/KunenaUser.php +++ b/src/libraries/kunena/src/User/KunenaUser.php @@ -2233,7 +2233,7 @@ public function socialButtons() 'telegram' => ['url' => 'https://t.me/##VALUE##', 'title' => Text::_('COM_KUNENA_MYPROFILE_TELEGRAM'), 'nourl' => '0'], 'apple' => ['url' => '##VALUE##', 'title' => Text::_('COM_KUNENA_MYPROFILE_APPLE'), 'nourl' => '1'], 'vimeo' => ['url' => 'https://vimeo.com/user##VALUE##', 'title' => Text::_('COM_KUNENA_MYPROFILE_VIMEO'), 'nourl' => '1'], - 'whatsapp' => ['url' => '##VALUE##', 'title' => Text::_('COM_KUNENA_MYPROFILE_WHATSAPP'), 'nourl' => '1'], + 'whatsapp' => ['url' => 'https://wa.me/##VALUE##', 'title' => Text::_('COM_KUNENA_MYPROFILE_WHATSAPP'), 'nourl' => '0'], 'youtube' => ['url' => 'https://www.youtube-nocookie.com/##VALUE##', 'title' => Text::_('COM_KUNENA_MYPROFILE_YOUTUBE'), 'nourl' => '0'], 'ok' => ['url' => 'https://ok.ru/##VALUE##', 'title' => Text::_('COM_KUNENA_MYPROFILE_OK'), 'nourl' => '0'], 'pinterest' => ['url' => 'https://pinterest.com/##VALUE##', 'title' => Text::_('COM_KUNENA_MYPROFILE_PINTEREST'), 'nourl' => '0'], diff --git a/src/site/template/aurelia/layouts/topic/edit/history/default.php b/src/site/template/aurelia/layouts/topic/edit/history/default.php index fb3904a243f..71fcca03d92 100644 --- a/src/site/template/aurelia/layouts/topic/edit/history/default.php +++ b/src/site/template/aurelia/layouts/topic/edit/history/default.php @@ -1,5 +1,4 @@
X
@@ -28,14 +23,11 @@ : escape($this->topic->subject) ?> -

escape($this->config->historyLimit) . ' ' . Text::_('COM_KUNENA_POST_TOPIC_HISTORY_LAST') ?>

- history as $this->message) : - ?> - + history as $this->message) : ?>
    @@ -46,7 +38,6 @@ message->userid)); $useravatar = $profile->getAvatarImage(KunenaFactory::getTemplate()->params->get('avatarType'), 'profile'); - if ($useravatar) : echo $this->message->getAuthor()->getLink($useravatar, null, '', '', null, $this->topic->getcategory()->id); endif; @@ -65,24 +56,42 @@
message->getAttachments(); + $hasVisibleAttachments = false; + + // Filter out private attachments + $visibleAttachments = array_filter($attachments, function($attachment) { + return $attachment->protected != 32; // Exclude private attachments + }); + + if (!empty($visibleAttachments)) : + foreach ($visibleAttachments as $attachment) { + if (!$attachment->inline) { + $hasVisibleAttachments = true; + break; + } + } + endif; - if (!empty($attachments)) : - ?> -
- -
-
    - -
  • -
    - getLayout()->render('thumbnail'); ?> - getLayout()->render('textlink'); ?> -
    -
  • - -
-
+ if ($hasVisibleAttachments) : ?> +
+
+ +
+
+
    + inline) : ?> +
  • +
    + getLayout()->render('thumbnail'); ?> + getLayout()->render('textlink'); ?> +
    +
  • + +
+
+