rispondo scusandomi con i moderatori e tutti i membri della comunity , oggi mi hanno attivato l internet e quindi riesco a postare il codice php
Codice PHP:
if($result = $dbcore->querycount("SELECT * FROM `modules` WHERE `status` = '1' ") >0)
{
if($left = $dbcore->querycount("SELECT * FROM `modules` WHERE `layut` = 'left' ") >0)
{
loadcolums(false,$left,false);
$leftcol = $dbcore->getlist("SELECT * FROM `modules` WHERE `layut` = 'left' AND `permiss` != '1'") ;
if($leftcol)
{
ob_start();
foreach ($leftcol as $leftrow)
{
include"modules/".$leftrow['name']."/index.php";
$pag_cms['modules_left'] = ob_get_contents();
}
ob_end_clean();
}
}
if($right = $dbcore->querycount("SELECT * FROM `modules` WHERE `layut` = 'right' ") >0)
{
loadcolums(false,false,$right);
$rightcol = $dbcore->getlist("SELECT * FROM `modules` WHERE `layut` = 'right' AND `permiss` != '1'") ;
if($rightcol)
{
ob_start();
foreach ($rightcol as $rightrow)
{
include"modules/".$rightrow['name']."/index.php";
$pag_cms['modules_right'] = ob_get_contents();
}
ob_end_clean();
}
}
}else{
}
}
$smarty->assign("titlecms" , $settings['company']);
$smarty->assign("pathcms" , $settings['pathcms']);
$smarty->assign("pag_cms",$pag_cms);
$smarty->display('index.tpl');
qui carico i moduli sul loyut parte destra e sinistra
Codice PHP:
function loadcolums( $duble , $left, $right)
{
global $dbcore , $settings, $smarty;
if( (isset($left) or $left === 1 )and (isset($right) or $right === 1 ))
{
$smarty->assign("modules_duble",1);
return true ;
}else if ((isset($left) or $left === 1 )and (isset($right) or $right === 0 ))
{
$smarty->assign("modules_left",1);
return true ;
}else if ((isset($left) or $left === 0 )and (isset($right) or $right === 1))
{
$smarty->assign("modules_right",1);
return true ;
}else{
return false ;
}
questa funzione deve inviare a smarty le opzioni che devono essere eseguite
codice:
<{if $modules_left == 1 }>
<style type="text/css">
div#navigation{
float: left;
display:inline-block;
border:#333333 1px dashed;
margin-top:20px;
margin-left:10px;
margin-right:10px;
background:#00FF00;
width: 180px;\width:190px;w\idth:180px;
overflow:hidden;
}
div#content{
margin-left:200px;
margin-top:20px;
margin-right:10px;
margin-bottom:10px;
padding: 1em 20px;
background:#FFFFFF;
border:#333333 1px dashed;
}
</style>
<{elseif $modules_right == 1}>
<style type="text/css">
div#extra
{
float: right;
display:inline-block;
border:#333333 1px dashed;
margin-top:20px;
margin-left:10px;
margin-right:10px;
background:#00FF00;
overflow:hidden;
width: 180px;\width:190px;w\idth:180px;
}
div#content{
margin-right:200px;
margin-top:20px;
margin-left:20px;
margin-bottom:10px;
padding: 1em 5px;
background:#FFFFFF;
border:#333333 1px dashed;
}
</style>
<{elseif $modules_duble == 1 }>
<style type="text/css">
div#navigation{
float: left;
display:inline-block;
border:#333333 1px dashed;
margin-top:20px;
margin-left:10px;
margin-right:10px;
background:#00FF00;
width: 180px;\width:190px;w\idth:180px;
overflow:hidden;
}
div#extra
{
float: right;
display:inline-block;
border:#333333 1px dashed;
margin-top:20px;
margin-left:10px;
margin-right:10px;
background:#00FF00;
width: 180px;\width:190px;w\idth:180px;
overflow:hidden;
}
div#content{
margin-right:200px;
margin-top:20px;
margin-left:190px;
margin-bottom:10px;
padding: 1em 5px;
background:#FFFFFF;
border:#333333 1px dashed;
}
</style>
<{else }>
<style type="text/css">
div#content{margin: 0 200px;padding: 1em 10px;text-align:left;FONT-FAMILY: Trebuchet MS, Verdana, Arial, Helvetica;text-align:left; }
</style>
<{/if }>
spero di essermi spiegato bene