<article style="margin-bottom:15px;">

    <div class="base-box2 col-lg-12 col-xs-6" style="text-align:center;padding:0;padding:0;">

<?




$sql3 = "SELECT * FROM publicidades 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"];

?><? /* 1 */ if ($domold != '') { $dom_bandera = $dom; $dom = $domold; }; ?>

   <?php   if ($url == NULL) {?> <a  id="imagensidebar"  data-lightbox="example-set" href="<? echo $dom;?>/<?php echo $carpetafoto1 ?>/resize_<?php echo $img ?>.jpg" >

   <? } else { ?><a id="imagensidebar" href="<?php
	$url = str_replace('https:', '',  $url);
	$url = str_replace('http:', '',  $url);
	echo $url; ?>" target="_blank"><?php };?>

  <img alt="PUBLICIDAD" class="img-fluid"  src="<? echo $dom;?>/<?php echo $carpetafoto1 ?>/resize_<?php echo $img ?>.jpg" /> <?php   if ($url == NULL) {?> </a>

  <?php } else { ?> </a> <?php };?>
 <?php }


$consulta3->free_result();

?>
<? /* 2 */ $dom = $dom_bandera; ?>
    </div>
    </article>
