good day an new year.
excuse me my english.
i have folder in htdocs site main fotos
i have code for view image in grid, the file name is itemid.png. i shared code.
in event onrecord have view_imageitemid();
1.the var [glo_path_img] = name folder “/fotos/”
2. file image i use for image small and image large. uses property the file with and heigh
3. use 2 field {image} for large and use field {img_size } for viem small in grid.
$longitud1= strlen({ITEMID});
$variable={ITEMID};
$longitud=strlen($variable);
$itemid=trim({ITEMID});
$serverport=getenv(‘SERVER_PORT’);
$serverIP=getenv(‘SERVER_ADDR’);
IF ($serverport<>‘80’)
{
$path_url=‘HTTP://’.$serverIP.’:’.$serverport;
}
else
{
$path_url=‘HTTP://’.$serverIP;
//getenv(‘SERVER_ADDR’);
}
$nombre_fichero=[glo_path_img].$itemid.’.png’;
$validfile=getenv(‘DOCUMENT_ROOT’).$nombre_fichero;
/**
- Validar existencia del archivo antes de usarlo en la URL
*/
if (file_exists($validfile))
{
$nombre_fichero=$path_url.[glo_path_img].$itemid.'.png';
$result = @getimagesize($nombre_fichero);
list($width, $height, $tipo, $atributos) = @getimagesize($nombre_fichero);
if ($data = @getimagesize($nombre_fichero))
{
$width=(25*$width)/100;
$height=(25*$height)/100;
//echo $data[1];
{IMAGEN}="<img src='$nombre_fichero' border='0' width='$width' height='$height' >";
$width=(300*$width)/100;
$height=(300*$height)/100;
{IMG_SIZE}="<img src='$nombre_fichero' border='0' width='$width' height='$height' >";
}
}else
{
$path_url='HTTP://'.getenv('SERVER_ADDR').':'.getenv('SERVER_PORT');
$nombre_fichero=$path_url.[glo_path_img].'error'.'.png';
list($width, $height, $tipo, $atributos) = @getimagesize($nombre_fichero);
if ($data = @getimagesize($nombre_fichero))
{
$width=(25*$width)/100;
$height=(25*$height)/100;
{IMAGEN}="<img src='$nombre_fichero' border='0' width='$width' height='$height' >";
}
}