Foros del Web » Programando para Internet » PHP »

AYUDA - Galeria de imagenes

Estas en el tema de AYUDA - Galeria de imagenes en el foro de PHP en Foros del Web. Saludos ... Tengo una tareita q hacer y es la siguiente... en una de las paginas q he desarrollado cada producto tiene una galeria de ...
  #1 (permalink)  
Antiguo 15/04/2008, 08:34
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
AYUDA - Galeria de imagenes

Saludos ...
Tengo una tareita q hacer y es la siguiente... en una de las paginas q he desarrollado cada producto tiene una galeria de imagenes ahora bien... al dar click todas abren en ventana emergente y ahora debo hacer q esa ventana emergente me cargue la imagen a la q le di click y debajo los thumbails de el resto de las imagenes...
Como puedo hacer esto?? como puedo agregar para q tambien me cargue los thumbails y poder navegar con ellos???

Aqui les dejo mis codigos..

ficha_prod.php
Código PHP:
<?php require_once('Connections/incomed.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}
$colname_Recordset1 "-1";
if (isset(
$_GET['id'])) {
  
$colname_Recordset1 $_GET['id'];
}
mysql_select_db($database_incomed$incomed);
$query_Recordset1 sprintf("SELECT * FROM productos WHERE id = %s"GetSQLValueString($colname_Recordset1"int"));
$Recordset1 mysql_query($query_Recordset1$incomed) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?>
<html>
<head>
<title>..// I N C O M E D //..</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">td img {display: block;}body {
    background-image: url(images/fondofondo.jpg);
    margin-top: 20px;
}
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<link href="css/estilos.css" rel="stylesheet" type="text/css" />
</head>
<body bgcolor="#ffffff">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="interno3.png" fwpage="ficha prod" fwbase="ficha_prod.gif" fwstyle="Dreamweaver" fwdocid = "365333443" fwnested="0" -->
  <tr>
   <td width="9"><img src="spacer.gif" width="9" height="1" border="0" alt="" /></td>
   <td width="178"><img src="spacer.gif" width="177" height="1" border="0" alt="" /></td>
   <td width="8"><img src="spacer.gif" width="8" height="1" border="0" alt="" /></td>
   <td width="266"><img src="spacer.gif" width="265" height="1" border="0" alt="" /></td>
   <td width="22"><img src="spacer.gif" width="21" height="1" border="0" alt="" /></td>
   <td width="83"><img src="spacer.gif" width="80" height="1" border="0" alt="" /></td>
   <td width="3"><img src="spacer.gif" width="3" height="1" border="0" alt="" /></td>
   <td width="82"><img src="spacer.gif" width="79" height="1" border="0" alt="" /></td>
   <td width="3"><img src="spacer.gif" width="3" height="1" border="0" alt="" /></td>
   <td width="83"><img src="spacer.gif" width="80" height="1" border="0" alt="" /></td>
   <td width="13"><img src="spacer.gif" width="13" height="1" border="0" alt="" /></td>
   <td width="12"><img src="spacer.gif" width="12" height="1" border="0" alt="" /></td>
   <td><img src="spacer.gif" width="10" height="1" border="0" alt="" /></td>
   <td width="4"><img src="spacer.gif" width="1" height="1" border="0" alt="" /></td>
  </tr>

  <tr>
   <td rowspan="15" bgcolor="#FFFFFF">&nbsp;</td>
   <td colspan="11" rowspan="2" bgcolor="#FFFFFF"><img name="ficha_prod_r1_c3" src="images/banner.jpg" width="752" height="152" border="0" id="ficha_prod_r1_c3" alt="" /></td>
   <td width="12" rowspan="15" bgcolor="#FFFFFF">&nbsp;</td>
   <td><img src="spacer.gif" width="1" height="41" border="0" alt="" /></td>
  </tr>
  <tr>
   <td><img src="spacer.gif" width="1" height="111" border="0" alt="" /></td>
  </tr>
  <tr>
   <td height="6" colspan="11" bgcolor="#FFFFFF"></td>
   <td><img src="spacer.gif" width="1" height="6" border="0" alt="" /></td>
  </tr>
  <tr>
   <td rowspan="12" valign="top" bgcolor="#FFFFFF"><img name="ficha_prod_r4_c3" src="images/menu.jpg" width="177" height="208" border="0" id="ficha_prod_r4_c3" alt="" />
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
         <td height="8"></td>
       </tr>
     </table>
    <img name="ficha_prod_r9_c3" src="images/banner_prod.jpg" width="177" height="251" border="0" id="ficha_prod_r9_c3" alt="" /></td>
   <td rowspan="12" bgcolor="#FFFFFF">&nbsp;</td>
   <td colspan="9" bgcolor="#FFFFFF"><img name="ficha_prod_r4_c5" src="images/titulo_prod.jpg" width="565" height="56" border="0" id="ficha_prod_r4_c5" alt="" /></td>
   <td><img src="spacer.gif" width="1" height="56" border="0" alt="" /></td>
  </tr>
  <tr>
   <td height="6" colspan="9" bgcolor="#FFFFFF"></td>
   <td><img src="spacer.gif" width="1" height="6" border="0" alt="" /></td>
  </tr>
  <tr>
   <td height="17" colspan="9" bgcolor="#FFFFFF">&nbsp;</td>
   <td><img src="spacer.gif" width="1" height="17" border="0" alt="" /></td>
  </tr>
  <tr>
   <td width="266" rowspan="9" valign="top" bgcolor="#FFFFFF"><table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
     <tr>
       <td width="3%" class="tituloINDEX">&nbsp;</td>
       <td width="97%" class="tituloINDEX"><?php echo $row_Recordset1['titulo']; ?></td>
     </tr>
     <tr>
       <td colspan="2">&nbsp;</td>
     </tr>
     <tr>
       <td colspan="2" class="textoINDEX"><div align="justify"><?php echo nl2br ($row_Recordset1['comen']); ?></div></td>
     </tr>
   </table></td>
   <td colspan="8" rowspan="8" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td></td>
     </tr>
   </table>
    <script src="DWConfiguration/ActiveContent/IncludeFiles/AC_RunActiveContent.js" type="text/javascript"></script>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','300','height','237','src','flash/<?php echo $row_Recordset1['flash']; ?>','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/<?php echo $row_Recordset1['flash']; ?>' ); //end AC code
        </script>
          <noscript>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="300" height="237">
            <param name="movie" value="flash/<?php echo $row_Recordset1['flash']; ?>.swf" />
            <param name="quality" value="high" />
            <embed src="flash/<?php echo $row_Recordset1['flash']; ?>.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="282" height="226"></embed>
          </object>
          </noscript>
          </td>
      </tr>
      <tr>
        <td height="120" bgcolor="#D8D8CC"><table width="280" border="0" align="right" cellpadding="0" cellspacing="0" bgcolor="#D8D8CC">
          <tr>
            <td align="center" bgcolor="#D8D8CC"><?php         $producto_id=$row_Recordset1['id']; 
                                include(
'img_inc.php');
 
?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
   <td><img src="spacer.gif" width="1" height="129" border="0" alt="" /></td>
  </tr>
  <tr>
   <td height="8"><img src="spacer.gif" width="1" height="8" border="0" alt="" /></td>
  </tr>
  <tr>
   <td><img src="spacer.gif" width="1" height="80" border="0" alt="" /></td>
  </tr>
  
      <td height="108">&nbsp;</td>
 
  <tr>
   <td height="5"><img src="spacer.gif" width="1" height="53" border="0" alt="" /></td>
  </tr>
  <tr>
   <td height="3"><img src="spacer.gif" width="1" height="3" border="0" alt="" /></td>
  </tr>
  <tr>
    <td><img src="spacer.gif" width="1" height="53" border="0" alt="" /></td>
  </tr>
  <tr>
   <td><img src="spacer.gif" width="1" height="28" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="7" bgcolor="#FFFFFF">&nbsp;</td>
   <td bgcolor="#FFFFFF">&nbsp;</td>
   <td><img src="spacer.gif" width="1" height="85" border="0" alt="" /></td>
  </tr>
  <tr>
   <td height="9" colspan="13" bgcolor="#FFFFFF"></td>
   <td><img src="spacer.gif" width="1" height="9" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="13" valign="top"><p style="margin:0px"></p></td>
   <td><img src="spacer.gif" width="1" height="8" border="0" alt="" /></td>
  </tr>
  <tr>
   <td bgcolor="#FFFFFF">&nbsp;</td>
   <td colspan="11" bgcolor="#FFFFFF"><img name="ficha_prod_r17_c3" src="images/abajofon.jpg" width="741" height="40" border="0" id="ficha_prod_r17_c3" alt="" /></td>
   <td bgcolor="#FFFFFF">&nbsp;</td>
   <td><img src="spacer.gif" width="1" height="40" border="0" alt="" /></td>
  </tr>
</table>

</body>
</html>
<?php
mysql_free_result
($Recordset1);
?>
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...
  #2 (permalink)  
Antiguo 15/04/2008, 08:36
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Re: AYUDA - Galeria de imagenes

el include de las imagenes para dar click

img_inc.php
Código PHP:
<?php include('Connections/incomed.php');

// Variables de Configuración -----------------------------------
// Define el numero de Filas
$n_filas=3;

//***************************************************************
@$cat=$_REQUEST['id'];
//$cat=6;

$fotos = array();
        
$sql="SELECT  *  FROM imagenes where id_pro=".$producto_id."  ORDER BY id ASC";
mysql_select_db ('incomed');
    
$sql_exec=mysql_query($sql);
    function 
imagengrande() 

window.open("verimagen.php?imagen=/iamges2/<?=$imagen;?>""""width=450,height=300"); 
}
    
/*while($row=mysql_fetch_assoc($sql_exec)){
            $tottal=mysql_affected_rows(); // Calculo el numero total de itms a listar
            }*/
$tottal=113;
// ------------------------------------------------------------------------------------------------------------------
$vert=$tottal/$n_filas;
$vert=round($vert);

?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="100%" height="110"><table width="100%" height="110" border="0" align="center" cellpadding="0" cellspacing="0">
        
        <?php
        $a
=0;// Colocando el contador horizontal en 0
        
$i=1;// Colocando el contador vertical en 0
        
$w=0;//Colocando un contador para el mensaje de "No hay articulos en esta acategoria"
        
            
while($row=mysql_fetch_assoc($sql_exec)){
            
$w=w+1;
                if (
$a==0){
                echo 
'<tr>';
                }
                
$a=$a+1;
                
$fotos[$i.'-'.$a] = $row['img'];
                
                echo 
"<td height='80' width='53' border='0' ><a href=# onClick=\"window.open('verimagen.php?id=".$row['id']."; ','verimagen', 'width=450,height=300'); return false;\"><img src='images2/".$row['img']."' width='80' height='53' border='0'/></a>";
            
                
$r=$a;// contador remanente para listar imagenes sin exceso
                
                    
if ($a >= $n_filas) {
                    
$a=0;// reiniciando el contador horizontal
                    
$i=$i+1;// aumentando el contador vertical
                    
echo '</tr>';
                    } 
            if (empty(
$row)) {
        echo
"<table width='0' border='0' align='center' cellpadding='0' cellspacing='0'>
          <tr>
            <td width='257'><div align='center'>No hay articulos en esta categoria </div></td>
          </tr>
        </table>
        "
;
        break 
1;}
            
            }
            
         echo 
'</td>';
        
?>
        <?php /*if (empty($w)) {
        echo"<table width='0' border='0' align='center' cellpadding='0' cellspacing='0'>
          <tr>
            <td width='492'><div align='center'>No hay articulos en esta categoria </div></td>
          </tr>
        </table>
        ";
        exit;}
        */
?>
    </table></td>
  </tr>
</table>
y la ventana emergente
verimagen.php
Código PHP:
<?php require_once('Connections/incomed.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}
$colname_Recordset1 "-1";
if (isset(
$_GET['id'])) {
  
$colname_Recordset1 $_GET['id'];
}
mysql_select_db($database_incomed$incomed);
$query_Recordset1 sprintf("SELECT * FROM imagenes WHERE id = %s"GetSQLValueString($colname_Recordset1"int"));
$Recordset1 mysql_query($query_Recordset1$incomed) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style></head>


<img src="images2/<?php echo $row_Recordset1['img']; ?>" border="0" />
<?php
mysql_free_result
($Recordset1);
?>
Gracias
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...
  #3 (permalink)  
Antiguo 16/04/2008, 07:42
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Re: AYUDA - Galeria de imagenes

nadie sabe?????
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:26.