1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category frontend
|
5
|
* @package page
|
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 1696 2012-08-27 11:24:21Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/index.php $
|
14
|
* @lastmodified $Date: 2012-08-27 13:24:21 +0200 (Mon, 27 Aug 2012) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
// Include config file
|
19
|
$config_file = dirname(__FILE__).'/config.php';
|
20
|
if(file_exists($config_file))
|
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
|
// Create new frontend object
|
45
|
$wb = new frontend();
|
46
|
|
47
|
// Figure out which page to display
|
48
|
// Stop processing if intro page was shown
|
49
|
$wb->page_select() or die();
|
50
|
|
51
|
// Collect info about the currently viewed page
|
52
|
// and check permissions
|
53
|
$wb->get_page_details();
|
54
|
|
55
|
// Collect general website settings
|
56
|
$wb->get_website_settings();
|
57
|
|
58
|
// Load functions available to templates, modules and code sections
|
59
|
// also, set some aliases for backward compatibility
|
60
|
require(WB_PATH.'/framework/frontend.functions.php');
|
61
|
|
62
|
// redirect menu-link
|
63
|
/**
|
64
|
*
|
65
|
* Removed the extra handling of menu links in index.php
|
66
|
* Moved it to the view.php of module menu links.
|
67
|
* Now the extra functionality of this module is seperated from the
|
68
|
* core and you can uninstall it if you like.
|
69
|
* Freeing the core from unnecessary code.
|
70
|
*
|
71
|
*
|
72
|
*/
|
73
|
|
74
|
ob_start();
|
75
|
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
|
76
|
$output = ob_get_contents();
|
77
|
if(ob_get_length() > 0) { ob_end_clean(); }
|
78
|
// execute frontend output filters
|
79
|
if(file_exists(WB_PATH .'/modules/output_filter/index.php')) {
|
80
|
include_once(WB_PATH .'/modules/output_filter/index.php');
|
81
|
if(function_exists('executeFrontendOutputFilter')) {
|
82
|
$output = executeFrontendOutputFilter($output);
|
83
|
}
|
84
|
}
|
85
|
// now send complete page to the browser
|
86
|
echo $output;
|
87
|
// end of wb-script
|
88
|
exit;
|