Listing du fichier off.php
00001 <?php
00002 /*
00003 OneFileFramework v1.06 - http://www.pmedia.no/off/
00004 Håvard Pedersen ( havard {at} flashmail.com ) 2007
00005 License: Use at own risk, use at own wims, use however you'd like.
00006 No rights reserved, implied or given. :)
00007 */
00008
00009 // Configuration starts here
00010 $cfg_defaultwireframe = 'index'; // Default wireframe to use for pages
00011 $cfg_defaultpage = 'index'; // Default page to load if none specified, this is your frontpage
00012 $cfg_error404 = 'index'; // View to serve on missing views or illegal pagenames
00013 $cfg_defaulttitle = 'OneFileFramework demosite'; // Site title
00014 $cfg_titleseparator = ' - '; // Default title separator. If not found, the default
00015 // pagetitle will not be merged with the page titles
00016 $cfg_pagetitles = array( // Array defining the pagetitle to use for each page.
00017 // If none found, the default is used.
00018 'demo1' => 'Demonstration 1',
00019 'error' => 'Error page'
00020 );
00021
00022 // --- Do NOT edit below this line unless you know what you are doing! ---
00023
00024 // Get selected pagename
00025 $p = $cfg_defaultpage;
00026 if (isset($_GET['p']))
00027 if (preg_match('|^[0-9a-zA-Z\/]*\z|',$_GET['p']))
00028 $p = $_GET['p'];
00029 else
00030 $p = $cfg_error404;
00031
00032 // Get pagetitle (this is a surprisingly large part of the code!)
00033 if (!isset($cfg_pagetitles[$p]))
00034 $t = $cfg_defaulttitle; // No pagetitle in array, use default
00035 else {
00036 if (!isset($cfg_titleseparator))
00037 $t = $cfg_pagetitles[$p]; // Pagetitle, but no separator, use pagetitle alone
00038 else
00039 $t = $cfg_defaulttitle . $cfg_titleseparator . $cfg_pagetitles[$p]; //Pagetitle and separator, use full title
00040 }
00041
00042 $w = $cfg_defaultwireframe; // Set default wireframe
00043
00044 // Import global.php if it exists
00045 if (is_file('global.php'))
00046 include 'global.php';
00047
00048 // Run controller if it exists
00049 if (is_file("controllers/$p.php"))
00050 include "controllers/$p.php";
00051
00052 // Run wireframe
00053 if (!is_file("views/$p.php"))
00054 $p = $cfg_error404;
00055 if (!is_file("wireframes/$w.php"))
00056 die("Missing wireframe");
00057 include "wireframes/$w.php";
00058 ?>
Pour ne pas voir les numéros de ligne, ajoutez &nl=non à la suite du nom du fichier.
Retour à la page principale de (gH)