Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / modules / sponsor.php
index f0450923b3cb35dfa888657046450c79efdaba3a..108f1847a9f7d79d4d6c0406b5416bfacb8ca8f3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 04/02/2005 *
- * ===============                              Last change: 05/19/2008 *
+ * Mailer v0.2.1-FINAL                                Start: 04/02/2005 *
+ * ===================                          Last change: 05/19/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : sponsor.php                                      *
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Sponsorenbereich                                 *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software. You can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
-       require($INC);
-} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       exit();
+} elseif ((!isExtensionActive('sponsor'))) {
+       displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=sponsor%}');
        return;
-} elseif (!IS_SPONSOR()) {
+} elseif (!isSponsor()) {
        // No sponsor!
-       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
+       addFatalMessage(__FILE__, __LINE__, '{--SPONSOR_ONLY_AREA_ENTERED--}');
        return;
-} elseif (empty($GLOBALS['what'])) {
+} elseif ((!isWhatSet()) || (getWhat() == '')) {
        // Empty what value detected!
-       $GLOBALS['what'] = "welcome";
+       reportBug(__FUNCTION__, __LINE__, 'what is empty.');
 }
 
 // A valid sponsor login and we are allowed to enter this module so let's
 // update his cookies and online time
-UPDATE_SPONSOR_LOGIN();
+updateSponsorLogin();
 
 // Generate menu
-define('__SPONSOR_MENU', GENERATE_SPONSOR_MENU($GLOBALS['what']));
+$content['menu'] = addSponsorMenu(getWhat());
 
 // Generate right-side output
-define('__SPONSOR_CONTENT', GENERATE_SPONSOR_CONTENT($GLOBALS['what']));
+$content['content'] = addSponsorContent(getWhat());
 
 // Load header template
-define('__SPONSOR_HEADER', LOAD_TEMPLATE("sponsor_header", true));
+$content['header'] = loadTemplate('sponsor_header', true);
 
 // Load footer template
-define('__SPONSOR_FOOTER', LOAD_TEMPLATE("sponsor_footer", true));
+$content['footer'] = loadTemplate('sponsor_footer', true);
 
-// "You are here" navigation
-define('__SPONSOR_YOURE_HERE', ADD_DESCR("sponsor", $GLOBALS['what'], false, false));
+// 'You are here' navigation
+$content['you_are_here'] = addYouAreHereLink('sponsor', getWhat(), true);
 
 // Load main sponsor template
-LOAD_TEMPLATE("sponsor_main");
+loadTemplate('sponsor_main', false, $content);
 
-//
+// [EOF]
 ?>