roccochiolo
New member
Hi everyone, I have to upload a module on smarty template but it doesn't upload anything, please help, thank you very much, regards Rocco
function addSmartyModules($keyx ,$keyw ,$val , $name)
{
global $smarty ;
ob_start();
if(!file_exists("./modules/".$name."/index.php")){
die("<table style ='width:300px;'><tr><td>Files ".$name." not exists</td></tr></table>");
}
require "./modules/".$name."/index.php";
$keyw[$val] = ob_get_contents();
ob_end_clean();
return $smarty->assign($keyx,$keyw);
} foreach($leftcol as $key => $left)
{
/* if(!file_exists("./modules/login/index.php")){
die("<table style ='width:300px;'><tr><td>Files ".$left['name']." not exists</td></tr></table>");
}require "./modules/".$left['name']."/index.php";
$msite["blocks"] = ob_get_contents(); */
addSmartyModules("msite",$msite,"blocks",$left['name']);
}
index.tpl :
<{include file="modulesleft.tpl"}>
</div>
modulesleft.tpl :
<{$msite.blocks}>
function addSmartyModules($keyx ,$keyw ,$val , $name)
{
global $smarty ;
ob_start();
if(!file_exists("./modules/".$name."/index.php")){
die("<table style ='width:300px;'><tr><td>Files ".$name." not exists</td></tr></table>");
}
require "./modules/".$name."/index.php";
$keyw[$val] = ob_get_contents();
ob_end_clean();
return $smarty->assign($keyx,$keyw);
} foreach($leftcol as $key => $left)
{
/* if(!file_exists("./modules/login/index.php")){
die("<table style ='width:300px;'><tr><td>Files ".$left['name']." not exists</td></tr></table>");
}require "./modules/".$left['name']."/index.php";
$msite["blocks"] = ob_get_contents(); */
addSmartyModules("msite",$msite,"blocks",$left['name']);
}
index.tpl :
<{include file="modulesleft.tpl"}>
</div>
modulesleft.tpl :
<{$msite.blocks}>