Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/08/2006, 21:14
Avatar de chalchis
chalchis
 
Fecha de Ingreso: julio-2003
Mensajes: 1.773
Antigüedad: 20 años, 9 meses
Puntos: 21
es muy extento pero pues aqui pongo

aqui pongo la parte para recorrer el directorio
<div id="contenedor">
<?php
/*
valor-------tipo de imagen
1 = GIF
2 = JPG
3 = PNG
4 = SWF
5 = PSD
6 = BMP
7 = TIFF(intel byte order)
8 = TIFF(motorola byte order)
9 = JPC
10 = JP2
11 = JPX
12 = JB2
13 = SWC
14 = IFF
15 = WBMP
16 = XBM
*/

//ruta del ImageMagick
$rutaconver="c:\ImageMagick-6.2.7-Q16\convert.exe -resample 96 -resize 120";
$rutaconver2="c:\ImageMagick-6.2.7-Q16\convert.exe";

//ruta de respaldo
$destino="../Tem_th/";

//definimos el nombre del script que genera los thumails
//$thumnail = 'prueba2.php';
$thumnail="prueba2.php";

//definimos el ancho de las imagenes
$width = 100;
$height = 100;
//tiempo
$tiempo=date("h:i:s");

//definimos el nombre del directorio en el que se encuentran las imágenes
$dir_principal=$destino;
$hay_direc=count($arbol);

//recorremos los directorios existentes
//for ($i=0;$i<$hay_direc;$i++)
//{

//$dir=opendir($arbol[$i]);
$dir=opendir($director_inicial);
if($dir)
{
//$path=$arbol[$i];
$path=$director_inicial;

$filedir="folder.png";
//echo '<div id="salto_linea">';
//echo '<IMG SRC="'.$thumnail.'?filename='.$dir_principal.$file dir.'&width='.$width.'&height='.$height.'" width="'.$width.'" height="'.$height.'" BORDER="1" HSPACE="8" VSPACE="8">';
//echo '<span>'.$path.'</span>';
//echo '</div>';
//echo '<br><span>'.$arbol[$i].'</span><br>';

//leemos el contenido del directorio
$hay=0;
$divnum=0;
$cade_image="thum";
//while ($file = readdir($dir))
while (false !== ($file = readdir($dir)))
{
//tipo de archivo
//$tipo=mime_content_type($path.$file);
//echo "tipo:".$tipo."<br>";
$validar=explode('/',$tipo);

list($im_an, $im_al, $ext, $atr)=getimagesize($path.$file);
//echo $file."---tipo de ext: ".$ext."---<br>";

//if(($file!='.')&&($file!='..')&&($validar[0]=='image'))
if(($file!='.')&&($file!='..'))
{
$divnum++;
if(eregi($ext,"6||7||8"))
{
$hay++;
$idimage=$hay.$cade_image;
//"tiff encontrado";
$origen=$path.$file;
$soloname=explode(".",$file);
$thum_temporal=$destino."temp_".$usuario."_".$solo name[0].".jpg";
$thum_temporal2=$destino."temp_2".$usuario."_".$so loname[0].".jpg";

system("$rutaconver $origen $thum_temporal");
system("$rutaconver2 $origen $thum_temporal2");

//$thumnail_vista="thum_vista.php";
echo "<div class=\"alineamientos_fotos\" id=\"$divnum\">\n";
//echo ("document.write('<script language=\"javascript\">');\n");
echo ("<script language=\"javascript\">\n");
//echo ("document.write('<div id=\"$divnum\">');\n");
echo ("document.write('<a href=\"$thumnail?filename=$thum_temporal2&width='+ winW+'&height='+winH+'\" rel=\"lightbox\" title=\"\">');\n");
echo ("document.write('<IMG SRC=\"$thumnail?filename=$thum_temporal&time=$tiem po&width=$width&height=$height\" WIDTH=\"$width\" HEIGHT=\"$height\" VSPACE=\"8\" class=\"thum\" onmouseover=\"this.className=\'thum_sobre\'\" onmouseout=\"this.className=\'thum_out\'\" id=\"$idimage\" >');\n");
echo ("document.write('</a>');\n");
echo ("document.write('<br>');\n");
//echo ("document.write('<span>');\n");
//echo ("document.write('<div id=\"seleccionador\">');\n");
echo ("document.write('<a href=\"captura.php?ruta_imagen=$thum_temporal&orig inal=$origen&idimagen=$divnum\" target=\"send\">');\n");
echo ("document.write('<IMG SRC=\"Images/marcar.gif\" width=\"22\" height=\"22\" border=\"0\" onClick=\"activoimage(\'$divnum\'),hideFrame(\'pre view\')\" >');\n");
echo ("document.write('</a>');\n");
//echo ("document.write('</div>');\n");
//echo ("document.write('</span>');\n");
echo ("</script>\n");
//echo ("document.write('</script>');\n");
echo '</div>';
}
else
{
if(eregi($ext,"1||2||3"))
{
$hay++;
$idimage=$hay.$cade_image;
//se imprime la visualizacion miniatura (thumnail) bien loka
//<a href="images/image-1.jpg" rel="lightbox[roadtrip]" title="Mi jardin"><img src="images/thumb-1.jpg" width="100" height="40" alt="mi jardin" />imagen #1</a>

$ru=$path.$file;
//$thumnail_vista="thum_vista.php";
echo "<div class=\"alineamientos_fotos\" id=\"$divnum\">\n";
//echo ("document.write('<script language=\"javascript\">');\n");
echo ("<script language=\"javascript\">\n");
//echo ("document.write('<div id=\"$divnum\">');\n");
echo ("document.write('<a href=\"$thumnail?filename=$ru&width='+winW+'&heigh t='+winH+'\" rel=\"lightbox\" title=\"imagen\">');\n");
echo ("document.write('<img src=\"$thumnail?filename=$ru&tiempo=$tiempo&width= $width&height=$height\" WIDTH=\"$width\" HEIGHT=\"$height\" VSPACE=\"8\" class=\"thum\" onmouseover=\"this.className=\'thum_sobre\'\" onmouseout=\"this.className=\'thum_out\'\" id=\"$idimage\" onClick=\"hideFrame(\'previewfull\')\" >');\n");
echo ("document.write('</a>');\n");
echo ("document.write('<br>');\n");
//echo ("document.write('<span>');\n");
//echo ("document.write('<div id=\"seleccionador\">');\n");
echo ("document.write('<a href=\"captura.php?ruta_imagen=$ru&original=$ru&id imagen=$divnum\" target=\"send\">');\n");
echo ("document.write('<IMG SRC=\"Images/marcar.gif\" width=\"22\" height=\"22\" border=\"0\" onClick=\"activoimage(\'$divnum\'),hideFrame(\'pre view\')\" >');\n");
echo ("document.write('</a>');\n");
//echo ("document.write('</div>');\n");
//echo ("document.write('</span>');\n");
echo ("</script>\n");
//echo ("document.write('</script>');\n");
echo '</div>';
}
}


}

}
//cerramos el directorio
closedir($dir);

if($hay==0)
{
echo "¡no se encontraron imagenes en este directorio!";
}

//}//del for
}
else
{
echo "Error: no se pudo abrir el directorio de imagenes.";
}
?>
</div>
</form>
__________________
gerardo