include("/home/dancabra/public_html/site3/config.php");
$id = $_GET[id];
$pgf = $_GET[pgf];
$Cor1 = "00427F";
$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($pgf,".")== TRUE){
$pgf = ceil($pgf);
$pgf = $pgf-1;
}
if (!$pgf==0){
$cont = $pgf * $qts_thumbs;
} else {
$cont = 0;
}
$handle = opendir($dir);
$ext = "jpg";
$indice = 0;
$ipp = $qts_thumbs;
while (false !== ($file = readdir($handle))){
$fotos = explode("_", $file);
//echo $fotos[0];
$pathdata = pathinfo($file);
if (!is_dir($file) && $file != '..' && $file !='.' && $file !='' && $file != 'Thumbs.db' && ($pathdata["extension"] == strtolower($ext)) || ($pathdata["extension"] == strtoupper($ext)) ){ // && $fotos[0] == "tb"){
$imagens[$indice] = $file;
$indice++;
}
}
sort($imagens);
reset($imagens);
$pagina = 1;
if ($pgf)
$pagina = $pgf;
$paginas = ceil(count($imagens) / $ipp);
$inicio = $pgf * $ipp;
//$thumb = "thumbs.php?w=52&h=52&imagem=";
$thumb = "thumbs52x52.php?w=52&h=52&imagem=";
for ($i=$inicio; $i<($inicio+$ipp); $i++)
if($imagens[$i] != ""){
$cont = $cont+1;
?> " hspace="2" vspace="2" border="0" style="FILTER: alpha(opacity=100)" onMouseOver="makevisible(this,0)" onMouseOut="makevisible(this,1)"> }?> |
|
$total = ceil(count($imagens));
//echo "Pgs: ";
for($i=0; $i<$paginas; $i++){
if (($i%5)==0) {
echo " ";
}
$url = "?id=$id&pgf=$i";
if ($i==$pgf) {
echo "".($i+1)." | ";
//echo "".($i+1)." ";
} else {
echo "".($i+1)." | ";
//echo "".($i+1)." ";
}
}
?>
|
|