Skip to content

Commit

Permalink
Add config option to hide the thumbnails
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lucash authored and jtojnar committed Mar 9, 2018
1 parent cdd9125 commit 0077b07
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
1 change: 1 addition & 0 deletions defaults.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ env_prefix=selfoss_
camo_domain=
camo_key=
scroll_to_article_header=1
show_thumbnails=1
2 changes: 1 addition & 1 deletion spouts/twitter/usertimeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= '<p><a href="' . $media->media_url_https . ':large"><img src="' . $media->media_url_https . ':small" alt=""></a></p>' . PHP_EOL;
Expand Down
2 changes: 1 addition & 1 deletion templates/item.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<a href="<?= $this->item['link']; ?>" class="entry-link"></a>

<!-- thumbnail -->
<?php if (isset($this->item['thumbnail']) && strlen(trim($this->item['thumbnail'])) > 0) : ?>
<?php if (\F3::get('show_thumbnails') && isset($this->item['thumbnail']) && strlen(trim($this->item['thumbnail'])) > 0) : ?>
<div class="entry-thumbnail">
<a href="<?= \helpers\Anonymizer::anonymize($this->item['link']); ?>" target="_blank" rel="noopener noreferrer">
<img src="<?= 'thumbnails/' . $this->item['thumbnail']; ?>" alt="<?= htmLawed(htmlspecialchars_decode($this->item['title']), ['deny_attribute' => '*', 'elements' => '-*']); ?>" />
Expand Down

0 comments on commit 0077b07

Please # to comment.