Viewing file: tapas.php (2.08 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
if(count($tapas_portada)>0){
echo '<div class="container">
<div class="row">
<!-- Set up your HTML -->
<div class="col-lg-12">
<div class="owl-carousel">
';
foreach($tapas_portada as $key=>$mf){
#id_foto, foto, epigrafe, vinculo, id_galeria, orden
$foto = $fotos_path.$mf['foto'];
$epigrafe = $mf['epigrafe'];
$vinculo = $mf['vinculo'];
if(is_file($foto)){
//resolvemos relacion --------------------
/*list($ancho, $alto, $tipo, $atributos) = getimagesize ($foto);
$width = 250; //260
$height = 350;
$relacion_requerida = $width/$height; // 1,56
$relacion_real = $ancho/$alto; // ej. un poco ancho respecto al alto 638/360 = 1,72 ; ej. un poco alto respecto al ancho 960/640 = 1,5
if($relacion_real > $relacion_requerida){ // quedaría más ancho que alto, recorto el ancho
$img = '<a data-toggle="lightbox2" target="_blank" href="'.$foto.'"><img class="img-responsive" style="height:'.$height.'; text-align: center;
display: block; margin: 0 auto;" src="'.$foto.'"></a>';
}else{ //quedaría mas alto que ancho
$img = '<a data-toggle="lightbox2" target="_blank" href="'.$foto.'"><img class="img-responsive" style="width:'.$width.'px; text-align: center;
display: block; margin: 0 auto;" src="'.$foto.'"></a>';
} */
//----------------------------------------
echo '
<div class="item">
<a data-toggle="lightbox2" href="'.$foto.'"><img class="img-responsive" src="'.$foto.'"></a>
</div>
';
}
}
echo ' </div>
</div>
</div>
</div>';
}
?>
|