'$q_data_start' AND `publication` < '$q_data_end' "; if ($operatore == "<") $q_ricerca .= " AND `publication` < '$q_data_start' "; if ($operatore == ">") $q_ricerca .= " AND `publication` > '$q_data_end' "; } if ($ord == 2) { $q_ord = "ORDER BY `publication` DESC"; } if ($ord == 1) { $q_ord = "ORDER BY `voti` DESC, `publication` DESC "; } if ($ord == 0) { $q_ord = " ORDER BY `id` DESC "; } if ($reset == 1) { $q_ricerca = ""; } // Apro conessione al DB require '../../include/opendb_05.php'; $cadariga = 5; $per_pag = 10; $query = "SELECT * FROM photo WHERE contenitore = '".$this_cont."' ".$q_ricerca." ".$q_ord; if (isset($_GET["mostra_up_by"])) $mostra_up_by = $_GET["mostra_up_by"]; if ($mostra_up_by != 0) { $query = "SELECT * FROM photo WHERE contenitore = '".$this_cont."' AND up_by = $mostra_up_by ORDER BY 'id' DESC"; } //echo $query; $result = mysql_query($query) or die("Query failed : " . mysql_error()); $qta = mysql_num_rows ( $result ); $pagine = bcdiv ($qta,$per_pag,0); if (( fmod ($qta,$per_pag) ) > 0 ) $pagine++; $righe = bcdiv ($qta,$cadariga,0); if (( fmod ($qta,$cadariga) ) > 0 ) $righe++; if (isset($_GET["pag"])) { $pag = $_GET["pag"]; } else { $pag = 1; } // DIROTTO SE C'e' get pic if (isset($_REQUEST['getpic'])) { $getpic=$_REQUEST['getpic']; $my_counter = 0; while ( $my_row = mysql_fetch_assoc($result)) { if ($my_row['id'] != $getpic) { $my_counter++; } else { break; } } $pag = floor($my_counter/$per_pag)+1; } $l_lim = ($pag-1)*10; // riempio una matrice associativa $query .= " LIMIT ".$l_lim.",".($l_lim+10); $result = mysql_query($query) or die("Query out righe : " . mysql_error()); for ($q=1;$q<11;$q++) { $matrice[$q] = mysql_fetch_assoc($result); } for ($q=1;$q<11;$q++) { if ($matrice[$q] != NULL) { $q_autore = "SELECT * FROM gestori WHERE gestori.id =".$matrice[$q]["up_by"]; $r_autore = mysql_query($q_autore) or die("Query failed : " . mysql_error()); $temp = mysql_fetch_assoc($r_autore); if (strlen($temp["nome"]) < 12) { $who[$q] = $temp["nome"]." ".substr($temp["cognome"],0,1); } else { $who[$q] = $temp["nome"]; } } } /* echo "
";
print_r ($matrice);
echo "
"; */ $q_prev = $myself."?".$myquery."&pag=".($pag-1)."&cont=".$this_cont; $q_next = $myself."?".$myquery."&pag=".($pag+1)."&cont=".$this_cont; if ($mostra_up_by != 0) { $q_prev = $myself."?".$myquery."&pag=".($pag-1)."&cont=".$this_cont."&mostra_up_by=".$mostra_up_by; $q_next = $myself."?".$myquery."&pag=".($pag+1)."&cont=".$this_cont."&mostra_up_by=".$mostra_up_by; } ?> Immagini >
GALLERIA IMMAGINIIMAGES GALLERY
img    
0) { if ($pag > 1) echo '<<   '; if ($pag != $pagine) echo '>> '; else echo '      '; } else { echo " "; }?>   
  class="foto" >" target="zoom">" border="0">   class="foto" >" target="zoom">" border="0">   class="foto" >" target="zoom">" border="0">   class="foto" >" target="zoom">" border="0">   class="foto" >" target="zoom">" border="0">  
  class="didascalia" >
 
 
  class="didascalia" >
 
 
  class="didascalia" >
 
 
  class="didascalia" >
 
 
  class="didascalia" >
 
 
 
 
class="foto" >" target="zoom">" border="0"> class="foto" >" target="zoom">" border="0"> class="foto" >" target="zoom">" border="0"> class="foto" >" target="zoom">" border="0"> class="foto" >" target="zoom">" border="0">  
  class="didascalia" >
 
 
  class="didascalia" >
 
 
  class="didascalia" >
 
 
  class="didascalia" >
 
 
  class="didascalia" >
 
 
 
0) { echo "pag (".$pag."/".$pagine.") "; } else { ?> Non ho trovato nessun risultato
0) { if ($pag > 1) echo '<<    '; if ($pag != $pagine) echo '>>    '; else echo '         '; } else { echo " "; }?>