From: Roland Häder Date: Sun, 8 Feb 2009 17:28:49 +0000 (+0000) Subject: Some internal TODOs fixed, rewrites to script inclusion X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=97eb53f4fdcc3f433dea23d09efde744d52a3740 Some internal TODOs fixed, rewrites to script inclusion --- diff --git a/birthday_confirm.php b/birthday_confirm.php index 6ec8545718..23c81d7c08 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -116,7 +116,7 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1", $GLOBALS['module'] = "birthday_confirm"; // Include header - include(PATH."inc/header.php"); + require(PATH."inc/header.php"); // Load birthday header template (for your banners, e.g.?) define('__BIRTHDAY_HEADER', LOAD_TEMPLATE("birthday_header", true)); @@ -128,7 +128,7 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1", LOAD_TEMPLATE("birthday_confirm"); // Include footer - include(PATH."inc/footer.php"); + require(PATH."inc/footer.php"); } else { // You have to install first! LOAD_URL("install.php"); diff --git a/css.php b/css.php index 1917cee822..368716c995 100644 --- a/css.php +++ b/css.php @@ -38,18 +38,25 @@ define('_OB_CACHING', "old"); require_once("inc/libs/security_functions.php"); // Init "action" and "what" -global $what, $action; -$GLOBALS['what'] = ""; $GLOBALS['action'] = ""; +global $what, $action, $footer; + +// Footer is disabled in CSS mode +$footer = "-1"; + +// Init variables +$GLOBALS['what'] = ""; +$GLOBALS['action'] = ""; // This is a CSS file loader! -$CSS = "1"; $GLOBALS['module'] = "css"; +$CSS = "1"; +$GLOBALS['module'] = "css"; + +// Set header +header("Content-type: text/css"); // Load the required file(s) require("inc/config.php"); -// Set header -@header("Content-type: text/css"); - // Load header require_once(PATH."inc/header.php"); diff --git a/doubler.php b/doubler.php index f328e4235a..3cf72bb08e 100644 --- a/doubler.php +++ b/doubler.php @@ -211,7 +211,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { if (getConfig('doubler_send_mode') == "DIRECT") require(PATH."inc/doubler_send.php"); // Output header - include(PATH."inc/header.php"); + require(PATH."inc/header.php"); // Banner in text define('__DOUBLER_BANNER', LOAD_TEMPLATE("doubler_banner", true)); @@ -272,7 +272,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { LOAD_TEMPLATE("doubler_index"); // Output footer - include(PATH."inc/footer.php"); + require(PATH."inc/footer.php"); } else { // You have to install first! LOAD_URL("install.php"); diff --git a/inc/databases.php b/inc/databases.php index 5001bc3f0d..d8735f6ec8 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -97,7 +97,7 @@ define('START_TDAY', MAKE_TIME(0, 0, 0, time())); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "718"); +define('CURR_SVN_REVISION', "719"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/extensions.php b/inc/extensions.php index a59e17b086..7be85ad111 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -281,6 +281,7 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) { // Get extension's name $ext_name = GET_EXT_NAME($ext_id); + // If it is not set then maybe there is no extension for that ID number if (empty($ext_name)) return false; // Load extension in detected mode diff --git a/inc/footer.php b/inc/footer.php index 9a7b05ffd9..84dcbd0eed 100644 --- a/inc/footer.php +++ b/inc/footer.php @@ -32,7 +32,7 @@ ************************************************************************/ // Global variable stuff -global $link, $frame, $CSS, $header; +global $link, $frame, $CSS, $header, $footer; // Some security stuff... if (!defined('__SECURITY')) { @@ -40,9 +40,7 @@ if (!defined('__SECURITY')) { require($INC); } // END - if -// @TODO Workaround for css.php -if (!isset($footer)) $footer = 0; - +// Footer disabled or already sent? if (($footer != "1") && ($footer != "2") && ($CSS != "1")) { // Output the generated HTML code or do nothing in direct-mode if (getTotalFatalMessages() > 0) { diff --git a/inc/functions.php b/inc/functions.php index de39d07278..4f55bb8a07 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -59,43 +59,6 @@ function IS_INC_WRITEABLE($inc) { } } -// Open a table (you may want to add some header stuff here) -// @DEPRECATED -function OPEN_TABLE ($PERCENT = "", $CLASS = "", $ALIGN="left", $VALIGN="", $td_only=false) { - global $table_cnt; - - // Count tables so we can generate CSS classes for every table... :-) - if (empty($CLASS)) { - // Class is empty so count one up and create a class - $table_cnt++; $CLASS = "class".$table_cnt; - } - $OUT = ""; - OUTPUT_HTML($OUT); -} - -// Close a table (you may want to add some footer stuff here) -// @DEPRECATED -function CLOSE_TABLE( $ADD="") { - OUTPUT_HTML(" \n"); - if (!empty($ADD)) OUTPUT_HTML($ADD); - OUTPUT_HTML("
"); -} - // Output HTML code directly or "render" it. You addionally switch the new-line character off function OUTPUT_HTML ($HTML, $NEW_LINE = true) { // Some global variables @@ -135,7 +98,7 @@ function OUTPUT_HTML ($HTML, $NEW_LINE = true) { default: // Huh, something goes wrong or maybe you have edited config.php ??? DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", OUTPUT_MODE)); - MXCHANGE_DIE("".FATAL_ERROR.": ".LANG_NO_RENDER_DIRECT); + mxchange_die("{!FATAL_ERROR!}: {!LANG_NO_RENDER_DIRECT!}"); break; } } elseif ((_OB_CACHING == "on") && ($footer == 1)) { @@ -987,9 +950,9 @@ function LOAD_URL($URL, $addUrlData=true) { header ("Location: ".str_replace("&", "&", $URL)); } else { // Output error message - include(PATH."inc/header.php"); + require(PATH."inc/header.php"); LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL)); - include(PATH."inc/footer.php"); + require(PATH."inc/footer.php"); } exit(); } @@ -2276,13 +2239,14 @@ function FIX_DELETED_COOKIES ($cookies) { // Output error messages in a fasioned way and die... function mxchange_die ($msg) { - global $footer; + // Load header + require_once(PATH."inc/header.php"); // Load the message template LOAD_TEMPLATE("admin_settings_saved", false, $msg); // Load footer - include(PATH."inc/footer.php"); + require(PATH."inc/footer.php"); // Exit explicitly exit; @@ -2901,7 +2865,7 @@ function getConfig ($entry) { return $value; } -// @TODO Rewrite all language constants to the function getLanguage(). +// @TODO Rewrite all language constants to this function. // "Getter" for language strings function getMessage ($messageId) { // Default is not found! diff --git a/inc/header.php b/inc/header.php index 40a3a80863..e262bfa16e 100644 --- a/inc/header.php +++ b/inc/header.php @@ -39,9 +39,9 @@ if (!defined('__SECURITY')) { require($INC); } -// Initialize variables -if (!isset($header)) $header = 0; +global $header; +// Is the header already sent? if (($header != "1") && ($header != "2")) { // If not in CSS mode generate the header if (($CSS != "1")) { diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index a5379614c2..c04dd24be7 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -37,8 +37,8 @@ if (!defined('__SECURITY')) { require($INC); } -// Generates a HTML table baded on given data -// @TODO Lame description! +// Generates a HTML table based on given data +// @TODO Lame description function DOUBLER_GENERATE_TABLE ($uid="0", $done='N', $ref='N', $sort="ASC") { global $_CONFIG; if (empty($cnt)) $cnt = 0; diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 1b8056b99e..f5774c69e5 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -103,32 +103,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S default: // Test if there is are time selections - $TEST = substr($k, -3); - if ((($TEST == "_ye") || ($TEST == "_mo") || ($TEST == "_we") || ($TEST == "_da") || ($TEST == "_ho") || ($TEST == "_mi") || ($TEST == "_se")) && (!empty($v))) { - // Found a multi-selection for timings? - $TEST = substr($k, 0, -3); - if ((!empty($POST[$TEST."_ye"])) && (!empty($POST[$TEST."_mo"])) && (!empty($POST[$TEST."_we"])) && (!empty($POST[$TEST."_da"])) && (!empty($POST[$TEST."_ho"])) && (!empty($POST[$TEST."_mi"])) && (!empty($POST[$TEST."_se"])) && ($TEST != $TEST2)) { - // Generate timestamp - $POST[$TEST] = CREATE_TIMESTAMP_FROM_SELECTIONS($TEST, $POST); - $DATA['keys'][] = $TEST; - $DATA['values'][] = $POST[$TEST]; - - // Remove data from array - // @TODO Do we still need this all? - unset($POST[$TEST."_ye"]); - unset($POST[$TEST."_mo"]); - unset($POST[$TEST."_we"]); - unset($POST[$TEST."_da"]); - unset($POST[$TEST."_ho"]); - unset($POST[$TEST."_mi"]); - unset($POST[$TEST."_se"]); - - // Skip adding - $k = ""; $skip = true; $TEST2 = $TEST; - } - } else { - $skip = false; $TEST2 = ""; - } + CONVERT_SELECTIONS_TO_TIMESTAMP($POST, $DATA, $k, $skip); break; } diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 38b9cc52c3..7592bbc554 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -365,7 +365,7 @@ function USER_DO_LOGIN ($uid, $passwd) { } } elseif ((($probe_nickname) && (!empty($uid2))) || ($uid2 == $uid)) { // Other account status? - // @TODO Can this query be saved??? + // @TODO Can this query be merged with above query? $result = SQL_QUERY_ESC("SELECT status FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__); diff --git a/inc/modules/admin/action- b/inc/modules/admin/action- index df0c9bf5a7..4991768fdd 100644 --- a/inc/modules/admin/action- +++ b/inc/modules/admin/action- @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-admins.php b/inc/modules/admin/action-admins.php index 37a2dbe46c..584cea7a8e 100644 --- a/inc/modules/admin/action-admins.php +++ b/inc/modules/admin/action-admins.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-bank.php b/inc/modules/admin/action-bank.php index cef20946e4..ff6fd6a254 100644 --- a/inc/modules/admin/action-bank.php +++ b/inc/modules/admin/action-bank.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-country.php b/inc/modules/admin/action-country.php index 6c50163bf8..6407fa2fce 100644 --- a/inc/modules/admin/action-country.php +++ b/inc/modules/admin/action-country.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-doubler.php b/inc/modules/admin/action-doubler.php index 85af60e460..c289625a17 100644 --- a/inc/modules/admin/action-doubler.php +++ b/inc/modules/admin/action-doubler.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { // "what file" not found addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); diff --git a/inc/modules/admin/action-email.php b/inc/modules/admin/action-email.php index e14a825f32..fa176d7b91 100644 --- a/inc/modules/admin/action-email.php +++ b/inc/modules/admin/action-email.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-holiday.php b/inc/modules/admin/action-holiday.php index 184d74005d..1085578127 100644 --- a/inc/modules/admin/action-holiday.php +++ b/inc/modules/admin/action-holiday.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-login.php b/inc/modules/admin/action-login.php index ff9a9ec376..9fad8a1079 100644 --- a/inc/modules/admin/action-login.php +++ b/inc/modules/admin/action-login.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-menu.php b/inc/modules/admin/action-menu.php index c327a28d3b..0377e5def5 100644 --- a/inc/modules/admin/action-menu.php +++ b/inc/modules/admin/action-menu.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-misc.php b/inc/modules/admin/action-misc.php index b4aa437f93..2f261a6382 100644 --- a/inc/modules/admin/action-misc.php +++ b/inc/modules/admin/action-misc.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-mods.php b/inc/modules/admin/action-mods.php index fe17518245..609fda6601 100644 --- a/inc/modules/admin/action-mods.php +++ b/inc/modules/admin/action-mods.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-newsletter.php b/inc/modules/admin/action-newsletter.php index 27a2b8b4f9..438d613c70 100644 --- a/inc/modules/admin/action-newsletter.php +++ b/inc/modules/admin/action-newsletter.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-payouts.php b/inc/modules/admin/action-payouts.php index 8431860fe7..b4b15bfb2f 100644 --- a/inc/modules/admin/action-payouts.php +++ b/inc/modules/admin/action-payouts.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-primera.php b/inc/modules/admin/action-primera.php index 7f4fa85b57..f2549d1421 100644 --- a/inc/modules/admin/action-primera.php +++ b/inc/modules/admin/action-primera.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-rallye.php b/inc/modules/admin/action-rallye.php index c1b230cd90..b6f3046ae6 100644 --- a/inc/modules/admin/action-rallye.php +++ b/inc/modules/admin/action-rallye.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-repair.php b/inc/modules/admin/action-repair.php index c6565fd0ed..0add6351e0 100644 --- a/inc/modules/admin/action-repair.php +++ b/inc/modules/admin/action-repair.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-setup.php b/inc/modules/admin/action-setup.php index 048bee24ef..560c878404 100644 --- a/inc/modules/admin/action-setup.php +++ b/inc/modules/admin/action-setup.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-sponsor.php b/inc/modules/admin/action-sponsor.php index f840cf94f4..fb1c52700d 100644 --- a/inc/modules/admin/action-sponsor.php +++ b/inc/modules/admin/action-sponsor.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-stats.php b/inc/modules/admin/action-stats.php index 6926bd2755..86ff0f2843 100644 --- a/inc/modules/admin/action-stats.php +++ b/inc/modules/admin/action-stats.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-surfbar.php b/inc/modules/admin/action-surfbar.php index da666b587a..ff29f1784c 100644 --- a/inc/modules/admin/action-surfbar.php +++ b/inc/modules/admin/action-surfbar.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-task.php b/inc/modules/admin/action-task.php index f143558e1f..06b0b88efe 100644 --- a/inc/modules/admin/action-task.php +++ b/inc/modules/admin/action-task.php @@ -47,7 +47,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-theme.php b/inc/modules/admin/action-theme.php index b832d39e2a..494674dd3c 100644 --- a/inc/modules/admin/action-theme.php +++ b/inc/modules/admin/action-theme.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-transfer.php b/inc/modules/admin/action-transfer.php index 08a6d3e150..5aaa6fdc5a 100644 --- a/inc/modules/admin/action-transfer.php +++ b/inc/modules/admin/action-transfer.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-user.php b/inc/modules/admin/action-user.php index 3971d4304d..b2a3e9e1ac 100644 --- a/inc/modules/admin/action-user.php +++ b/inc/modules/admin/action-user.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/action-wernis.php b/inc/modules/admin/action-wernis.php index c38971934b..46a97dfeef 100644 --- a/inc/modules/admin/action-wernis.php +++ b/inc/modules/admin/action-wernis.php @@ -44,7 +44,7 @@ ADD_DESCR("admin", __FILE__); $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } else { addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 95e56d6bd0..6ee8681097 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -352,7 +352,7 @@ LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__); $INC = sprintf("%sinc/modules/admin/action-%s.php", PATH, $act); if ((FILE_READABLE($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && (__ACL_ALLOW == true)) { // Ok, we finally load the admin action module - include($INC); + require($INC); } elseif (__ACL_ALLOW == false) { // Access denied LOAD_TEMPLATE("admin_menu_failed", false, ADMIN_ACCESS_DENIED); diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index a26c4d3059..aea6083994 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -75,7 +75,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) { } // END - if } else { // Test-drive extension in update mode - include(sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name)); + require(sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name)); // Update extension if extension is installed and outdated //* DEBUG: */ print "ext={$ext_name},ver={$EXT_VERSION}/".GET_EXT_VERSION($ext_name)."
\n"; diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php index c56245e4ee..96c03f3e72 100644 --- a/inc/modules/admin/what-theme_import.php +++ b/inc/modules/admin/what-theme_import.php @@ -54,7 +54,7 @@ if (!empty($_POST['theme'])) { $file = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])); if (FILE_READABLE($file)) { // Load the theme header file - include($file); + require($file); // Register it ith the exchange SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`) @@ -99,7 +99,7 @@ while ($dir = readdir($handle)) { // Test it... if (($dir != ".") && ($dir != "..") && (FILE_READABLE($theme))) { // Found a valid directory so let's load it's theme.php file - include($theme); + require($theme); // Add found theme to array $THEMES['theme_unix'][] = $dir; diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php index bcdddce43c..635deeee76 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -37,9 +37,8 @@ if (!defined('__SECURITY')) { require($INC); } -// @TODO Replace with own template! -OPEN_TABLE("500", "guest_login_header dashed", "center"); -OUTPUT_HTML("
".VALIDATING_LOGIN."
"); +// Initial message part +$MSG = "{!VALIDATING_LOGIN!}"; if (!empty($GLOBALS['userid']) && (isSessionVariableSet('u_hash'))) { // Login failtures are supported since 0.4.7 @@ -95,25 +94,25 @@ LIMIT 1", if (($bonus) && ($_GET['mode'] == "bonus") && (EXT_IS_ACTIVE("bonus"))) { // Output message with added points - OUTPUT_HTML(" - ".BONUS_LOGIN_BONUS_ADDED_1." - ".TRANSLATE_COMMA(getConfig('login_bonus'))." ".POINTS." - ".BONUS_LOGIN_BONUS_ADDED_2." -"); + $MSG .= "
+ {!BONUS_LOGIN_BONUS_ADDED_1!} + ".TRANSLATE_COMMA(getConfig('login_bonus'))." {!POINTS!} + {!BONUS_LOGIN_BONUS_ADDED_2!} +
"; } elseif (EXT_IS_ACTIVE("bonus")) { // No login bonus added! - OUTPUT_HTML("".BONUS_LOGIN_BONUS_NOT_ADDED.""); + $MSG .= "
{!BONUS_LOGIN_BONUS_NOT_ADDED!}
"; } // Redirect to member area - LOAD_TEMPLATE("member_login_js"); + $MSG .= LOAD_TEMPLATE("member_login_js", true); } else { // Login failed! - LOAD_TEMPLATE("login_failed_js"); + $MSG .= LOAD_TEMPLATE("login_failed_js", true); } -// Close table -CLOSE_TABLE(); +// Output final message +LOAD_TEMPLATE("admin_settings_saved", false, $MSG); // ?> diff --git a/inc/modules/guest/action- b/inc/modules/guest/action- index a1eb5eb9e4..064128799c 100644 --- a/inc/modules/guest/action- +++ b/inc/modules/guest/action- @@ -50,7 +50,7 @@ ADD_DESCR("guest", __FILE__); $INC = sprintf(PATH."inc/modules/guest/what-%s.php", $GLOBALS['what']); if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module - include($INC); + require($INC); } elseif ($IS_VALID) { addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { diff --git a/inc/modules/guest/action-admin.php b/inc/modules/guest/action-admin.php index 5d3416a663..39c8bbb899 100644 --- a/inc/modules/guest/action-admin.php +++ b/inc/modules/guest/action-admin.php @@ -44,7 +44,7 @@ if (!defined('__SECURITY')) { $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module - include($INC); + require($INC); } elseif ($IS_VALID) { addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { diff --git a/inc/modules/guest/action-members.php b/inc/modules/guest/action-members.php index c24c213ab9..214fadddc6 100644 --- a/inc/modules/guest/action-members.php +++ b/inc/modules/guest/action-members.php @@ -47,7 +47,7 @@ ADD_DESCR("guest", __FILE__); $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module - include($INC); + require($INC); } elseif ($IS_VALID) { addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { diff --git a/inc/modules/guest/action-sponsor.php b/inc/modules/guest/action-sponsor.php index 323eea8bf1..30b6a52309 100644 --- a/inc/modules/guest/action-sponsor.php +++ b/inc/modules/guest/action-sponsor.php @@ -49,7 +49,7 @@ ADD_DESCR("guest", __FILE__); $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module - include($INC); + require($INC); } elseif ($IS_VALID) { addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { diff --git a/inc/modules/member/action- b/inc/modules/member/action- index fdb3590d34..7fcb665657 100644 --- a/inc/modules/member/action- +++ b/inc/modules/member/action- @@ -52,7 +52,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-account.php b/inc/modules/member/action-account.php index 8f169ece40..538709a7cb 100644 --- a/inc/modules/member/action-account.php +++ b/inc/modules/member/action-account.php @@ -49,7 +49,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-bank.php b/inc/modules/member/action-bank.php index b3fd7f4e0c..b641a2cf45 100644 --- a/inc/modules/member/action-bank.php +++ b/inc/modules/member/action-bank.php @@ -52,7 +52,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-extras.php b/inc/modules/member/action-extras.php index 0badee216a..ffef8c9ffe 100644 --- a/inc/modules/member/action-extras.php +++ b/inc/modules/member/action-extras.php @@ -49,7 +49,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-logout.php b/inc/modules/member/action-logout.php index 74945d10ee..557c54c2bf 100644 --- a/inc/modules/member/action-logout.php +++ b/inc/modules/member/action-logout.php @@ -49,7 +49,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-main.php b/inc/modules/member/action-main.php index e280b75340..27bd965b3c 100644 --- a/inc/modules/member/action-main.php +++ b/inc/modules/member/action-main.php @@ -49,7 +49,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-order.php b/inc/modules/member/action-order.php index 6c327f2568..d8455dc7ad 100644 --- a/inc/modules/member/action-order.php +++ b/inc/modules/member/action-order.php @@ -52,7 +52,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-rals.php b/inc/modules/member/action-rals.php index b562617d6e..df0838f205 100644 --- a/inc/modules/member/action-rals.php +++ b/inc/modules/member/action-rals.php @@ -49,7 +49,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-stats.php b/inc/modules/member/action-stats.php index bd22b44803..284de3b7c3 100644 --- a/inc/modules/member/action-stats.php +++ b/inc/modules/member/action-stats.php @@ -49,7 +49,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/action-surfbar.php b/inc/modules/member/action-surfbar.php index 4cfdee5811..c2090cdf44 100644 --- a/inc/modules/member/action-surfbar.php +++ b/inc/modules/member/action-surfbar.php @@ -52,7 +52,7 @@ ADD_DESCR("member", __FILE__); $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC_WHAT)) { // Ok, we finally load the member action module - include_once($INC_WHAT); + require($INC_WHAT); } else { addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2); } diff --git a/inc/modules/member/what-themes.php b/inc/modules/member/what-themes.php index 0fbc6c94c6..7d027cb34c 100644 --- a/inc/modules/member/what-themes.php +++ b/inc/modules/member/what-themes.php @@ -78,7 +78,7 @@ while ($entry = readdir($handle)) { if (($entry != ".") && ($entry != "..") && (FILE_READABLE($theme)) && (THEME_IS_ACTIVE($entry))) { // Found a valid directory so let's load it's theme.php file - include($theme); + require($theme); // Add found theme to array $THEMES['theme_unix'][] = $entry; diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 2caef50a73..ef247614ed 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -70,9 +70,8 @@ function __errorHandler ($errno, $errstr, $errfile, $errline) { // Output message to user and die if (EXT_IS_ACTIVE("debug")) { - // Debug extension found! :-) - // @TODO Can this be rewritten to mxchange_die() ? - die("Error message written to debug.log. Please try to call the main page to continue."); + // Debug extension found! So Output a small message + mxchange_die("Error message written to debug.log. Please try to call the main page to continue."); } else { // No debug extension found // @TODO Find a way to rewrite debug_print_backtrace() so we can maybe @@ -128,6 +127,10 @@ $_CONFIG = array( 'last_update' => time() ); +// Init important $header variable +global $header; +$header = 0; + // Init fatal messages global $FATAL; $FATAL = array(); diff --git a/show_bonus.php b/show_bonus.php index 7ef2fa027e..06a0dd7139 100644 --- a/show_bonus.php +++ b/show_bonus.php @@ -55,7 +55,7 @@ if (!EXT_IS_ACTIVE("bonus")) { // List only rankings when script is installed if (isBooleanConstantAndTrue('mxchange_installed')) { // Include header - include(PATH."inc/header.php"); + require(PATH."inc/header.php"); if (($_GET['uid'] > 0) && ($_GET['d'] > 0) && (!empty($_GET['t']))) { // Set row name @@ -133,7 +133,7 @@ LIMIT 1", LOAD_TEMPLATE("show_bonus"); // Include footer - include(PATH."inc/footer.php"); + require(PATH."inc/footer.php"); } else { // You have to install first! LOAD_URL("install.php");