function load_articles($files) { $articles = array(); foreach ($files as $file) { if (file_exists("news/" . $file)) { $articles[] = NewsArticle::from_file("news/" . $file); } } return $articles; }
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto"> <link rel="stylesheet" type="text/css" href="styles/common.css"> <?php include "includes/lib/newslib.php"; $article = NewsArticle::from_file("news/" . $_GET['a'] . ".xml"); ?> <title><?php echo $article->title; ?> - ND Faltos</title> </head> <body> <?php include "includes/header.php"; ?> <div class="main"> <br> <?php echo $article->get_image_tag(); ?> <h1 class="nospc"><?php echo $article->title; ?> </h1> <span class="small"><b><?php