mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Issue #4786 - Set a unique cache ID when filtering current news item.
This commit is contained in:
@@ -7,7 +7,17 @@
|
|||||||
*/
|
*/
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
$cacheString = 'nq_news_latest_menu_'.md5(serialize($parm).USERCLASS_LIST.e_LANGUAGE);
|
|
||||||
|
if($current = e107::getRegistry('current_news_item'))
|
||||||
|
{
|
||||||
|
$currentID = (int) $current['news_id'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$currentID = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cacheString = 'nq_news_latest_menu_'.md5(serialize($parm).USERCLASS_LIST.e_LANGUAGE.$currentID);
|
||||||
$cached = e107::getCache()->retrieve($cacheString);
|
$cached = e107::getCache()->retrieve($cacheString);
|
||||||
if(false === $cached)
|
if(false === $cached)
|
||||||
{
|
{
|
||||||
@@ -47,9 +57,9 @@ if(false === $cached)
|
|||||||
if(vartrue($parms['order'])) $treeparm['db_order'] = e107::getParser()->toDb($parms['order']);
|
if(vartrue($parms['order'])) $treeparm['db_order'] = e107::getParser()->toDb($parms['order']);
|
||||||
$parms['return'] = true;
|
$parms['return'] = true;
|
||||||
|
|
||||||
if($current = e107::getRegistry('current_news_item'))
|
if(!empty($currentID))
|
||||||
{
|
{
|
||||||
$treeparm['db_where'] = 'news_id != '.(int) $current['news_id'];
|
$treeparm['db_where'] = 'news_id != '.$currentID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prevent data-overwrite if menu is called within news template and more news shortcodes are called after */
|
/* Prevent data-overwrite if menu is called within news template and more news shortcodes are called after */
|
||||||
|
Reference in New Issue
Block a user