Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        Core
5
 * @package         Core_sys
6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-, WebsiteBaker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id: index.php 1848 2013-01-05 15:32:37Z darkviper $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/index.php $
14
 * @lastmodified    $Date: 2013-01-05 16:32:37 +0100 (Sat, 05 Jan 2013) $
15
 *
16
 */
17

    
18
// Include config file
19
$config_file = dirname(__FILE__).'/config.php';
20
if(file_exists($config_file) && !defined('WB_URL'))
21
{
22
	require_once($config_file);
23
}
24

    
25
// Check if the config file has been set-up
26
if(!defined('TABLE_PREFIX'))
27
{
28
/*
29
 * Remark:  HTTP/1.1 requires a qualified URI incl. the scheme, name
30
 * of the host and absolute path as the argument of location. Some, but
31
 * not all clients will accept relative URIs also.
32
 */
33
	$host       = $_SERVER['HTTP_HOST'];
34
	$uri        = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
35
	$file       = 'install/index.php';
36
	$target_url = 'http://'.$host.$uri.'/'.$file;
37
	$sResponse  = $_SERVER['SERVER_PROTOCOL'].' 307 Temporary Redirect';
38
	header($sResponse);
39
	header('Location: '.$target_url);
40
	exit;	// make sure that subsequent code will not be executed
41
}
42

    
43
//require_once(WB_PATH.'/framework/class.frontend.php');
44

    
45
if(!class_exists('frontend', false)){ include(WB_PATH.'/framework/class.frontend.php'); }
46

    
47
// Create new frontend object
48
if (!isset($wb) || !($wb instanceof frontend)) {
49
    $wb = new frontend();
50
}
51

    
52
// Figure out which page to display
53
// Stop processing if intro page was shown
54
$wb->page_select() or die();
55

    
56
// Collect info about the currently viewed page
57
// and check permissions
58
$wb->get_page_details();
59

    
60
// Collect general website settings
61
$wb->get_website_settings();
62

    
63
// Load functions available to templates, modules and code sections
64
// also, set some aliases for backward compatibility
65
require(WB_PATH.'/framework/frontend.functions.php');
66

    
67
// redirect menu-link
68
/**
69
 *
70
 * Removed the extra handling of menu links in index.php
71
 * Moved it to the view.php of module menu links.
72
 * Now the extra functionality of this module is seperated from the
73
 * core and you can uninstall it if you like.
74
 * Freeing the core from unnecessary code.
75
 *
76
 *
77
 */
78

    
79
ob_start();
80
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
81
$output = ob_get_contents();
82
if(ob_get_length() > 0) { ob_end_clean(); }
83
// execute frontend output filters
84
	if(file_exists(WB_PATH .'/modules/output_filter/index.php')) {
85
		include_once(WB_PATH .'/modules/output_filter/index.php');
86
		if(function_exists('executeFrontendOutputFilter')) {
87
			$output = executeFrontendOutputFilter($output);
88
		}
89
	}
90
// now send complete page to the browser
91
echo $output;
92
// end of wb-script
93
exit;
(4-4/5)