$valori=Valori($idx);?>
echo $valori[titolo]?>
$a=0;
$result=mysql_db_query($dbname,"select * from pagine where lay='news' and vis=1 and pad=$idx and (dt<=now() or dt='') order by ord desc limit $stqry,$stq ");
while ($row=mysql_fetch_array($result)){
$valori=Valori($row[ID]); ?>
if ($a!=0){?>
}?>
if ($valori[titolo]!=""){?>
}?>
$a++;}?>
$a=0;
$result=mysql_db_query($dbname,"select * from pagine where lay='news' and vis=1 and pad=$idx and (dt<=now() or dt='') order by ord desc ");
$totpg=ceil((mysql_num_rows($result))/$stq);
$actpg=($stqry/$stq)+1;
if ($totpg>1) { ?>
$tmppg=$actpg-4;
if (($tmppg < 1) || ($totpg<=5)){
$minp=1;
}else{
$minp=$actpg-2;
}
if (($actpg+1) <3) {
if ($totpg>=5) {
$maxp=5;
}else{
$maxp=$totpg;
}
}else{
if (($actpg+2)<=$totpg) {
$maxp=$actpg+2;
}else{
$maxp=$totpg;
if (($maxp==$totpg) && (($minp-2)>1)) {
$minp=$totpg-2;
}
}
}
if ($actpg!=1){
echo "
<< PREV ";
}
for ($x=$minp;$x<=$maxp;$x++){
if ($x==$actpg) {
echo "
" . $x . " ";
}else{
echo "
" . $x ." ";
}
}
if ($actpg!=$totpg){
echo "
NEXT >> "; }?> } ?>
$valori=Valori($pg);?>
echo $valori[titolo]?>
$fto=mysql_db_query($dbname,"select * from foto where tipo=1 and legame=$pg and vis=1 order by ordine");
if (mysql_num_rows($fto)>0){
$a=1;
?>
$fto=mysql_db_query($dbname,"select * from foto where tipo=1 and legame=$pg and vis=1 order by ordine");
$a=1;
?>
while ($ft=mysql_fetch_array($fto)){?>
$a++;}?>
}?>
echo $valori[testo]?>
$rsfoto2=mysql_db_query($dbname,"select * from foto where tipo=3 and legame=$pg and vis=1 order by ordine");
if ($ft2=mysql_fetch_array($rsfoto2)){?>
}?>