Visualizzazione dei risultati da 1 a 9 su 9

Hybrid View

  1. #1
    Forse ho trovato una soluzione, ho inserito queste righe di codice ed ora inizia un nuovo <tr> ogni 4 foto.
    Codice PHP:
    $i=1;


    if (
    $i==1) {
       echo 
    "</tr><tr>";


    if(
    $i ==4) { echo "</tr>";   $i=1;   }
       else {   
    $i++;   } 

    Grazie per l'aiuto, a presto.

  2. #2
    Ho risolto alla perfezione (intendo nel funzionamento, non certo nel codice di programmazione) con il seguente codice.
    Se qualcuno volesse darmi un parere mi farebbe piacere.
    Grazie.

    Codice PHP:
    echo "<Table Width=\"90%\" align=\"center\">";

    $mysqli = new mysqli("$dbhost""$dbuser""$dbpass");
    $mysqli->select_db("$dbname");

    $result mysqli_query ($mysqli,"SELECT * FROM fotografie_rally GROUP BY anno ORDER BY orientamento ASC,anno DESC LIMIT $limite OFFSET $offset"); 
    $num mysqli_num_rows ($result);

    $end=1;
    $i=1;
    while(
    $row mysqli_fetch_assoc($result)) {   
    $file $row['nome_file'];   
    $anno $row['anno'];    
    $title $row['anno'];   
    $subtitle "ANNO $anno";   
    if (
    $anno == 2004) {   
    $title "PRIMA DEL 2005";   
    $subtitle "PRIMA DEL 2005";    }        

    list(
    $width$height) = getimagesize("fotografie_rally/miniature/$file");
    if ((
    $width) <= ($height))        {        
    $visualizza "<Img Src=\"fotografie_rally/miniature/$file\" Height=\"110\" Border=\"1\" alt=\"$title\" title=\"$title\">";        }        
    if ((
    $height) <= ($width))        {        
    $visualizza "<Img Src=\"fotografie_rally/miniature/$file\" Width=\"110\" Border=\"1\" alt=\"$title\" title=\"$title\">";        }                
    if (
    $i==1) {   
    echo 
    "<tr>";   }                
    echo 
    "<Td>";                
    echo 
    "<Table align=\"center\" Cellpadding=\"0\" Cellspacing=\"3\">";        
    echo 
    "<Tr>";        
    echo 
    "<Td>";        
    echo 
    "<center><a href=\"dettaglio_foto_rally.php?anno=$anno\" class=\"border\">"
    echo 
    "$visualizza</a></center>";        
    echo 
    "</Td>";        
    echo 
    "</Tr>";        
    echo 
    "<Tr>";        
    echo 
    "<Td Valign=Top class=\"style_denominazione\">";        
    echo 
    "<center><a href=\"dettaglio_foto_rally.php?anno=$anno\" class=\"border\">"; echo "<b>$subtitle</b></a></center>";        
    echo 
    "</Td>";        
    echo 
    "</Tr>";        
    echo 
    "</Table>";        
    echo 
    "</Td>";               
    if (
    $end == $num) break;
    else {        
    if(
    $i==4) { echo "</tr>";   $i=1$end++;  }   
    else {   
    $i++; $end++;  }}   
    }          
    echo 
    "</Tr>";             



    echo 
    "</Table>"

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.