Two tickets resolved (57/89)
[mailer.git] / inc / modules / index.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 09/23/2003 *
4  * ===============                              Last change: 03/27/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : index.php                                        *
8  * -------------------------------------------------------------------- *
9  * Short description : Entrance page                                    *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Eingangsseite                                    *
12  * -------------------------------------------------------------------- *
13  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
18  * This program is free software; you can redistribute it and/or modify *
19  * it under the terms of the GNU General Public License as published by *
20  * the Free Software Foundation; either version 2 of the License, or    *
21  * (at your option) any later version.                                  *
22  *                                                                      *
23  * This program is distributed in the hope that it will be useful,      *
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
26  * GNU General Public License for more details.                         *
27  *                                                                      *
28  * You should have received a copy of the GNU General Public License    *
29  * along with this program; if not, write to the Free Software          *
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
37         require($INC);
38 } elseif (!EXT_IS_ACTIVE("sql_patches")) {
39         // The extension "sql_patches" *MUST* be activated or you have lot's of problems!
40         LOAD_URL("admin.php");
41 }
42
43 // Load adverstising template
44 define('__GUEST_ADVERT', LOAD_TEMPLATE("guest_advert", true));
45
46 // Generate a tableset for the menu title and content
47 LOAD_TEMPLATE("guest_header");
48
49 // Add message here
50 if (!empty($_GET['msg'])) {
51         // Default extension is "unknown"
52         $ext = "unknown";
53
54         // Is extension given?
55         if (!empty($_GET['ext'])) $ext = SQL_ESCAPE($_GET['ext']);
56
57         // Which message shall we output?
58         $msg = convertCodeToMessage($_GET['msg']);
59
60         // Load message template
61         LOAD_TEMPLATE("message", false, $msg);
62 } // END - if
63
64 // Some of you needs this to be extracted into a template... ???
65 LOAD_TEMPLATE("guest_menu_td");
66
67 // When no what value is provided take the "home" value
68 if (empty($GLOBALS['what'])) $GLOBALS['what'] = getConfig('index_home');
69
70 // Adding the main content module here
71 if (empty($GLOBALS['action'])) {
72         // Get action value from what value
73         $GLOBALS['action'] = GET_ACTION("guest", $GLOBALS['what']);
74 } // END - if
75
76 // Add the guest's menu here...
77 if ((getConfig('guest_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
78         // Show only when guest menu is active
79         ADD_MENU("guest", $GLOBALS['action'], $GLOBALS['what']);
80 } // END - if
81
82 // TDs between menu and content
83 LOAD_TEMPLATE("guest_menu_content");
84
85 // Disable block-mode by default
86 $BLOCK_MODE = false;
87
88 // Construct FQFN
89 $INC = sprintf("inc/modules/guest/action-%s.php", $GLOBALS['action']);
90
91 // Is the file there?
92 if ((FILE_READABLE($INC)) && (VALIDATE_MENU_ACTION("guest", $GLOBALS['action'], $GLOBALS['what']))) {
93         // Requested module is available so we load it
94         LOAD_INC_ONCE($INC);
95 } else {
96         // Invalid module specified or not found...
97         LOAD_URL("modules.php?module=index");
98 }
99
100 if ((getConfig('guest_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
101         // Right side of content (hint: a good place for 120x600 skyscraper banner!)
102         LOAD_TEMPLATE("guest_content_footer");
103
104         // Some advertising stuff?
105         LOAD_TEMPLATE("guest_advert2");
106
107         OUTPUT_HTML("  </td>
108 </tr>");
109
110         // Goto TOP template
111         LOAD_TEMPLATE("guest_goto_top");
112 } // END - if
113
114 // Footer template (Thanx to Mr. Glaus!)
115 LOAD_TEMPLATE("guest_footer");
116
117 //
118 ?>