buongiorno a tutti sto cercando di far funzionare un applicazione che avevo inbiziato 16 anni fa' e che poi ho mollato ,
ma quando passo i blocchi mi genera un errore del tipo
codice:
Warning: Undefined array key "modules_left" in C:\xampp\htdocs\site\templates_c\9a4d7521f165bc58d27affa89914f54d1a221a5a_0.file.header.tpl.php on line 31
Warning: Attempt to read property "value" on null in C:\xampp\htdocs\site\templates_c\9a4d7521f165bc58d27affa89914f54d1a221a5a_0.file.header.tpl.php on line 31
l errore lo identifica nel template_c
qui posto il codice come passo a smarty
Codice PHP:
$queryrig = $dbquery->query("SELECT * FROM `modules` WHERE `layut` = 'right' AND `status` = '1' ");
$rightstatusactive = $queryrig->num_rows ;
if($rightstatusactive > 0){
ob_start();
while($rightcol = $queryrig->fetch_array()){
require_once ( DIR."/modules/".$rightcol['name']."/index.php");
$smarty->assign("modules_name",$rightcol['name']);
$pag_site['modules_right'] = ob_get_contents();
$smarty->assign("pag_site",$pag_site);
}ob_end_clean();
}
poi con una semplice funzione assegno al template il modulo
Codice PHP:
function loadcolums( $left, $right) {
global $smarty;
if($left == 1 && $right == 0 ){
$smarty->assign("modules_left",1);
return true ;
}else if($right ==1 && $left == 0 ){
$smarty->assign("modules_right",1);
return true ;
}else if($left == 1 && $right == 1 ){
$smarty->assign("modules_duble",1);
return true ;
}else{
return false ;
}
}
e le variabili in smarty le chiamo cosi :
codice HTML:
<{if $modules_left == 1 or $modules_duble == 1 }>
</div><div id="navigation" class="rounded">
<!-- <<<<<<<CONTENUTO SINISTRO>>>>>>>>>> -->
<{include file="modulesleft.tpl"}> </div>
<!--<<<<<<<CONTENUTO SINISTRO>>>>>>>>>>-->
</div>
<{/if}>
<{if $modules_right == 1 or $modules_duble == 1 }>
<div id="extra" class="rounded">
<!-- <<<<<<<CONTENUTO DESTRO>>>>>>>>>>-->
<{include file="modulesright.tpl"}>
<!--<<<<<<<CONTENUTO DESTRO>>>>>>>>>> -->
</div>
<{/if}>
non riesco a capire dov e l errore , sicuramente e nel files .tpl perche se elimino le variabili dal files .tpl spariscono gli errori grazie anticipate a chi mi aiutera a saltarci fuori
buona giornata a tutti