  <?

$hay = "NO"; 

include 'concha.php';

mysql_connect ("$host", "$usuario", "$contra");

mysql_select_db ("$basedatos");

$sql = "SELECT ID FROM notas WHERE destacado = 'si' AND ver = 'si'";

$consulta = mysql_query ($sql);

while ($row = mysql_fetch_array($consulta))

{

$hay = "SI";

}

mysql_free_result($consulta);

if ($hay == 'SI') {

while ($i < 9){ 

include 'concha.php';

mysql_connect ("$host", "$usuario", "$contra");

mysql_select_db ("$basedatos");

$sql = "SELECT ID,titulo,bajada,texto,audio,youtube,d,m,a,carpetafoto,foto,cat,home,impresiones,ext_img  FROM notas WHERE destacado = 'si' AND ver = 'si' ORDER BY ID desc LIMIT $i,1";

$consulta = mysql_query ($sql);

while ($row = mysql_fetch_array($consulta))

{

$i_publi = $i_publi + 1;

$ID = $row["ID"];

$youtube  = $row["youtube"];

$titulo = $row["titulo"];

$bajada = $row["bajada"];

$texto = $row["texto"];

$audio = $row["audio"];

$listengo  = $row["listengo"];

$d = $row["d"];

$m = $row["m"];

$a = $row["a"];

$fecha = "$d - $m - $a";

$carpetafoto = $row["carpetafoto"];

$foto = $row["foto"]; $ext_img = $row["ext_img"];

$cat = $row["cat"];

$impresiones = $row["impresiones"];
$impresiones = $impresiones + 1;
$sSQL="UPDATE  `$basedatos`.`notas` SET  `impresiones` =  '$impresiones' WHERE ID = '$ID'";
mysql_db_query("$basedatos",$sSQL);
if ($cat == 0) {} else {

$sql2 = "SELECT * FROM categorias WHERE ID = '$cat'";

$consulta2 = mysql_query ($sql2);

while ($row2 = mysql_fetch_array($consulta2))

{

$cat = $row2["nombre"];

$color_cat = $row2["color"];

}

mysql_free_result($consulta2);

}

?>

<?

$n = 0;

$sql2 = "SELECT * FROM comentarios WHERE IDD = '$ID' and ver = 'si'";

$consulta2 = mysql_query ($sql2);

while ($row2 = mysql_fetch_array($consulta2))

{

$n = $n + 1;

}

mysql_free_result($consulta2);

?>
<? $marco2px1 = "$marco2px"; ?>
<? $marco2px = "100%"; ?>
<table style="background-color:<?php echo $d_color_destacada?>;" width="<? echo $marco2px ?>" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="<?php echo $d_color_destacada?>">

<?php if ($cat == '0') {} else {?>

<tr>

<td colspan="2" class="Estilo29" height="1"><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td bgcolor="<?php if ($color_cat == '') { echo "#666666"; } else { echo $color_cat; }; ?>" class="Estilo4">&nbsp;<span style=";font-family:<?php echo $style_titulo ?>;font-size:11px; color:#FFFFFF;"><?php echo $cat ?></span>&nbsp;</td>
</tr>

</tr>

</table></td>

</tr><?php };?>

<tr>

<td colspan="2"><a href="<? echo $dom;?>/nota/<?php echo $ID ?>/<?php echo urls_amigables($titulo) ?>" class="tita"><span style=";font-family:<?php echo $style_titulo ?>;font-size:<?php echo $d_ta_titulo?>;color:<?php echo $d_color_titulo?>;"><?php echo $titulo ?></span></a><a href="<? echo $dom;?>/nota/<?php echo $ID ?>/<?php echo urls_amigables($titulo) ?>" class="tita"></a></td>

</tr>

<?php  if ($foto == NULL) { } else { ?>   <tr>

<td colspan="2" class="Estilo2">

<?php if ($url_cloud == '') {$dom1  = $dom;} else {$dom1 = "$url_cloud";}; ?>
<?php 

  $file = "$dom1/$carpetafoto/thumbnail_$foto$ext_img";  // Dirección de la imagen
 
  $imagen = getimagesize($file);    //Sacamos la información
  $ancho = $imagen[0];              //Ancho
  $alto = $imagen[1];               //Alto
 
 
 $alto_m = $alto * 1.05;
  $ancho_m = $ancho * 1.05;
 
  $alto_new2 = $alto * $marco2px1 / $ancho;
   
   
  $alto_new2 = round($alto_new2);
  
  
?>
<style>
 
.img-contenedor2 img {
    -webkit-transition:all .5s ease; /* Safari y Chrome */
    -moz-transition:all .5s ease; /* Firefox */
    -o-transition:all .5s ease; /* IE 9 */
    -ms-transition:all .5s ease; /* Opera */
    width:100%;
}

.img-contenedor2:hover img {
    -webkit-transform:scale(1.05);
    -moz-transform:scale(1.05);
    -ms-transform:scale(1.05);
    -o-transform:scale(1.05);
    transform:scale(1.05);
}

.img-contenedor2 {/*Ancho y altura son modificables al requerimiento de cada uno*/
    width:<?php echo $marco2px ?>;
    height:<?php echo $alto_new2 ?>px;
    overflow:hidden;
}
 </style>

<div class="img-contenedor2" style="height:<?php echo $alto_new2 ?>px;  width:<?php echo $marco2px ?>;">

<a href="<? echo $dom;?>/nota/<?php echo $ID ?>/<?php echo urls_amigables($titulo) ?>"> <img src="<?php if ($url_cloud == '') {echo $dom;} else {echo $url_cloud;}; ?>/<?php echo $carpetafoto ?>/thumbnail_<?php echo $foto ?><?php echo $ext_img ?>" alt="<?php echo $titulo ?>" width="<? echo $marco2px ?>"  border="0" /></a></div>



<?php 
$sql65 = "SELECT ID FROM fotos_notas WHERE noticia = '$ID' LIMIT 1";
$consulta65 = mysql_query ($sql65);
while ($row65 = mysql_fetch_array($consulta65))
{

?>
<div align="right"><a href="<? echo $dom;?>/nota/<?php echo $ID ?>/<?php echo urls_amigables($titulo) ?>"><img src="fotogaleria.png" width="140" /></a></div>
<?


 }
mysql_free_result($consulta65);

?>
</td>

</tr> <?php  }; ?>

<?php  if ($youtube == NULL) { } else { ?>   <tr>

<td colspan="2" class="Estilo2" align="center">
<iframe width="<? echo $marco2px ?>" height="300" src="https://www.youtube.com/embed/<?php echo $youtube ?>" frameborder="0" allowfullscreen></iframe>
</td>

</tr> <?php  }; ?>

<td colspan="2"><div align="justify" style="margin-top:7px;"><span style=";font-family:<?php echo $d_fu_texto ?>;font-size:<?php echo $d_ta_texto ?>;color:#6B6B6B;line-height:16px;"><?php echo $bajada ?></span> - <span class="Estilo4"><?php echo $fecha ?></span></div>

<?php include 'audio.php'; ?></td>

</tr>

<tr>

<td width="272"><div align="right"><span class="Estilo4"> 

<?php if ($n == 0) { ?>

<a href="<? echo $dom;?>/nota/<?php echo $ID ?>/<?php echo urls_amigables($titulo) ?>">Dejar un comentario<? if ($texto == NULL) {} else {?> - Leer m&aacute;s...<? }; ?></a> 

<?php } else {?>

<a href="<? echo $dom;?>/nota/<?php echo $ID ?>/<?php echo urls_amigables($titulo) ?>"> <?php echo $n ?> comentarios<? if ($texto == NULL) {} else {?> - Leer m&aacute;s...<? }; ?></a>

<?php };?>

</span></div></td>

<td width="53">



<?php include 'compartir_nota_facebook.php';?>





</td>

</tr>



<tr>

<td colspan="2" align="center"><img  src="linea.gif" /></td>

</tr>



<?php 

mysql_connect ("$host", "$usuario", "$contra");

mysql_select_db ("$basedatos");

$sql2 = "SELECT * FROM publicidades WHERE lugar = '$i_publi'";

$consulta2 = mysql_query ($sql2);

while ($row2 = mysql_fetch_array($consulta2))

{

$img = $row2["img"];

$url = $row2["url"];





$carpetafoto = $row2["carpetafoto"];



?>

<tr>

<td  colspan="2" align="center">

<?php   if ($url == NULL) {} else { ?><a href="<?php echo $url ?>"  target="_blank" class="Estilo1"><?php };?><img src="<?php echo $carpetafoto?>/resize_<?php echo $img ?>.jpg" width="<? echo $marco2px ?>"  border="0"  alt="PUBLICIDAD"/><?php   if ($url == NULL) {} else { ?> </a><?php };?>

</td>

</tr>



<tr>

<td colspan="2" align="center"><img  src="linea.gif" /></td>

</tr>

<?

}

mysql_free_result($consulta2);?>





<?php 

////////////GIF

mysql_connect ("$host", "$usuario", "$contra");

mysql_select_db ("$basedatos");

$sql2 = "SELECT * FROM publicidades_gif WHERE lugar = '$i_publi'";

$consulta2 = mysql_query ($sql2);

while ($row2 = mysql_fetch_array($consulta2))

{

$img = $row2["img"];

$url = $row2["url"];



$carpetafoto = $row2["carpetafoto"];



?>



<tr>

<td colspan="2" align="center">

<?php   if ($url == NULL) {} else { ?><a href="<?php echo $url ?>"  target="_blank" class="Estilo1"><?php };?><img src="<?php echo $dom ?>/<?php echo $carpetafoto?>/<?php echo $img ?>" width="<? echo $marco2px ?>" alt="PUBLICIDAD"   border="0" /><?php   if ($url == NULL) {} else { ?> </a><?php };?>

  </td>

</tr>

<tr>

<td colspan="2" align="center"><img  src="linea.gif" /></td>

</tr>

<?

}

mysql_free_result($consulta2);

//////////////////// FIN GIF

?>
<?php
////////////SLIDE
mysql_connect ("$host", "$usuario", "$contra");
mysql_select_db ("$basedatos");
$sql2 = "SELECT ID FROM publicidades_slide WHERE lugar = '$i_publi'";
$consulta2 = mysql_query ($sql2);
while ($row2 = mysql_fetch_array($consulta2))
{
$ID_p = $row2["ID"];

$width_slide = "$marco1px";  include 'publicidad_slider_virgen.php';

}
mysql_free_result($consulta2);
//////////////////// FIN SLIDE
?>







<?php     $tam_ancho = 300;

mysql_connect ("$host", "$usuario", "$contra");

mysql_select_db ("$basedatos");

$sql44 = "SELECT * FROM publicidades_swf WHERE lugar = $i_publi";

$consulta44 = mysql_query ($sql44);

while ($row44 = mysql_fetch_array($consulta44))

{

$ID = $row44["ID"];

$swf = $row44["swf"];

$carpetafoto = $row44["carpetafoto"];

$ancho = $row44["ancho"];

$alto = $row44["alto"];

$lugar = $row44["lugar"];

$tam_alto = $alto * $tam_ancho / $ancho;

?>

<tr>

<td colspan="2" align="center">

<object  width="<?php echo $tam_ancho ?>" height="<?php echo $tam_alto ?>">

<param name="src" value="<? echo $dom ?>/<? echo $carpetafoto ?>/<?php echo $swf ?>" />

<embed src="<? echo $dom ?>/<? echo $carpetafoto ?>/<?php echo $swf ?>" pluginspage="http://www.adobe.com/shockwave/download/" width="<?php echo $tam_ancho ?>" height="<?php echo $tam_alto ?>"></embed>

</object>

  </td>

</tr>

<tr>

<td colspan="2" align="center"><img  src="linea.gif" /></td>

</tr>

<?

}

mysql_free_result($consulta44);

?>  

</table>

<?php }

mysql_free_result($consulta);

?>

<?php 

$i= $i + 2;

}; 

$i = 1;

} else {};

?>

