Fallback to default template if selected template missing from theme

master
Skylar Ittner 6 years ago
parent aef29f18ab
commit 939fc983cc

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

Loading…
Cancel
Save