no io di config ne uso uno solament e lo uso per i parametri di connessione
no io di config ne uso uno solament e lo uso per i parametri di connessione
Non è tanto importante saper fare,quanto ad avere voglia d imparare .
help come posso assegniare ad ogni td la posizione ti spiego nel tpl sto facendo cosicodice:<table id='helptable' cellpadding='0' cellspacing='0'> <tr> <td> <table id='contenutitexticone'> <tr> <td id='iconticket'> <a href ="{$path_site}/{$path_content}/index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td> <td id='titlemessage'><a href ="{$path_site}/{$path_content}/index.php" target="_parent">{$title_content}</a> <span class='smalltext'>{$descrict_content}</span> </td> </tr> </table> </td> <td> <table id='contenutitexticone'> <tr> <td id='iconticket'> <a href ="{$path_site}/{$path_content}/index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td> <td id='titlemessage'><a href ="{$path_site}/{$path_content}/index.php" target="_parent">{$title_content}</a> <span class='smalltext'>{$descrict_content}</span> </td> </tr> </table> </td> </tr> <tr> <td>
e il php cosie mi ede le stesse immagini dovrei identificarle per posizioneCodice PHP:$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='4' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='5' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='6' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
Non è tanto importante saper fare,quanto ad avere voglia d imparare .
Prova a cambiare il nome di $caric_blocks_home; a volte in PHP si hanno problemi nel sovrascrivere variabili già usate...oppure fai un unset($carc_blocks_home) prima che la riusi...
![]()
ciao mi faresti un esempio di come unsettare le variabili ma poi vedevo da altri lavori che nel template potrei mettere un lavoro tipo {if $posizione ==1}{/if} ho provato a passare la posizione ma niente da fare
Non è tanto importante saper fare,quanto ad avere voglia d imparare .
Per usare if, prova a fareCodice PHP:$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='4' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
unset($caric_blocks_home);
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='5' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
unset($caric_blocks_home);
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='6' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
{if $posizione eq "1"}
...
{/if}
Il confronto tra stringhe e non interi...il parametro è passato come stringa...
![]()
grazie ma non riesco a apire metto cosi
{if $posizione eq "1"}
<table id='contenutitexticone'>
<tr>
<td id='iconticket'> <a href ="{$path_site}/{$path_content}index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td>
<td id='titlemessage'><a href ="{$path_site}/{$path_content}index.php" target="_parent">{$title_content}</a>
<span class='smalltext'>{$descrict_content}</span> </td>
</tr>
</table>
{/if}
e scompare
Non è tanto importante saper fare,quanto ad avere voglia d imparare .
Cosa scompare? Ma prima si vede qualcosa?Originariamente inviato da rocco.mod
grazie ma non riesco a apire metto cosi
{if $posizione eq "1"}
<table id='contenutitexticone'>
<tr>
<td id='iconticket'> <a href ="{$path_site}/{$path_content}index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td>
<td id='titlemessage'><a href ="{$path_site}/{$path_content}index.php" target="_parent">{$title_content}</a>
<span class='smalltext'>{$descrict_content}</span> </td>
</tr>
</table>
{/if}
e scompare
ora mi vede solo uno che sarebbe l ultimo che caricacodice:<table id='helptable' cellpadding='0' cellspacing='0'> <tr> <td> {if $posizione == "1"} <table id='contenutitexticone'> <tr> <td id='iconticket'> <a href ="{$path_site}/{$path_content}index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td> <td id='titlemessage'><a href ="{$path_site}/{$path_content}index.php" target="_parent">{$title_content}</a> <span class='smalltext'>{$descrict_content}</span> </td> </tr> </table> {/if} </td> <td> {if $posizione == "2"} <table id='contenutitexticone'> <tr> <td id='iconticket'> <a href ="{$path_site}/{$path_content}index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td> <td id='titlemessage'><a href ="{$path_site}/{$path_content}index.php" target="_parent">{$title_content}</a> <span class='smalltext'>{$descrict_content}</span> </td> </tr> </table> {/if} </td> </tr> <tr> <td> {if $posizione == "3"} <table id='contenutitexticone'> <tr> <td id='iconticket'> <a href ="{$path_site}/{$path_content}index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td> <td id='titlemessage'><a href ="{$path_site}/{$path_content}index.php" target="_parent">{$title_content}</a> <span class='smalltext'>{$descrict_content}</span> </td> </tr> </table> {/if} </td> <td> {if $posizione == "4"} <table id='contenutitexticone'> <tr> <td id='iconticket'> <a href ="{$path_site}/{$path_content}index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td> <td id='titlemessage'><a href ="{$path_site}/{$path_content}index.php" target="_parent">{$title_content}</a> <span class='smalltext'>{$descrict_content}</span> </td> </tr> </table> {/if} </td> </tr> <tr> <td> {if $posizione == "5"} <table id='contenutitexticone'> <tr> <td id='iconticket'> <a href ="{$path_site}/{$path_content}index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td> <td id='titlemessage'><a href ="{$path_site}/{$path_content}index.php" target="_parent">{$title_content}</a> <span class='smalltext'>{$descrict_content}</span> </td> </tr> </table> {/if} </td> <td> {if $posizione == "6"} <table id='contenutitexticone'> <tr> <td id='iconticket'> <a href ="{$path_site}/{$path_content}index.php" target="_parent">[img]{$path_site}/immagini/{$img_icon}.gif[/img]</a> </td> <td id='titlemessage'><a href ="{$path_site}/{$path_content}index.php" target="_parent">{$title_content}</a> <span class='smalltext'>{$descrict_content}</span> </td> </tr> </table> {/if} </td> </tr> <tr> <td></td> <td></td> </tr> </table> </td> </tr> </table>Codice PHP:if($autorizzato==1){
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='1' and permission='2' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$posizione = $array['posizione'];
$smarty->assign("posizione","$posizione" );
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
}
else
{
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='1' and permission='1' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$posizione = $array['posizione'];
$smarty->assign("posizione","$posizione" );
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
}
unset($caric_blocks_home);
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='3' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$posizione = $array['posizione'];
$smarty->assign("posizione","$posizione" );
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
unset($caric_blocks_home);
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='4' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$posizione = $array['posizione'];
$smarty->assign("posizione","$posizione" );
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
unset($caric_blocks_home);
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='5' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$posizione = $array['posizione'];
$smarty->assign("posizione","$posizione" );
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
unset($caric_blocks_home);
$caric_blocks_home = mysql_query("select * from blocks_home where posizione ='6' and enable ='1' limit 1");
while($array=mysql_fetch_array($caric_blocks_home)){
$posizione = $array['posizione'];
$smarty->assign("posizione","$posizione" );
$smarty->assign("img_icon","".$array['img']."" );
$smarty->assign("path_content","".$array['path']."");
$smarty->assign("title_content",constant("".$array['nome'].""));
$smarty->assign("descrict_content",constant("".$array['description'].""));
}
Non è tanto importante saper fare,quanto ad avere voglia d imparare .
Certo!!! Scusa ma non me ne ero accorto...quando fai $smarty->assign(...) nel ramo else, assegni alle stesse variabili tre valori, SOVREASCRIVENDOLI ogni volta. Dovresti usare variabili diversi o metterli in un array ed usare il costrutto {foreach} in smarty...
![]()
ti dispiacerebbe fare un esempio
Non è tanto importante saper fare,quanto ad avere voglia d imparare .