forked from dignajar/nibbleblog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
52 lines (40 loc) · 1.56 KB
/
index.php
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
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* Last update: 21/08/2012
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
// ============================================================================
// BOOT
// ============================================================================
if( !file_exists('content/private') )
{
header('Location:install.php');
exit('<a href="./install.php">click to install Nibbleblog</a>');
}
require('admin/boot/blog.bit');
// ============================================================================
// THEME CONFIG
// ============================================================================
@require(THEME_ROOT.'config.bit');
// ============================================================================
// CONTROLLER & ACTION
// ============================================================================
$url = $_URL;
$layout = array('controller'=>'blog/view.bit', 'view'=>'blog/view.bit', 'template'=>'default.bit', 'title'=>'Blog powered by Nibbleblog');
if( ($url['controller']!=null) && ($url['action']!=null) )
{
$layout['controller'] = $url['controller'].'/'.$url['action'].'.bit';
$layout['view'] = $url['controller'].'/'.$url['action'].'.bit';
}
if(isset($theme['template'][$url['controller']]))
{
$layout['template'] = $theme['template'][$url['controller']];
}
// Load the controller and template
@require(THEME_CONTROLLERS.$layout['controller']);
@require(THEME_TEMPLATES.$layout['template']);
?>