Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add config option to hide the thumbnails #1022

Merged
merged 2 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 4 additions & 0 deletions _docs/website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ <h2 id="configuration_params">Configuration</h2>
<td class="documentation-first-column">camo_key</td>
<td>Camo domain used to proxify images (optional). See <a href="https://github.com/atmos/camo">atmos/camo</a> for more details</td>
</tr>
<tr>
<td class="documentation-first-column">show_thumbnails</td>
<td>If set to false, thumbnails are not shown in the collapsed view. Defaults to true.</td>
</tr>
</table>
</div>

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