Fallback to default template if selected template missing from theme

This commit is contained in:
Skylar Ittner 2018-04-23 15:58:10 -06:00
parent aef29f18ab
commit 939fc983cc

View File

@ -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'])) {
?>