From c8443228fbd2356217e691386791d92da2cdcd29 Mon Sep 17 00:00:00 2001 From: Lee <42119604+Leesneaks@users.noreply.github.com> Date: Mon, 28 Dec 2020 16:22:41 +0000 Subject: [PATCH] Allow template pages Checks if page exists in template directory and loads that page first instead of system/pages/ This allows users to make their own changes without modifying the original files for when doing updates. --- index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index b84a3ce8..56216169 100644 --- a/index.php +++ b/index.php @@ -328,11 +328,15 @@ if($load_it) )) . $content; } } else { - $file = SYSTEM . 'pages/' . $page . '.php'; + $file = $template_path . '/pages/' . $page . '.php'; if(!@file_exists($file)) { - $page = '404'; - $file = SYSTEM . 'pages/404.php'; + $file = SYSTEM . 'pages/' . $page . '.php'; + if(!@file_exists($file)) + { + $page = '404'; + $file = SYSTEM . 'pages/404.php'; + } } }