$sql="SELECT * from articulos where $tipo order by id desc";
$re= mysqli_query ($conexion,$sql) or die (mysqli_error());
$i=0;
while($r = mysqli_fetch_array($re)){
$i++;
$ruta_img= './imagenes' ;
$n=$r[id];
$tipo=$r[tipo];
$tit=$r[titular];
$tit=str_replace('Á', 'a', $tit);
$tit=str_replace('É', 'e', $tit);
$tit=str_replace('Í', 'i', $tit);
$tit=str_replace('Ó', 'o', $tit);
$tit=str_replace('Ú', 'u', $tit);
$tit=str_replace('_', '-', $tit);
$tit=str_replace(' ', '_', $tit);
$tit=str_replace('á', 'a', $tit);
$tit=str_replace('é', 'e', $tit);
$tit=str_replace('í', 'i', $tit);
$tit=str_replace('ó', 'o', $tit);
$tit=str_replace('ú', 'u', $tit);
$tit=str_replace('?', '', $tit);
$tit=str_replace('¿', '', $tit);
$tit=str_replace('¡', '', $tit);
$tit=str_replace('!', '', $tit);
$enl="./".$tipo."_".$tit."_".$n.".html";
if ($r[im1]<>''){
$img_=$r[im1];
$img_="$ruta_img/$n.$img_";
$imm=$enlace.$img_;
list($width2, $height2) = getimagesize("$imm");
$width= $width2 * 100;
$height= $height2 * 150;
if ($height2>'150') {
$tam="height='150'";
}
$img="
";
} else {
$img='';
}
$tx= str_split($r[tx1], 100);
$tx1=$tx[0];
if (strlen($tx[1])>0){$tx1.='...';}
$celda = "
";
$modulo=$i%3;
echo $celda;
}//while
?>
include("./pie.php");
include("./inc/_desconexion.php"); ?>