Jump to content


Photo

Erro Galeria De Fotos


  • Faça o login para participar
5 replies to this topic

#1 betodesign

betodesign

    Normal

  • Usuários
  • 85 posts
  • Sexo:Não informado

Posted 27/10/2008, 09:17

ola galera, depois que o server entrou em register global off, minha galeria parou de funcionar, o link é ESTE, abra a poup up e veja o q acontece, ele so abre maior a mesma foto sempre, abaixo vou jogar o codigo


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'>&laquo;</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'>&nbsp;";
			} 
			echo "<b>$i</b>&nbsp;</span></a>";
			}
			if ($pg < ($paginas-2)){
			$pg = $pg+1;
			echo "<a href='$url&pg=$pg'>&raquo;</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

#2 boirock

boirock

    Tecnologia para todos (agora hexa campeão)

  • Usuários
  • 1559 posts
  • Sexo:Masculino
  • Localidade:Curitiba - PR
  • Interesses:PostgreSQL - PHP

Posted 27/10/2008, 12:11

$GET["id"], com aspas ;)
Se não o PHP entenderá que você quer usar o valor de uma constante que, por sinal, nõa existe :D

#3 Alaerte

Alaerte

    Novato no fórum

  • Usuários
  • 11 posts
  • Sexo:Masculino
  • Localidade:Itabuna-BA
  • Interesses:Programação: PHP / MySQL / SQL Server/ HTML / CSS / JavaScript / XML / VB /

    Sistemas: Windows Server / Linux

Posted 27/10/2008, 13:18

Não tem nada haver com as aspas, tanto faz, mais o recomendado é com apóstrofos, sem ele a execução se torna 2 vezes mais lento do que com ele.

tente usar <?php ao invés de <?

coloque os delimitadores no final das variáveis. (;)

coloque os apóstrofos.
Refrigere minha alma, guia-me pelo caminho da justiça "Salmo 23 cap 3"
WebMaster/Designer - Desenvolvedor Web - TI
Alaerte Gabriel ou ガブリエル
Visitem >> http://www.webaplicacoes.com/

#4 betodesign

betodesign

    Normal

  • Usuários
  • 85 posts
  • Sexo:Não informado

Posted 28/10/2008, 10:36

coloquei isto q vcs me sugeriram, mas ate agora nada... o q pode ser alem disso?

#5 Rafinh@

Rafinh@

    Normal

  • Usuários
  • 65 posts
  • Sexo:Não informado

Posted 28/10/2008, 10:50

Cara tira uma duvida minha, como se feiz pra cadastrar mais de 1 album e dentro deles por vamos dizer 40 fotos ?

me da uma luz..
ByMuLlets

#6 JeffMalm

JeffMalm

    Super Veterano

  • Usuários
  • 12254 posts
  • Sexo:Feminino
  • Localidade:Mount Carey

Posted 13/02/2023, 14:28

You ll lie flat on your back stromectol scabies buy online
Since secondary infertility can be caused by a number of underlying conditions, you may experience a range of other symptoms depending on your specific diagnosis buy cialis online prescription Point of care ultrasound has become increasingly popular in the emergency department and ICU to help identify volume overload by looking for the equivalent of pulmonary venous congestion or B lines or by assessing the caliber of the inferior vena cava
zithromax antibiotics Ian zJlCPGMbKqBE 6 17 2022




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq