<?
$cantidad_notas = $cantidad_notas + 1;
include 'marco2des.php';
while ($i < $cantidad_notas){ 
include 'concha.php';
mysql_connect ("$host", "$usuario", "$contra");
mysql_select_db ("$basedatos");
$sql = "SELECT * FROM notas WHERE destacado = 'no' 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"];
$cat = $row["cat"];
$home = $row["home"];
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);
?>    


<?php if ($home == 'no') {} else {?>
<?php if ($cat == '0') {} else {?>
<div class="categoria">
<?php echo $cat ?>
</div>
<?php };?>
<div class="titulo">
<a href="<? echo $dom;?>/movil/nota.php?ID=<?php echo $ID ?>"> <?php echo $titulo ?></a></div>



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

<a href="<? echo $dom;?>/movil/nota.php?ID=<?php echo $ID ?>">  <img src="../<?php echo $carpetafoto ?>/thumbnail_<?php echo $foto ?>.jpg" alt="<?php echo $titulo ?>" border="0" width="370"   /></a>
<?php  }; ?>


<div class="bajada"><?php echo $bajada ?> - <?php echo $fecha ?></div>


<img  src="../linea.gif" /><br />


<?php };?>


<?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"];

?><br />

<?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"  alt="PUBLICIDAD"  width="370"  border="0" /><?php   if ($url == NULL) {} else { ?> </a><?php };?><br />

<img  src="../linea.gif" />

<?
}
mysql_free_result($consulta2);
?>


<?php 
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"];

?><br />

<?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 ?>"  alt="PUBLICIDAD"   border="0" /><?php   if ($url == NULL) {} else { ?> </a><?php };?><br />

<img  src="../linea.gif" />

<?
}
mysql_free_result($consulta2);
?>

<?php }
mysql_free_result($consulta);
?>
<?php 
$i= $i + 2;
}; 
?>

