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 1948 2013-08-04 11:39:49Z darkviper $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/index.php $
14
 * @lastmodified    $Date: 2013-08-04 13:39:49 +0200 (Sun, 04 Aug 2013) $
15
 *
16
 */
17

    
18
// compatibility between old and new access file format
19
if (isset($iPageId)) { $page_id = $iPageId; }
20
if (isset($page_id) && !isset($iPageId)) { $iPageId = $page_id; }
21
// Include config file
22
$config_file = dirname(__FILE__).'/config.php';
23
if(file_exists($config_file) && !defined('WB_URL'))
24
{
25
	require_once($config_file);
26
}
27

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

    
46
//require_once(WB_PATH.'/framework/class.frontend.php');
47

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

    
50
// Create new frontend object
51
if (!isset($wb) || !($wb instanceof frontend)) {
52
    $wb = new frontend();
53
}
54

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

    
59
// Collect info about the currently viewed page
60
// and check permissions
61
$wb->get_page_details();
62

    
63
// Collect general website settings
64
$wb->get_website_settings();
65

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

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

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