Fix #153 You can now load sub files (custom pages created in layout folder) instead of the default Znote AAC files. (override system).

This commit is contained in:
Stefan Brannfjell
2014-09-03 00:59:12 +02:00
parent 89a775c23f
commit e0ad3aae09
4 changed files with 106 additions and 22 deletions

View File

@@ -1,19 +1,37 @@
<?php
switch ($_GET['page'])
{
case 'blank':
include 'layout/sub/blank.php';
break;
case 'houses':
include 'layout/sub/houses.php';
break;
case 'bomberman':
include 'layout/sub/bomberman.php';
break;
default:
echo '<h2>Sub page not recognized.</h2><p>The sub page you requested is not recognized.</p>';
}
/* 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
),
);
?>