Bueno, soy novato pero me hice algo que buscaba y no encontre ...
El tema viene a esta necesidad, yo queria algo que cuando veo el detalle de la imagen, si la imagen es muy grande y se va de mi pantalla que me la achique proporcionalmente de la original y que al cliquear me abra en un popup la original.
les muesto como quedaron mis archivos:
templates/nombre_de_template/media/jpg.html
lo deje asi:
<!-- Template file for JPG Files -->
<a class="big" href="javascript:pupUp('{media_src}','{width1}','{height1}');">
<img src="{media_src}" width="{width2}"; height="{height2}"></a><br />
asi viene original el : templates/nombretemplate/header.html
<script language="javascript" type="text/javascript">
<!--
function opendetailwindow() {
window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
}
function right(e) {
if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
alert("© Copyright by {site_name}");
return false;
}
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
alert("© Copyright by {site_name}");
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// -->
</script>
agregue la funcion de popup arriba de
function opendetailwindow() { y queda asi:
<script language="javascript" type="text/javascript">
<!--
function pupUp(the_page,the_width,the_height)
{
window.open(the_page,"","location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no,width=" + the_width + ",height=" + the_height);
}
function opendetailwindow() {
window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
}
function right(e) {
if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
alert("© Copyright by {site_name}");
return false;
}
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
alert("© Copyright by {site_name}");
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// -->
</script>
dentro de functions.php
buscar la linea que tiene
$width = $image_info[0];
$height = $image_info[1];
y agregar lo que esta abajo,
width1 y height1 es el valor que va a tener de tamaño el popup a abrir la imagen, le agregué 20pixels porque sino la imagen no se ve completa.
width2 y height2 es el tamaño que va a mostrar la imagen en detalle reducida(yo puse maximo 500px de ancho) ... ahi hagan la formula que les guste o pongan un valor fijo $width = $image_info[0];
$height = $image_info[1];
$width1 = $width+20;
$height1 = $height+20;
$width2 = (($width>500)?$width2=500:$width2=$width);
$height2 = (($height>340)?$height2=$height*500/$width:$height2=$height);
y en el mismo archivo un poco mas abajo
donde tiene esto:
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
dejarlo asi:
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
"width1" => $width1,
"height1" => $height1,
"width2" => $width2,
"height2" => $height2,
"iptc_info" => $iptc_info
));
Bueno me parece que nada mas, cualquier cosa consulten y que si puedo los ayudo con gusto