eu acho que o erro deve esta aqui!
zoom.php
---------------------------------------------------------------------------------
<?include("../conexao.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="thumbs.php?w=400&h=310&imagem=";} else {$thumb="thumbs.php?w=400&h=310&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++) {?><table width="480" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="453" rowspan="2" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="70%">Evento: <b><? echo "$dados[nome]";?></b></td> <td width="30%" align="right"><div align="center">Data: <b> <? $data = explode("-", $dados[data]); echo "$data[2]/$data[1]/$data[0]";?> </b></div></td> </tr> </table> <table width="400" height="310" 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"><img src="<? echo "$thumb$dir$imagens[$i]";?>" border="0"></td> </tr></table> <br></td> <td width="47" valign="top"> </td> </tr> <tr> <td valign="top"><table width="40" border="0" align="center" cellpadding="0" cellspacing="3"> <tr> <td height="30"><div align="center"> <?if ($page > 1){ $pag=$page - 1; if($page > 0 && $page < 16){ $pg2 = "0"; } if($page >= 16 && $page < 31){ $pg2 = "1"; } if($page >= 31 && $page < 46){ $pg2 = "2"; } if($page >= 46 && $page < 61){ $pg2 = "3"; } if($page >= 61 && $page < 76){ $pg2 = "4"; } if($page >= 76 && $page < 91){ $pg2 = "5"; } if($page >= 91 && $page < 106){ $pg2 = "6"; } if($page >= 106 && $page < 121){ $pg2 = "7"; } if($page >= 121 && $page < 136){ $pg2 = "8"; } if($page >= 136 && $page < 151){ $pg2 = "9"; } if($page >= 151 && $page < 166){ $pg2 = "10"; } if($page >= 166 && $page < 181){ $pg2 = "11"; } if($page >= 181 && $page < 196){ $pg2 = "12"; } if($page >= 196 && $page < 211){ $pg2 = "13"; } if($page >= 211 && $page < 226){ $pg2 = "14"; } if($page >= 226 && $page < 241){ $pg2 = "15"; } if($page >= 241 && $page < 256){ $pg2 = "16"; } if($page >= 256 && $page < 271){ $pg2 = "17"; } if($page >= 271 && $page < 286){ $pg2 = "18"; } if($page >= 286 && $page < 301){ $pg2 = "19"; } if($page >= 301 && $page < 316){ $pg2 = "20"; } //echo $pg2; echo "<a href=?id=$id&page=" . ($pag) . "><img src=`images/bt_vo.gif` width=`53` height=`16` border=`0`></a>"; } else { echo "<img src=`images/bt_vo.gif` width=`53` height=`16`>"; } /* $div=$page/$qts_thumbs;for ($x=1;$x<99;$x++){ if ($div==$x){ $inter=0; break; }}if (isset($inter) AND $div * $qts_thumbs < $page){if ($div==1){ $div=0;} else { $div=$div-1;} echo "<script language=JavaScript> window.open('fotos.php?dir=$dir&page=".($div)."$var1', 'fotos'); </SCRIPT>";}*/?> </div></td> </tr> <tr height="30"> <td><a href="java script:indica('<? echo "indicacao.php?id=$id&cidade=$cidade&imagem=$imagens[$i]";?>');"><img src="images/bt_en.gif" width="53" height="16" border="0"></a></td> </tr> <tr> <td height="30"><a href="java script:Comprar('<? echo "../estrutura/pedidos/comprar_form.php?id=$id&cidade=$cidade&imagem=$imagens[$i]&page=$page";?>');"><img src="images/bt_co.gif" width="53" height="16" border="0"></a></td> </tr> <tr> <td height="30"><a href="java script:AddAlbum('<? echo "../estrutura/usuarios_vip/add_album_form.php?id=$id&imagem=$imagens[$i]";?>');"><img src="images/bt_ad.gif" width="53" height="16" border="0"></a></td> </tr> <tr> <td height="30"><? if($page<$total) { $pagp=$page+1; echo "<a href=?id=$id&cidade=$cidade&page=" . ($pagp) . "><img src=`images/bt_av.gif` width=`53` height=`16` border=`0`></a>";} else { echo "<img src=`images/bt_av.gif` width=`53` height=`16` border=`0`>";}?></td> </tr> </table></td> </tr></table>