From 0077b072565178e5467f2d60624fa1bc24c1b94a Mon Sep 17 00:00:00 2001 From: Lucas Heuvelmann Date: Sat, 24 Feb 2018 15:42:22 +0100 Subject: [PATCH] Add config option to hide the thumbnails The thumbnails, e.g. of the Youtube spout bloat the layout of the single items while collapsed. This allows the user to hide the thumbnails via a config option. --- NEWS.md | 5 +++++ defaults.ini | 1 + spouts/twitter/usertimeline.php | 2 +- templates/item.phtml | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index ca4785722c..58a8f13d54 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,9 @@ # selfoss news +## 2.19 – unreleased +### New features +- Thumbnails can be disabled ([#897](https://github.com/SSilence/selfoss/pull/897)) + + ## 2.18 – 2018-03-05 ### New features - Full-text RSS spout is now able to extract content from PDFs ([#897](https://github.com/SSilence/selfoss/pull/897)) diff --git a/defaults.ini b/defaults.ini index 7dba4b8b7f..ea7a46a92b 100644 --- a/defaults.ini +++ b/defaults.ini @@ -40,3 +40,4 @@ env_prefix=selfoss_ camo_domain= camo_key= scroll_to_article_header=1 +show_thumbnails=1 diff --git a/spouts/twitter/usertimeline.php b/spouts/twitter/usertimeline.php index 3f905ec513..acb1ca3302 100644 --- a/spouts/twitter/usertimeline.php +++ b/spouts/twitter/usertimeline.php @@ -257,7 +257,7 @@ public function getContent() { $item = $item->retweeted_status; } - if (isset($item->extended_entities) && isset($item->extended_entities->media) && count($item->extended_entities->media) > 1) { + if (isset($item->extended_entities) && isset($item->extended_entities->media) && count($item->extended_entities->media) > 0) { foreach ($item->extended_entities->media as $media) { if ($media->type === 'photo') { $result .= '

' . PHP_EOL; diff --git a/templates/item.phtml b/templates/item.phtml index f5e310ef93..e36be917aa 100644 --- a/templates/item.phtml +++ b/templates/item.phtml @@ -57,7 +57,7 @@ - item['thumbnail']) && strlen(trim($this->item['thumbnail'])) > 0) : ?> + item['thumbnail']) && strlen(trim($this->item['thumbnail'])) > 0) : ?>
<?= htmLawed(htmlspecialchars_decode($this->item['title']), ['deny_attribute' => '*', 'elements' => '-*']); ?>