Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/05/2006, 07:51
cmc
 
Fecha de Ingreso: febrero-2003
Ubicación: Capital
Mensajes: 1.317
Antigüedad: 21 años, 3 meses
Puntos: 1
luego de mucho trabajo llege a esto, ya lo probe y funciona.
¿Alguien me podria decir si es una estructura adecuada o no? me refiero a si se puede optimiizar y de ser asi ¿de que forma?

Código PHP:
<?php require_once('../Connections/dbericatour.php'); 
$colname_rsd_productos "1";
if (isset(
$_GET['id'])) {
  
$colname_rsd_productos = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_dbericatour$dbericatour);
$query_rsd_productos sprintf("SELECT * FROM productos, admin_imag, mos_imagen WHERE productos. id_produc = %s and mos_imagen.id_producto = %s and mos_imagen.id_admin_imagen = admin_imag.id_imag"$colname_rsd_productos,$colname_rsd_productos);
$rsd_productos mysql_query($query_rsd_productos$dbericatour) or die(mysql_error());
$row_rsd_productos mysql_fetch_assoc($rsd_productos);
$totalRows_rsd_productos mysql_num_rows($rsd_productos);

$x=0;
$titulo="";
$foto="";
do { 
$titulo[]= $row_rsd_productos['titulo'];
$foto[]=$row_rsd_productos['nom_foto'];
$x++; 
}while(
$row_rsd_productos mysql_fetch_assoc($rsd_productos));
$cantidadcount($titulo);
if (
$cantidad >0){
$minuevotitulo=implode('","',$titulo); 
$minuevotitulo='"'.$minuevotitulo.'"';
$minuevafoto=implode('","',$foto); 
$minuevafoto='"'.$minuevafoto.'"';
}
$primer_foto=$_GET['id']."_".$minuevafoto[1].".jpg";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento sin t&iacute;tulo</title>
<script>
function precarga(){
var fotos=new Array(<?php echo $minuevafoto?>);
for(i=0;i<fotos.length;i++){
var directorio="f_grandes_mostrar/";
var numero= eval(<?php echo $_GET['id']; ?>);
eval("imagen"+i+"=new Image();");
eval("imagen"+i+".src=" + "\"" +directorio+"/"+numero+"_"+fotos[i]+"\";");
}
}

var indice=0;
function cambia(){
indice--;
var iden2;
if (document.layers) iden2 = eval(<?php echo count($minuevafoto); ?>);
if (document.all) iden2 = eval(<?php count($minuevafoto); ?>);
if (document.getElementById) iden2 = eval('document.getElementById("molde")');
var miarraytitulo=new Array(<?php echo $minuevotitulo?>);
var miarrayfoto=new Array(<?php echo $minuevafoto?>);
if (indice < 0) indice = miarraytitulo.length - 1;
var numero= eval(<?php echo $_GET['id']; ?>);
var directorio="f_grandes_mostrar/"+numero+"_";
iden2.src=directorio+miarrayfoto[indice]+".jpg";
document.form1.leyenda.value = (indice+1) + " de " + miarraytitulo.length;
document.form2.pie_foto.value = miarraytitulo[indice];
}

function cambia2(){
indice++;
var iden2;
if (document.layers) iden2 = eval(<?php echo count($minuevafoto); ?>);
if (document.all) iden2 = eval(<?php echo count($minuevafoto); ?>);
if (document.getElementById) iden2 = eval('document.getElementById("molde")');
var miarraytitulo=new Array(<?php echo $minuevotitulo?>);
var miarrayfoto=new Array(<?php echo $minuevafoto?>);
if (indice > miarraytitulo.length-1) indice = 0;
var numero= eval(<?php echo $_GET['id']; ?>);
var directorio="f_grandes_mostrar/"+numero+"_";
iden2.src=directorio+miarrayfoto[indice]+".jpg";
document.form1.leyenda.value = (indice+1) + " de " + miarraytitulo.length;
document.form2.pie_foto.value = miarraytitulo[indice];
}
</script>
</head>
<body>
<table width="350" border="0">
  <tr>
    <td><form name="form1">
      <table width="110%" height="20" align="center">
        <tr>
          <td width="20" height="20" align="center" valign="bottom"><a href="javascript:cambia()"><img src="img/flecha_foto_izq.jpg" width="15" height="15" border="0"></a></td>
          <td width="54" height="20" align="center" valign="bottom"><input name="leyenda" type="text" id="leyenda" style="border-with:thin;border-style:solid;border-color:#cccccc;background-color:#FFFFFF;text-align:center;font-size:10px;color:#333333;height:17px;font-family:Arial, Helvetica, sans-serif;" value="1 de <?php echo $cantidad?>" size="10"></td>
          <td width="20" height="20" align="center" valign="bottom"><a href="javascript:cambia2()"><img src="img/flecha_foto_der.jpg" width="15" height="15" border="0"></a></td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>
<p><img src="f_grandes_mostrar/<? echo $primer_foto ?>" class="foto" id="molde"></p>
<table width="350" border="0">
  <tr>
    <td><form name="form2" method="post" action="">
      <input name="pie_foto" type="text" id="pie_foto" size="100">
    </form></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result
($rsd_productos);
?>
Desde ya muchas gracias
__________________
Claudio Caldareri
diseñador Multimedial
www.disemedios.com.ar