Popup para thumbnail

No tiene autorización para enviar comentarios.

Una funcion para popup, donde se tiene que indicar la ruta a las carpetas que contienen las fotos.

===================================================

function usr_popup ($columns, $col, $param)
{
#{alias:img_upload......:f_u:usr_popup:h:100:h:500:_#TIT_PUBL:.thumb:_#RESU_PUB}

$parameters = split(":",$param);

list($func,$thumb_type_atr1, $thumb_val1, $popup_type_atr2, $popup_val2,$alt,$class,$leyenda) = $parameters;

$str2array = split("/",$columns[$col][0][value]);

$rutas = array ('/img_upload/74656d706c6174657771777771776e6d/', #biblioteca
'/img_upload/60f1b460b4602b602bb460b460b46a75/',#galeria de fotos
'/fotos/');#fotos importadas para portadas de libros de biblioteca
foreach ($rutas as $ruta){
$archivo = "../../..".$ruta.$str2array[count($str2array)-1]; #Subo tres niveles
if (file_exists($archivo)) {
$urlpath=$ruta.$str2array[count($str2array)-1];
$dimensiones = getimagesize($archivo);
$ancho=$dimensiones[0];
$alto=$dimensiones[1];
break;
}
}
if (is_file($archivo)){
$popup="";
}
else {
$popup="";
}

return $popup;
}

=======================

La funcion javascript es la siguiente

function popup(URL, P_WIDTH, P_HEIGHT, TEXTO) {
var preview=null;
window.focus();
W_WIDTH = P_WIDTH + 50;
W_HEIGHT = P_HEIGHT + 120;
if (screen.width > W_WIDTH)
X_POS = (screen.width-W_WIDTH)/2;
else {
X_POS = 0;
W_WIDTH = screen.width;
}
if (screen.height > W_HEIGHT)
Y_POS = (screen.height-W_HEIGHT)/2;
else {
Y_POS = 0;
W_HEIGHT = screen.height;
}
windowprops = "left=" + X_POS + ",top=" + Y_POS + ",width=" + W_WIDTH + ",height=" + W_HEIGHT + ",resizable=yes,scrollbars=yes";
text = "" + "Foto Ampliada" + "";
text += "";
text += "";
text += "" + TEXTO;
text += "";
preview = window.open("", "preview", windowprops);
if (preview.window.focus){preview.window.focus();}
preview.resizeTo(W_WIDTH,W_HEIGHT);
preview.moveTo(X_POS,Y_POS);
preview.document.open();
preview.document.write(text);
preview.document.close();
}