From 358f0b44507e7fda60bfda5e7b40c0e875b8bccf Mon Sep 17 00:00:00 2001 From: Wruczek <wruczekk@gmail.com> Date: Fri, 1 Jul 2016 03:12:20 +0200 Subject: [PATCH] Small improvements for news --- index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index d5ef228..404d558 100644 --- a/index.php +++ b/index.php @@ -16,7 +16,12 @@ require_once __DIR__ . "/lib/parsedown/parsedown.php"; $parsedown = new Parsedown(); -showNews(__DIR__ . "/" . $config["general"]["newsDir"]); +$path = __DIR__ . "/" . $config["general"]["newsDir"]; + +if(file_exists($path)) + showNews($path); +else + echo '<div class="alert alert-danger"><p class="text-center">Wystąpił błąd: folder z newsami nie został odnaleziony.</p><p class="text-center">Sprawdź, czy lokalizacja ustawiona w pliku <code>config/config.php</code> jest poprawna.</p></div>'; // ******* // METHODS