From 939fc983cc9c5ad6c06c1f4a23479c05c42d6e09 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Mon, 23 Apr 2018 15:58:10 -0600 Subject: [PATCH] Fallback to default template if selected template missing from theme --- public/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/index.php b/public/index.php index f3448d2..a37a69d 100644 --- a/public/index.php +++ b/public/index.php @@ -15,7 +15,11 @@ if (!getsiteid()) { $theme = $database->get("sites", "theme", ["siteid" => getsiteid()]); $template = getpagetemplate(); -include __DIR__ . "/themes/$theme/$template.php"; +if (file_exists(__DIR__ . "/themes/$theme/$template.php")) { + include __DIR__ . "/themes/$theme/$template.php"; +} else { + include __DIR__ . "/themes/$theme/default.php"; +} if (isset($_GET['edit'])) { ?>