Page 1 of 1

[solved] smarty3 problems with CMSMS 1.11.4

Posted: Thu Feb 21, 2013 3:28 pm
by nicmare
i have this udt but it does not work in cmsms 1.11.4 anymore:

Code: Select all

$gcbops =& cmsms()->GetGlobalContentOperations();
$obj    =& $gcbops->LoadHtmlBlobByName("getpage");
$smarty =& cmsms()->GetSmarty();

if(isset($params['showprice'])){
$showprice = $params['showprice'];
}
if(isset($params['alias'])){
$pages = $params['alias'];
}
if(isset($params['target'])){
$target = $params['target'];
}
if(isset($params['class'])){
$class = $params['class'];
}
if(isset($params['mode'])){
$mode = $params['mode'];
}
if(isset($params['sidebar'])){
$sidebar = $params['sidebar'];
}
if(isset($params['tmbheight'])){
$tmbheight = $params['tmbheight'];
} else {
$tmbheight = 120;
}
if(isset($params['tmbwidth'])){
$tmbwidth = $params['tmbwidth'];
} else {
$tmbwidth = 170;
}
if(isset($params['showfilter'])){
$showfilter = $params['showfilter'];
}
if(isset($params['filteritems'])){
$filteritems = $params['filteritems'];
}
if(isset($params['menuitems'])){
$menuitems = $params['menuitems'];
}
$smarty->assign('pages', $pages);
$smarty->assign('target', $target);
$smarty->assign('class', $class);
$smarty->assign('mode', $mode);
$smarty->assign('sidebar', $sidebar);
$smarty->assign('tmbheight', $tmbheight);
$smarty->assign('tmbwidth', $tmbwidth);
$smarty->assign('showfilter', $showfilter);
$smarty->assign('filteritems', $filteritems);
$smarty->assign('menuitems', $menuitems);
$smarty->assign('showprice', $showprice);
$smarty->_compile_source('temporary template', $obj->content, $_compiled );
return $smarty->_eval('?>' . $_compiled);
_compile_source is unkown. how to adapt that code to work with smarty3 please??

Re: smarty3 problems with CMSMS 1.11.4

Posted: Thu Feb 21, 2013 4:38 pm
by Dr.CSS
There is a post about "what we broke" and it has to do with the calls in UDTs and modules like you are doing...

Re: smarty3 problems with CMSMS 1.11.4

Posted: Fri Feb 22, 2013 9:07 am
by nicmare
i know this and similar threads. but can't find a solution for my problem.

alright. after investigating some time in third party modules, i think i found the solution for smarty3:

Code: Select all

$compiled = $smarty->fetch('eval:' . $obj->content);
return $compiled;