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.
This commit is contained in:
Lee 2020-12-28 16:22:41 +00:00
parent 64fe0062ee
commit c8443228fb

View File

@ -328,6 +328,9 @@ if($load_it)
)) . $content; )) . $content;
} }
} else { } else {
$file = $template_path . '/pages/' . $page . '.php';
if(!@file_exists($file))
{
$file = SYSTEM . 'pages/' . $page . '.php'; $file = SYSTEM . 'pages/' . $page . '.php';
if(!@file_exists($file)) if(!@file_exists($file))
{ {
@ -335,6 +338,7 @@ if($load_it)
$file = SYSTEM . 'pages/404.php'; $file = SYSTEM . 'pages/404.php';
} }
} }
}
ob_start(); ob_start();
if($hooks->trigger(HOOK_BEFORE_PAGE)) { if($hooks->trigger(HOOK_BEFORE_PAGE)) {