FOTOS.PHP , que faz abrir as miniaturas
<? //include("../../config.php"); $id = $_GET[id]; $cidade = $_GET[cidade]; $sql = mysql_query("SELECT * FROM galeria where id='$id'"); $dados= mysql_fetch_array($sql); $dir = "../../images/eventos/$dados[id_franquia]/$dados[pasta]/"; if (strstr($pg,".")== TRUE){ $pg=ceil($pg); $pg=$pg-1; } if (!$pg==0) { $cont=$pg * $qts_thumbs; } else { $cont=0; } ?> <script language=JavaScript1.2> function makevisible(cur,which){ if (which==0) cur.filters.alpha.opacity=60 else cur.filters.alpha.opacity=100 } </SCRIPT> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" align="right" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="200" height="340" valign="top"><? $handle = opendir($dir); $ext = "jpg"; $indice = 0; $ipp = $qts_thumbs; while (false !== ($file = readdir($handle))) { $pathdata = pathinfo($file); if (!is_dir($file) && ($pathdata["extension"] == strtolower($ext)) || ($pathdata["extension"] == strtoupper($ext))) { $imagens[$indice] = $file; $indice++; } } natcasesort($imagens); reset($imagens); $pagina = 1; if ($_GET['pg']) $pagina = $_GET['pg']; $paginas = ceil(count($imagens) / $ipp); $inicio = $pg * $ipp; $thumb="thumbs.php?w=60&h=60&imagem="; for ($i=$inicio; $i<($inicio+$ipp); $i++) if($imagens[$i] != ""){ $cont=$cont+1; ?> <? $z = ""; while($z < "$paginas") { $z++; if($pg == $z){ $page = $ipp*$z+1; } } //echo $page; ?> <a href="zoom.php?id=<? echo $id?>&cidade=<? echo $cidade?>&page=<? echo "$cont";?>" target="exibe_fotos"><img src="<? echo "$thumb$dir$imagens[$i]"; ?>" hspace="1" vspace="2" border="0" style="border:1px solid #999999;FILTER: alpha(opacity=100)" onmouseover="makevisible(this,0)" onmouseout="makevisible(this,1)"></a> <!--<a href="java script:Muda('<? echo "thumbs.php?w=320&h=240&imagem=$dir$imagens[$i]"; ?>','<? echo "$cont";?>')"> <img src="<? echo "$thumb$dir$imagens[$i]"; ?>" hspace="1" vspace="2" border="0" style="border:1px solid #999999;FILTER: alpha(opacity=100)" onmouseover="makevisible(this,0)" onmouseout="makevisible(this,1)"></a>--> <? }?></td> </tr> </table></td> </tr> <tr><td height="5"></td></tr> <tr> <TD valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr valign="middle"> <td width="30%" height="20" align="left" valign="top"><font color="#000000"><strong> <? $total = ceil(count($imagens)); echo $total; ?> </strong> Fotos</font></td> <td width="70%" align="right" valign="top"><font color="#000000"> <strong> <? echo "Pgs: "; for($i=0; $i<$paginas; $i++){ $url = "?id=$id&cidade=$cidade&pg=$i"; if ($i==$pg) { echo "<font color='#666666'>".($i+1)."</font> "; } else { echo "<a href='$url'><font color='#000000'>".($i+1)."</font></a> "; } } ?> </strong> <? /* $url = "?id=$id&cidade=$cidade"; if ($pg > 0){ $pg = $pg-1; echo "<a href='$url&pg=$pg'>«</a>"; } for ($i=1;$i<$paginas;$i++){ if ($i-1 != $pg) { echo "<a href='$url&pg=$i'>"; } else { echo "<span style='background-color: #0066CC;color: #FFFFFF'> "; } echo "<b>$i</b> </span></a>"; } if ($pg < ($paginas-2)){ $pg = $pg+1; echo "<a href='$url&pg=$pg'>»</a>"; } */?> </font></td> </tr> </table> </td> </tr> </table>
zoom.PHP , que faz abrir as maiores ( que estao abrindo so a primeira)
<? include("../../config.php"); $id = $_GET[id]; $cidade = $_GET[cidade]; $sql = mysql_query("SELECT * FROM galeria where id='$id'"); $dados= mysql_fetch_array($sql); $dir = "../../images/eventos/$dados[id_franquia]/$dados[pasta]/"; ?> <script src="../../janelas_popup.js" language="JavaScript"></script> <? if(!isset($page) ){ $page=1; } $handle = opendir($dir); $ext = "jpg"; $indice = 2; $ipp = 1; while (false !== ($file = readdir($handle))) { $pathdata = pathinfo($file); if (!is_dir($file) && ($pathdata["extension"] == strtolower($ext)) || ($pathdata["extension"] == strtoupper($ext))) { $imagens[$indice] = $file; $indice++; } } natcasesort($imagens); reset($imagens); $pagina = 1; if ($_GET['page']) $pagina = $_GET['page']; $paginas = ceil(count($imagens) / $ipp); $total = ceil(count($imagens)); $inicio = $page * $ipp; for ($i = $inicio; $i < ($inicio + $ipp); $i++) if($dados[logo] == "S"){ $thumb="thumbs2.php?w=320&h=240&imagem="; } else { $thumb="thumbs.php?w=320&h=240&imagem="; } ?> <? $pg2 = ceil($paginas/$qts_thumbs); //echo "$paginas/$qts_thumbs=$pg2<br>"; /*if($page == "16"){ $var = "1"; //echo "<meta http-equiv=\"refresh\" content=\"0;URL=janela.php?id=$id&cidade=$cidade&pg=$var\">"; echo "<script> window.open('janela.php?id=$id&cidade=$cidade&pg=$var', '_top'); </script>"; } if($page < ($paginas-2)){ echo " <script> window.location = \"janela.php?id=$id&cidade=$cidade&pg=$var+1\"; return; </script> "; } */ //for ($i = $page; $i <= $page+14; $i++) { ?> <style type="text/css"> <!-- #Layer1 { position:absolute; width:30px; height:27px; z-index:1; left: 291px; top: 24px; } --> </style> <table width="322" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="67%">Evento: <b><? echo "$dados[nome]";?></b></td> <td width="33%" align="right">Data: <b><? $data = explode("-", $dados[data]); echo "$data[2]/$data[1]/$data[0]";?></b></td> </tr> </table> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="320" style="border:1px solid #999999;" height="242" align="center" valign="middle" background="images/img_carregando.gif"> <a href="java script:zoom('imagempop.php?imagem=<? echo "$thumb1$dir$imagens[$i]";?>');"><img src="<? echo "$thumb$dir$imagens[$i]";?>" border="0"></a></td> </tr></table> <br> <table width="100%" border="0" cellpadding="0" cellspacing="0"> </table> </td> </tr> </table>
QUALQUER AJUDA E BEM VINDA