<article style="margin-bottom:15px;">
    <div class="base-box2  col-lg-12 col-xs-6" style="text-align:center;padding:0;">
<?

$sql3 = "SELECT * FROM publicidades_gif WHERE ID = '$ID_publicidad'";
$consulta3 = $conn->query($sql3);
while ($row3 = $consulta3->fetch_assoc())
{
$ID = $row3["ID"];
$img = $row3["img"];
$url = $row3["url"];
$carpetafoto1 = $row3["carpetafoto"];

?>


   <?php   if ($url == NULL) {?> <a class="" data-lightbox="example-set" id="imagensidebar" href="<? echo $dom;?>/<?php echo $carpetafoto1 ?>/<?php echo $img ?>" >
   <? } else { ?> <a class="" id="imagensidebar" href="	<?php
	$url = str_replace('https:', '',  $url);
	$url = str_replace('http:', '',  $url);
	echo $url; ?>" target="_blank"><?php };?>
  <? $ext = substr($img, -3); if ($ext == 'mp4') { ?>
                                <div class="col-12 text-center">
                                  <video controls autoplay muted  loop style="width:100%">
                                    <source src="<?php echo $dom ?>/<?php echo $carpetafoto1 ?>/<?php echo $img ?>" type="video/mp4">
                                    Your browser does not support the video tag.
                                  </video>
                                </div>
  <? } else { ?>
  <img  class="img-fluid" src="<? echo $dom;?>/<?php echo $carpetafoto1 ?>/<?php echo $img ?>" /> <?php   if ($url == NULL) {?> </a> <?php } else { ?> </a> <?php };?>
<?php } ?>
   <?php }
$consulta3->free_result();
?>
<? /* 2 */ $dom = $dom_bandera; ?>
    </div>
</article>
