diff --git a/engine/init.php b/engine/init.php index e405099..9861a2e 100644 --- a/engine/init.php +++ b/engine/init.php @@ -113,4 +113,31 @@ if ($config['log_ip']) { //var_dump($v_activity, $v_register, $v_highscore, $v_c_char, $v_s_char, $v_form); //echo ' <--- IP logging activity past 10 seconds.'; } + +// Sub page override system +if ($config['allowSubPages']) { + require_once 'layout/sub.php'; + $filename = explode('/', $_SERVER['PHP_SELF']); + $filename = $filename[count($filename)-1]; + if (isset($subpages) && !empty($subpages)) { + foreach ($subpages as $page) { + if ($page['override'] && $page['file'] === $filename) { + require_once 'layout/overall/header.php'; + require_once 'layout/sub/'.$page['file']; + require_once 'layout/overall/footer.php'; + exit; + } + } + } else { + ?> +
The layout is running an outdated sub system which is not compatible with this version of Znote AAC.
+The file /layout/sub.php is outdated.
+
Please update it to look like THIS.
+
The sub page you requested is not recognized.
'; -} +/* Znote AAC Sub System + - Used to create custom pages + - Place the contents of the page in /layout/sub/ folder. + : You don't need to include init, header or footer. + Its already taken care of, just write the contents you want. + + Then add that page to the configuration below. Config syntax: + 'PAGENAME' => array( + 'file' => 'fileName.php', + 'override' => false + ), + ................ + There are 2 ways to view your page, by using sub.php file, or by overriding an existing default page. + 1: yourwebiste.com/sub.php?page=PAGENAME + 2: By having override => true, then it will load your sub file instead of the default znote aac file. + +*/ + +$subpages = array( + // website.com/sub.php?page=blank + 'blank' => array( + // layout/sub/blank.php + 'file' => 'blank.php', + // false means don't run this file instead of the regular file at website.com/blank.php + 'override' => false + ), + 'houses' => array( + 'file' => 'houses.php', + 'override' => false + ), + 'downloads' => array( + 'file' => 'downloads.php', + 'override' => false + ), +); ?> \ No newline at end of file diff --git a/layout/sub/downloads.php b/layout/sub/downloads.php new file mode 100644 index 0000000..6884525 --- /dev/null +++ b/layout/sub/downloads.php @@ -0,0 +1,35 @@ +In order to play, you need an compatible IP changer and a Tibia client.
+ +Download otland IP changer HERE.
+Download Tibia client for windows HERE.
+Download Tibia client for linux HERE.
+ +The sub page you requested is not recognized.
'; + } +} else echo 'The sub page system is disabled.
'; - -include 'layout/overall/footer.php'; ?> \ No newline at end of file +require_once 'layout/overall/footer.php'; ?> \ No newline at end of file