Several minor rewrites, getter GET_JACKPOT_POINTS() added
[mailer.git] / inc / header.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 08/25/2003 *
4  * ===============                              Last change: 11/24/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : header.php                                       *
8  * -------------------------------------------------------------------- *
9  * Short description : Outputs header HTML code, will not when frameset *
10  *           is active                                                  *
11  * -------------------------------------------------------------------- *
12  * Kurzbeschreibung  : Gibt nur dann HTML-Code fuer den Kopf-Bereich    *
13  *           aus, wenn Frameset nicht aktiv ist                         *
14  * -------------------------------------------------------------------- *
15  * $Revision::                                                        $ *
16  * $Date::                                                            $ *
17  * $Tag:: 0.2.1-FINAL                                                 $ *
18  * $Author::                                                          $ *
19  * Needs to be in all Files and every File needs "svn propset           *
20  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
21  * -------------------------------------------------------------------- *
22  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
23  * For more information visit: http://www.mxchange.org                  *
24  *                                                                      *
25  * This program is free software; you can redistribute it and/or modify *
26  * it under the terms of the GNU General Public License as published by *
27  * the Free Software Foundation; either version 2 of the License, or    *
28  * (at your option) any later version.                                  *
29  *                                                                      *
30  * This program is distributed in the hope that it will be useful,      *
31  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
32  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
33  * GNU General Public License for more details.                         *
34  *                                                                      *
35  * You should have received a copy of the GNU General Public License    *
36  * along with this program; if not, write to the Free Software          *
37  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
38  * MA  02110-1301  USA                                                  *
39  ************************************************************************/
40
41 // Some security stuff...
42 if (!defined('__SECURITY')) {
43         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
44         require($INC);
45 }
46
47 // Is the header already sent?
48 if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) {
49         // If not in CSS mode generate the header
50         if ((getOutputMode() != '1')) {
51                 // Generate header
52                 $TITLE = '';
53
54                 // Add title decorations? (left)
55                 if (!defined('__PAGE_TITLE')) {
56                         // Config and database connection valid?
57                         if ((isConfigLocalLoaded()) && (isConfigLoaded()) && (SQL_IS_LINK_UP())) {
58                                 // Title decoration enabled?
59                                 if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left'))." ";
60
61                                 // Do we have some extra title?
62                                 if (isExtraTitleSet()) {
63                                         // Then prepent it
64                                         $TITLE .= getExtraTitle() . ' by ';
65                                 } // END - if
66
67                                 // Add main title
68                                 $TITLE .= constant('MAIN_TITLE');
69
70                                 // Add title of module? (middle decoration will also be added!)
71                                 if ((getConfig('enable_mod_title') == 'Y') || ((!isWhatSet()) && (!isActionSet())) || (getModule() == 'admin')) {
72                                         $TITLE .= " ".trim(getConfig('title_middle'))." ".getModuleTitle(getModule());
73                                 } // END - if
74
75                                 // Add title from what file
76                                 $mode = '';
77                                 if (getModule() == 'login') $mode = 'member';
78                                 elseif (getModule() == 'index') $mode = 'guest';
79                                 if ((!empty($mode)) && (getConfig('enable_what_title') == 'Y')) $TITLE .= " ".trim(getConfig('title_middle'))." ".getModuleDescription($mode, getWhat());
80
81                                 // Add title decorations? (right)
82                                 if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_right') != '')) $TITLE .= " ".trim(getConfig('title_right'));
83
84                                 // Remember title in constant for the template
85                                 define('__PAGE_TITLE', $TITLE);
86                         } elseif ((isInstalled()) && (!isAdminRegistered())) {
87                                 // Installed but no admin registered
88                                 define('__PAGE_TITLE', sprintf(getMessage('SETUP_OF_MXCHANGE'), constant('MAIN_TITLE')));
89                         } elseif ((!isInstalled()) || (!isAdminRegistered())) {
90                                 // Installation mode
91                                 define('__PAGE_TITLE', getMessage('INSTALLATION_OF_MXCHANGE'));
92                         } else {
93                                 // Configuration not found!
94                                 define('__PAGE_TITLE', getMessage('NO_CONFIG_FOUND_TITLE'));
95
96                                 // Do not add the fatal message in installation mode
97                                 if (!isInstalling()) addFatalMessage(__FILE__, __LINE__, getMessage('NO_CONFIG_FOUND'));
98                         }
99                 } // END - if
100
101                 // Save some little memory
102                 unset($TITLE);
103
104                 // Output page header code
105                 LOAD_TEMPLATE('page_header');
106
107                 // Include meta data in 'guest' module
108                 if (getModule() == 'index') {
109                         // Load meta data template
110                         LOAD_TEMPLATE('metadata');
111
112                         // Add meta description to header
113                         if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP())) {
114                                 // Add meta description not in admin and login module and when the script is installed
115                                 generateMetaDescriptionCode(getModule(), getWhat());
116                         } // END - if
117                 } // END - if
118
119                 // Include more header data here
120                 LOAD_TEMPLATE('header');
121
122                 // Include stylesheet
123                 loadIncludeOnce('inc/stylesheet.php');
124         } // END - if
125
126         // Closing HEAD tag
127         if (getOutputMode() != '1') OUTPUT_HTML('</head>');
128         if ($GLOBALS['header_sent'] == 0) $GLOBALS['header_sent'] = 1;
129 } // END - if
130
131 // Add BODY tag or not?
132 if ((getOutputMode() != '1') && ($GLOBALS['header_sent'] == 1)) {
133         LOAD_TEMPLATE('page_body');
134         $GLOBALS['header_sent'] = 2;
135 } // END - if
136
137 //
138 ?>