load_noticias_novedades(1 , $idioma), ); break; case 'actualidad': $t=array( "body"=>load_noticias_novedades(2 , $idioma), ); break; default: $t=array( "body"=>ftemplate_v2("$plantilla$sigla_idioma.html"), ); break; } return ftemplate_v2("index$sigla_idioma.html",$t); } function screen_load_novedades() { global $db; $tipo_novedad=arg("tipo_novedad"); $idioma=arg("idioma"); return load_noticias_novedades($tipo_novedad , $idioma); } function load_noticias_novedades($tipo_novedad , $idioma) { global $db; if(!$idioma)$idioma="es"; $db->exec("SELECT * FROM novedades WHERE id_tipo_novedad=$tipo_novedad ORDER BY fecha DESC"); for($x=0;$x<$db->count() && $x<=5;$x++) { $reg=$db->rowAs(); if($reg["imagen"]) if(strpos ( $reg["imagen"] , 'pdf') || strpos ( $reg["imagen"] , 'doc') ) $foto="Download PDF"; else $foto=""; else $foto=""; $t=array( "id"=>$reg["id"], "titulo"=>$reg["titulo_$idioma"], "fecha"=>iso2es ($reg["fecha"]), "foto"=>$foto, "noticia"=>$reg["desc_corta_$idioma"], "ampliada"=>$reg["desc_larga_$idioma"], ); $list_novedades.=ftemplate_v2("noticia.html",$t); } switch($tipo_novedad) { case 1: if($idioma=="es") { $titnovnot="Nuestras Noticias"; } else { $titnovnot="News"; } break; case 2: if($idioma=="es") { $titnovnot="Actualidad"; } else { $titnovnot="Actuality"; } break; } $t2=array( "titnovnot"=>$titnovnot, "contenido-news"=>$list_novedades, ); return ftemplate_v2("noticias.html",$t2); } function ftemplate_v2($templ,$data="") { global $template_dir; $templ=str_replace(" ", "", $templ); $templ=str_replace("'", "", $templ); $filename1=$template_dir."/".$templ; if (file_exists($filename1)) return ftemplate($templ,$data); else { header('Location: index.php?jump=main'); exit; } } ?>