Skip to content

Commit

Permalink
Closes #4786 - Filter currently viewed news item out of latest news l…
Browse files Browse the repository at this point in the history
…ist.
  • Loading branch information
CaMer0n committed Jun 3, 2022
1 parent d672131 commit 8198d33
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions e107_plugins/news/latestnews_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
if(vartrue($parms['order'])) $treeparm['db_order'] = e107::getParser()->toDb($parms['order']);
$parms['return'] = true;

if($current = e107::getRegistry('current_news_item'))
{
$treeparm['db_where'] = 'news_id != '.(int) $current['news_id'];
}

/* Prevent data-overwrite if menu is called within news template and more news shortcodes are called after */
$origParam = e107::getScBatch('news')->getScVar('param');
$origData = e107::getScBatch('news')->getScVar('news_item');
Expand Down

0 comments on commit 8198d33

Please sign in to comment.