Código PHP:
<?php
include('config.php');
$query = 'SELECT * from noticias ORDER BY id DESC LIMIT 10';
$res=mysql_query($query);
$filas=mysql_num_rows($res);
$n=1;
echo '<h6>Noticias y Rumores ('.$filas.')</h6>';
while($registro = mysql_fetch_array($res)) {
if ($registro['trailer']!='') {$trailer='<img src="img/trailer.jpg" alt="trailer" width="16" height="16" /> ';} else {$trailer='';}
echo '
<div id="elemento'.$n.'" class="elemento">
<'.strtolower($registro['titulo']).'"><img src="img.php?ruta=admin/imagenes_noticias/'.$registro['imagen'].'&max=170" alt="'.$registro['titulo'].'" class="portada"/>
<h5>'.$trailer.$registro['titulo'].'</h5>
<p><strong>Noticia:</strong> '.$registro['noticia'].'</p>
<p><strong>Fecha:</strong> '.$registro['fecha'].'</p>
</div>';
}
?>