1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

Fixes #3562 deprecated news template with PHP7.

This commit is contained in:
Cameron
2018-12-19 12:21:53 -08:00
parent 2e2e9fe23d
commit 188232a24e

View File

@@ -1466,6 +1466,9 @@ class news_front
// } // }
} }
/**
* @deprecated - for BC only. May be removed in future without further notice.
*/
if(isset($this->pref['news_unstemplate']) && $this->pref['news_unstemplate'] && file_exists(THEME."news_template.php")) if(isset($this->pref['news_unstemplate']) && $this->pref['news_unstemplate'] && file_exists(THEME."news_template.php"))
{ {
// theme specific template required ... // theme specific template required ...
@@ -1502,13 +1505,23 @@ class news_front
$loop = 1; $loop = 1;
} }
} }
$loop = 1; $loop = 1;
foreach($newsdata as $data) {
$var = "ITEMS{$loop}"; $items = array();
$$var = $data;
foreach($newsdata as $data)
{
$var = "ITEMS".$loop;
// $$var = $data;
$items[$var] = $data;
$loop ++; $loop ++;
} }
$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWSCLAYOUT);
$text = $tp->parseTemplate($NEWSCLAYOUT, false, $items);
// $text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWSCLAYOUT);
// Deprecated // Deprecated