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
Next Next commit
Restore http check for now
  • Loading branch information
SharkyKZ committed Jun 11, 2018
commit a71bcbbd630a0cdb67a2eb4f1d9f8b2cb0ed86bc
10 changes: 5 additions & 5 deletions administrator/modules/mod_feed/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@
break;
endif;
$uri = $feed[$i]->uri || !$feed[$i]->isPermaLink ? trim($feed[$i]->uri) : trim($feed[$i]->guid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space before =

$uri = !$uri ? $params->get('rsslink') : $uri;
$text = !empty($feed[$i]->content) || !is_null($feed[$i]->content) ? $feed[$i]->content : $feed[$i]->description;
$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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to make consistency?

  • !is_null vs. !== null
  • add trim
<?php $text  = !empty($this->rssDoc[$i]->content) || $this->rssDoc[$i]->content !== null ? trim($this->rssDoc[$i]->content) : trim($this->rssDoc[$i]->description); ?>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried not touching unrelated code but OK.

?>
<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 $feed[$i]->title; ?></a></h5>
<?php else : ?>
<h5 class="feed-link"><?php echo $feed[$i]->title; ?></h5>
<?php endif; ?>
<h5 class="feed-link"><?php echo $feed[$i]->title; ?></h5>
<?php endif; ?>

<?php if ($params->get('rssitemdesc') && !empty($text)) : ?>
<div class="feed-item-description">
Expand Down
2 changes: 1 addition & 1 deletion components/com_newsfeeds/views/newsfeed/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<?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 ? $this->item->link : $uri; ?>
<?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); ?>
<li>
Expand Down
4 changes: 2 additions & 2 deletions modules/mod_feed/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
$iUrl = isset($feed->image) ? $feed->image : null;
$iTitle = isset($feed->imagetitle) ? $feed->imagetitle : null;
?>
<div style="direction: <?php echo $rssrtl ? 'rtl' :'ltr'; ?>; text-align: <?php echo $rssrtl ? 'right' :'left'; ?> !important" class="feed<?php echo $moduleclass_sfx; ?>">
<div style="direction: <?php echo $rssrtl ? 'rtl' :'ltr'; ?>; text-align: <?php echo $rssrtl ? 'right' :'left'; ?> !important" class="feed<?php echo $moduleclass_sfx; ?>">
<?php
// Feed description
if ($feed->title !== null && $params->get('rsstitle', 1))
Expand Down Expand Up @@ -91,7 +91,7 @@
<?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 ? $params->get('rsslink') : $uri;
$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);
?>
Expand Down