-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
40 lines (33 loc) · 1.25 KB
/
index.php
File metadata and controls
40 lines (33 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/*
OneFileFramework v1.06 - http://www.pmedia.no/off/
Håvard Pedersen ( havard {at} flashmail.com ) 2007
License: Use at own risk, use at own wims, use however you'd like.
No rights reserved, implied or given. :)
*/
// Configuration starts here
$cfg_defaultwireframe = 'index'; // Default wireframe to use for pages
$cfg_defaultpage = 'index'; // Default page to load if none specified, this is your frontpage
$cfg_error404 = 'index'; // View to serve on missing views or illegal pagenames
$t = $cfg_defaulttitle = 'Editor'; // Site title
// --- Do NOT edit below this line unless you know what you are doing! ---
// Get selected pagename
$p = $cfg_defaultpage;
if (isset($_GET['p']))
if (preg_match('|^[0-9a-zA-Z\/]*\z|',$_GET['p']))
$p = $_GET['p'];
else
$p = $cfg_error404;
$w = $cfg_defaultwireframe; // Set default wireframe
// Import global.php if it exists
if (is_file('global.php'))
include 'global.php';
// Run controller if it exists
if (is_file("controllers/$p.php"))
include "controllers/$p.php";
// Run wireframe
if (!is_file("views/$p.php"))
$p = $cfg_error404;
if (!is_file("wireframes/$w.php"))
die("Missing wireframe");
include "wireframes/$w.php";