1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-22 22:25:31 +02:00

Issue #1512 - Source options added. Help tips added.

This commit is contained in:
Cameron
2016-04-14 16:37:10 -07:00
parent e4b9db6307
commit 48f65c823f
4 changed files with 39 additions and 8 deletions

View File

@@ -31,8 +31,17 @@ if(false === $cached)
$template = e107::getTemplate('news', 'news_menu', 'grid');
$gridSize = vartrue($parms['layout'],'col-md-4');
$parmSrch = array('{NEWSGRID}', '_titleLimit_', '_summaryLimit_');
$parmReplace = array($gridSize, vartrue($parms['titleLimit'],0),vartrue($parms['summaryLimit'],0));
$parmSrch = array(
'{NEWSGRID}',
'_titleLimit_',
'_summaryLimit_'
);
$parmReplace = array(
$gridSize,
vartrue($parms['titleLimit'],0),
vartrue($parms['summaryLimit'],0)
);
$template = str_replace($parmSrch , $parmReplace, $template);
@@ -48,11 +57,21 @@ if(false === $cached)
$parms['order'] = 'n.news_datestamp DESC';
$treeparm = array();
if(vartrue($parms['count'])) $treeparm['db_limit'] = '0, '.intval($parms['count']);
if(vartrue($parms['order'])) $treeparm['db_order'] = e107::getParser()->toDb($parms['order']);
$parms['return'] = true;
if(varset($parms['source']) == 'template')
{
$treeparm['db_where'] = 'FIND_IN_SET(6, n.news_render_type)';
}
if(varset($parms['source']) == 'sticky')
{
$treeparm['db_where'] = 'n.news_sticky=1';
}
$cached = $ntree->loadJoinActive(vartrue($parms['category'], 0), false, $treeparm)->render($template, $parms, $render);
e107::getCache()->set($cacheString, $cached);