lo que para es que tengo un codigo para hacer thumbnails, y si sirve y todo de eso no me keda ninguna duda el uniko problema es que cuando le doy click me manda en donde tengo guarda la imagen, asi como si le pusiera a cualkier imagen "view imagen" y pos eso no es lo ke kiero, lo ke kiero es que me habra la imagen en la una pagina que tengo disenada, asi como en hi5 que tiene sus imagenes y que si le das click en una te la habre pero en una pagina disenada, no no mas te muestra la foto y blanco. alguien sabe como hacer esto??
este es el codigo que tengo para los thumbnails
Código PHP:
<?php
function createThumbs( $pathToImages, $pathToThumbs, $thumbWidth )
{
$pathToImages = "img/";
$dir = opendir( $pathToImages );
while (false !== ($fname = readdir( $dir ))) {
$info = pathinfo($pathToImages . $fname);
if ( strtolower($info['extension']) == 'jpg' )
{
echo "Creating thumbnail for {$fname} <br />";
$img = imagecreatefromjpeg( "{$pathToImages}{$fname}" );
$width = imagesx( $img );
$height = imagesy( $img );
$new_width = $thumbWidth;
$new_height = floor( $height * ( $thumbWidth / $width ) );
$tmp_img = imagecreatetruecolor( $new_width, $new_height );
imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );
imagejpeg( $tmp_img, "{$pathToThumbs}{$fname}" );
}
}
closedir( $dir );
}
function createGallery( $pathToImages, $pathToThumbs )
{
echo "<html>";
echo "<head><title>Thumbnails</title></head>";
echo "<body>";
echo "<table cellspacing=\"0\" cellpadding=\"2\" width=\"500\">";
echo "<tr>";
$dir = opendir( $pathToThumbs );
$counter = 0;
while (false !== ($fname = readdir($dir)))
{
if ($fname != '.' && $fname != '..')
{
echo "<td valign=\"middle\" align=\"center\"><a href =\{$pathToImages}{$fname}\>";
echo "<img src=\"{$pathToThumbs}{$fname}\" border=\"0\" />";
echo "</a></td>";// aqui es donde kiero poner el javascript, en "href"
$counter += 1;
if ( $counter % 4 == 0 ) { $output .= "</tr><tr>"; }
}
}
closedir( $dir );
echo "</tr>";
echo "</table>";
echo "</body>";
echo "</html>";
}
createThumbs("img/","thumbs/",100);
createGallery("img/","thumbs/");
?>
este es el javascript que estoy tratando de usar
Código PHP:
<script>
function popup(){
window.open('mywindow','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes')
}
</script>
y este es el que trato de poner en href
Código PHP:
onClick=popup()
alguien me puede ayudar con este codigo?? desde ya gracias