miniflux-legacy/templates/item.php
Philip Walden 2874d16a5d Provides enahncement fguillot/miniflux #162 "Provide original link to any audio/video enclosures".
Essentially, if an enclosure tag exists in the item, then the item menu will contain
a link 'multimedia [speaker symbol]' to the media url. Otherwise, if there is no
enclosure tag, there is no menu item shown.

This feature required adding an enclosure column to the items table (models/schema.php)
and bumping the DB version to 21 (models/config.php). I also added enclosure tag logic
to the Rss20 parser, the model/item.php and template/item.php files.
2014-02-17 10:41:22 -08:00

46 lines
2.1 KiB
PHP

<article
id="item-<?= $item['id'] ?>"
data-item-id="<?= $item['id'] ?>"
data-item-status="<?= $item['status'] ?>"
data-item-bookmark="<?= $item['bookmark'] ?>"
data-item-page="<?= $menu ?>"
<?= $hide ? 'data-hide="true"' : '' ?>
>
<h2>
<?= $item['bookmark'] ? '<span id="bookmark-icon-'.$item['id'].'">★ </span>' : '' ?>
<?= $item['status'] === 'read' ? '<span id="read-icon-'.$item['id'].'">✔ </span>' : '' ?>
<a
href="?action=show&amp;menu=<?= $menu ?>&amp;id=<?= $item['id'] ?>"
data-item-id="<?= $item['id'] ?>"
id="show-<?= $item['id'] ?>"
<?= $item['status'] === 'read' ? 'class="read"' : '' ?>
>
<?= Helper\escape($item['title']) ?>
</a>
</h2>
<p class="preview">
<?= Helper\escape(Helper\summary(strip_tags($item['content']), 50, 300)) ?>
</p>
<ul class="item-menu">
<li>
<?php if (! isset($item['feed_title'])): ?>
<?= Helper\get_host_from_url($item['url']) ?>
<?php else: ?>
<a href="?action=feed-items&amp;feed_id=<?= $item['feed_id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Helper\escape($item['feed_title']) ?></a>
<?php endif ?>
</li>
<li class="hide-mobile">
<?= dt('%e %B %Y %k:%M', $item['updated']) ?>
</li>
<li class="hide-mobile">
<a href="<?= $item['url'] ?>" id="original-<?= $item['id'] ?>" rel="noreferrer" target="_blank" data-item-id="<?= $item['id'] ?>"><?= t('original link') ?></a>
</li>
<?php if (isset($item['enclosure']) && ! is_null($item['enclosure'])): ?>
<li class="hide-mobile">
<a href="<?= $item['enclosure'] ?>" rel="noreferrer" target="_blank">multimedia 🔉</a>
</li>
<?php endif ?>
<?= \PicoTools\Template\load('bookmark_links', array('item' => $item, 'menu' => $menu, 'offset' => $offset, 'source' => '')) ?>
<?= \PicoTools\Template\load('status_links', array('item' => $item, 'redirect' => $menu, 'offset' => $offset)) ?>
</ul>
</article>