include("/home/dancabra/public_html/site3/config.php"); $id = $_GET[id]; $page = $_GET[page]; $Cor1 = "#00427F"; $Cor2 = "#000000"; $tabela1 = "galerias"; $sql = mysql_query("SELECT * FROM $tabela1 where id='$id'"); $dados= mysql_fetch_array($sql); $dir = "/home/dancabra/public_html/site3/images/$tabela1/$id/"; ?>
if (strstr($page,".")== TRUE){ $page = ceil($page); $page = $page-1; } if (!$page==0){ $cont = $page * 1; } else { $cont = 0; } $handle = opendir($dir); $ext = "jpg"; $indice = 0; $ipp = 1; //while (false !== ($file = readdir($handle))){ //$pathdata = pathinfo($file); //if (!is_dir($file) && ($pathdata["extension"] == strtolower($ext)) || ($pathdata["extension"] == strtoupper($ext))){ while ($file = readdir($handle)) { $fotos = explode("_", $file); //echo $fotos[0]; if($file != '..' && $file !='.' && $file !='' && $file != 'Thumbs.db' && $file != 'index.html'){ $imagens[$indice] = $file; $indice++; } } @sort($imagens); @reset($imagens); /* $pagina = 1; if ($page) $pagina = $page; $paginas = ceil(count($imagens) / $ipp); $total = ceil(count($imagens)); $inicio = $page * $ipp; for ($i=$inicio; $i<($inicio+$ipp); $i++) if($imagens[$i] != ""){ $cont = $cont+1; */ if($dados[logo] == "S"){ $thumb = "thumbs2.php?w=440&h=330&imagem="; } else { $thumb = "thumbs.php?w=440&h=330&imagem="; } $pagina = 1; if ($_GET['page']) $pagina = $_GET['page']; $paginas = ceil(count($imagens) / $ipp); $total = ceil(count($imagens)); //echo $total; $inicio = $page * $ipp; for ($i = $inicio; $i < ($inicio + $ipp); $i++) if($total > 0){ ?> $Foto_que_eh = "$dir$imagens[$i]"; $size = getimagesize("$Foto_que_eh"); $width = $size[0]; $height = $size[1]; //echo "Largura: $width - Altura: $height"; if($width > $height){ $PosicaoCanto1x = 0; $PosicaoCanto1y = 3; $PosicaoCanto2x = 432; $PosicaoCanto2y = 3; $PosicaoCanto3x = 0; $PosicaoCanto3y = 325; $PosicaoCanto4x = 432; $PosicaoCanto4y = 325; } else { $PosicaoCanto1x = 96; $PosicaoCanto1y = 3; $PosicaoCanto2x = 335; $PosicaoCanto2y = 3; $PosicaoCanto3x = 96; $PosicaoCanto3y = 325; $PosicaoCanto4x = 335; $PosicaoCanto4y = 325; } ?>nenhuma foto nesta cobertura |