Project

General

Profile

1 1373 Luisehahne
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         page
6
 * @author          WebsiteBaker Project
7 1696 Luisehahne
 * @copyright       2009-, WebsiteBaker Org. e.V.
8 1373 Luisehahne
 * @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$
13
 * @filesource		$HeadURL$
14
 * @lastmodified    $Date$
15
 *
16
 */
17
18
// Include config file
19
$config_file = dirname(__FILE__).'/config.php';
20 1782 Luisehahne
if(file_exists($config_file) && !defined('WB_URL'))
21 1373 Luisehahne
{
22
	require_once($config_file);
23
}
24
25
// Check if the config file has been set-up
26 1450 DarkViper
if(!defined('TABLE_PREFIX'))
27 1373 Luisehahne
{
28
/*
29 1450 DarkViper
 * 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 1373 Luisehahne
 */
33
	$host       = $_SERVER['HTTP_HOST'];
34 1383 FrankH
	$uri        = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
35 1373 Luisehahne
	$file       = 'install/index.php';
36
	$target_url = 'http://'.$host.$uri.'/'.$file;
37 1450 DarkViper
	$sResponse  = $_SERVER['SERVER_PROTOCOL'].' 307 Temporary Redirect';
38
	header($sResponse);
39 1373 Luisehahne
	header('Location: '.$target_url);
40
	exit;	// make sure that subsequent code will not be executed
41
}
42
43 1782 Luisehahne
//require_once(WB_PATH.'/framework/class.frontend.php');
44
45
if(!class_exists('frontend', false)){ include(WB_PATH.'/framework/class.frontend.php'); }
46
47 1373 Luisehahne
// Create new frontend object
48 1782 Luisehahne
if (!isset($wb)) {
49
    $wb = new frontend();
50
}
51 1373 Luisehahne
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 1696 Luisehahne
/**
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 1373 Luisehahne
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 1626 darkviper
// 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 1520 darkviper
		if(function_exists('executeFrontendOutputFilter')) {
87
			$output = executeFrontendOutputFilter($output);
88
		}
89
	}
90 1450 DarkViper
// now send complete page to the browser
91 1373 Luisehahne
echo $output;
92
// end of wb-script
93
exit;