Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Newsfeeds] Use item link instead of guid. #20717

Merged
merged 4 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Some cleanups
  • Loading branch information
SharkyKZ committed Jun 12, 2018
commit 82e61172287cfac788b73abae538ddbcf02409c3
8 changes: 4 additions & 4 deletions administrator/modules/mod_feed/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@
endif;
$uri = $feed[$i]->uri || !$feed[$i]->isPermaLink ? trim($feed[$i]->uri) : trim($feed[$i]->guid);
$uri = !$uri || stripos($uri, 'http') !== 0 ? $params->get('rsslink') : $uri;
$text = !empty($feed[$i]->content) || !is_null($feed[$i]->content) ? $feed[$i]->content : $feed[$i]->description;
$text = $feed[$i]->content !== '' ? trim($feed[$i]->content) : '';
?>
<li>
<?php if (!empty($uri)) : ?>
<h5 class="feed-link">
<a href="<?php echo $uri; ?>" target="_blank">
<?php echo $feed[$i]->title; ?></a></h5>
<?php echo trim($feed[$i]->title); ?></a></h5>
<?php else : ?>
<h5 class="feed-link"><?php echo $feed[$i]->title; ?></h5>
<h5 class="feed-link"><?php echo trim($feed[$i]->title); ?></h5>
<?php endif; ?>

<?php if ($params->get('rssitemdesc') && !empty($text)) : ?>
<?php if ($params->get('rssitemdesc') && $text !== '') : ?>
<div class="feed-item-description">
<?php
// Strip the images.
Expand Down
13 changes: 6 additions & 7 deletions components/com_newsfeeds/views/newsfeed/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,20 @@
<?php if (empty($this->rssDoc[$i])) : ?>
<?php break; ?>
<?php endif; ?>
<?php $uri = $this->rssDoc[$i]->uri || !$this->rssDoc[$i]->isPermaLink ? trim($this->rssDoc[$i]->uri) : trim($this->rssDoc[$i]->guid); ?>
<?php $uri = !$uri || stripos($uri, 'http') !== 0 ? $this->item->link : $uri; ?>
<?php $text = !empty($this->rssDoc[$i]->content) || $this->rssDoc[$i]->content !== null ? trim($this->rssDoc[$i]->content) : trim($this->rssDoc[$i]->description); ?>
<?php $title = trim($this->rssDoc[$i]->title); ?>
<?php $uri = $this->rssDoc[$i]->uri || !$this->rssDoc[$i]->isPermaLink ? trim($this->rssDoc[$i]->uri) : trim($this->rssDoc[$i]->guid); ?>
<?php $uri = !$uri || stripos($uri, 'http') !== 0 ? $this->item->link : $uri; ?>
<?php $text = $this->rssDoc[$i]->content !== '' ? trim($this->rssDoc[$i]->content) : ''; ?>
<li>
<?php if (!empty($uri)) : ?>
<h3 class="feed-link">
<a href="<?php echo htmlspecialchars($uri); ?>" target="_blank">
<?php echo $title; ?>
<?php echo trim($this->rssDoc[$i]->title); ?>
</a>
</h3>
<?php else : ?>
<h3 class="feed-link"><?php echo $title; ?></h3>
<h3 class="feed-link"><?php echo trim($this->rssDoc[$i]->title); ?></h3>
<?php endif; ?>
<?php if ($this->params->get('show_item_description') && !empty($text)) : ?>
<?php if ($this->params->get('show_item_description') && $text !== '') : ?>
<div class="feed-item-description">
<?php if ($this->params->get('show_feed_image', 0) == 0) : ?>
<?php $text = JFilterOutput::stripImages($text); ?>
Expand Down
14 changes: 6 additions & 8 deletions modules/mod_feed/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,24 @@
<ul class="newsfeed<?php echo $params->get('moduleclass_sfx'); ?>">
<?php for ($i = 0, $max = min(count($feed), $params->get('rssitems', 5)); $i < $max; $i++) { ?>
<?php
$uri = $feed[$i]->uri || !$feed[$i]->isPermaLink ? trim($feed[$i]->uri) : trim($feed[$i]->guid);
$uri = !$uri || stripos($uri, 'http') !== 0 ? $params->get('rsslink') : $uri;
$text = !empty($feed[$i]->content) || $feed[$i]->content !== null ? trim($feed[$i]->content) : trim($feed[$i]->description);
$title = trim($feed[$i]->title);
$uri = $feed[$i]->uri || !$feed[$i]->isPermaLink ? trim($feed[$i]->uri) : trim($feed[$i]->guid);
$uri = !$uri || stripos($uri, 'http') !== 0 ? $params->get('rsslink') : $uri;
$text = $feed[$i]->content !== '' ? trim($feed[$i]->content) : '';
?>
<li>
<?php if (!empty($uri)) : ?>
<span class="feed-link">
<a href="<?php echo htmlspecialchars($uri, ENT_COMPAT, 'UTF-8'); ?>" target="_blank">
<?php echo $feed[$i]->title; ?></a></span>
<?php echo trim($feed[$i]->title); ?></a></span>
<?php else : ?>
<span class="feed-link"><?php echo $title; ?></span>
<span class="feed-link"><?php echo trim($feed[$i]->title); ?></span>
<?php endif; ?>

<?php if (!empty($text) && $params->get('rssitemdesc')) : ?>
<?php if ($params->get('rssitemdesc') && $text !== '') : ?>
<div class="feed-item-description">
<?php
// Strip the images.
$text = JFilterOutput::stripImages($text);

$text = JHtml::_('string.truncate', $text, $params->get('word_count'));
echo str_replace('&apos;', "'", $text);
?>
Expand Down