From: Roland Häder Date: Sun, 3 Feb 2008 13:06:35 +0000 (+0000) Subject: more fixes for missing extensions X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8e1498142233eff66b72904ad0428876eee1ce15;p=mailer.git more fixes for missing extensions --- diff --git a/0.2.1/inc/extensions.php b/0.2.1/inc/extensions.php index 9e6bd17a5a..893a5a1836 100644 --- a/0.2.1/inc/extensions.php +++ b/0.2.1/inc/extensions.php @@ -242,19 +242,19 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) if ((is_array($SQLs) && (sizeof($SQLs) > 0))) { // Run SQL commands... - foreach ($SQLs as $sql) - { + foreach ($SQLs as $sql) { + // Trim spaces away which we don't need $sql = trim($sql); - if (!empty($sql)) - { + + // Is there still an SQL query? + if (!empty($sql)) { // Run SQL command $result = SQL_QUERY($sql, __FILE__, __LINE__, false); } } // Remove cache file(s) if extension is active - if (EXT_IS_ACTIVE("cache")) - { + if (EXT_IS_ACTIVE("cache")) { // Remove cache filer if ($CACHE->cache_file("extensions", true)) $CACHE->cache_destroy(); if ($CACHE->cache_file("mod_reg", true)) $CACHE->cache_destroy(); diff --git a/0.2.1/inc/language/de.php b/0.2.1/inc/language/de.php index f4d26944b8..69cc058ebd 100644 --- a/0.2.1/inc/language/de.php +++ b/0.2.1/inc/language/de.php @@ -534,7 +534,7 @@ define('EMAIL_PERCENT', "Klickrate"); define('MEMBER_NO_MAILS_TO_CONFIRM', "Keine Mails übrig zum Bestätigen!"); define('MEMBER_SID', "Mail-ID"); define('CONFIRM_LINK', "Bestätigungslink"); -define('MAIL_ALREADY_CONFIRMED', "Mail bereits verguetet oder Link ist nicht mehr gueltig!"); +define('MAIL_ALREADY_CONFIRMED', "Mail bereits vergütet oder Link ist nicht mehr gültig!"); define('MAIL_STATS_404', "Konnte Daten aus der Statistik-Tabelle nicht laden!"); define('USER_NOT_FOUND', "Mitgliedsdaten nicht gefunden! Sind Sie noch angemeldet?"); define('UNKNOWN_STATUS', "Unbekannter Account-Status"); diff --git a/0.2.1/inc/modules/admin/what-list_links.php b/0.2.1/inc/modules/admin/what-list_links.php index a72ee9b5b3..1cb8786dab 100644 --- a/0.2.1/inc/modules/admin/what-list_links.php +++ b/0.2.1/inc/modules/admin/what-list_links.php @@ -32,10 +32,12 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); +} elseif (!EXT_IS_ACTIVE("mailid")) { + ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid")); + return; } // Add description as navigation point @@ -43,38 +45,34 @@ ADD_DESCR("admin", basename(__FILE__)); if (empty($_GET['del'])) $_GET['del'] = ""; -OPEN_TABLE("100%", "admin_content admin_content_align", ""); -if (!empty($_GET['u_id'])) -{ +if (!empty($_GET['u_id'])) { // Check if the user already exists $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) - { + + // Is there an entry? + if (SQL_NUMROWS($result) == 1) { // Loads surname, family's name and the email address list($sname, $fname, $email) = SQL_FETCHROW($result); SQL_FREERESULT($result); // Grab user's all unconfirmed mails - if (EXT_IS_ACTIVE("bonus")) - { + if (EXT_IS_ACTIVE("bonus")) { // Load bonus ID $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%d ORDER BY id", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); - } - else - { + } else { // Load stats ID (2nd will be ignored later! But it is needed for the same fetchrow command) $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%d ORDER BY id", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); } - $nums = bigintval(SQL_NUMROWS($result)); - if ($nums > 0) - { + // Get number of rows from the query + $nums = SQL_NUMROWS($result); + + if ($nums > 0) { // Some unconfirmed mails left - if ($_GET['del'] == "all") - { + if ($_GET['del'] == "all") { // Delete all unconfirmed mails by this user $result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE userid=%d LIMIT %s", array(bigintval($_GET['u_id']), $nums), __FILE__, __LINE__); @@ -85,13 +83,10 @@ if (!empty($_GET['u_id'])) // Display message LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_LINKS_DELETED); - } - else - { + } else { // List all unconfirmed mails $SW = 2; $OUT = ""; - while (list($id, $id2, $type) = SQL_FETCHROW($result)) - { + while (list($id, $id2, $type) = SQL_FETCHROW($result)) { // Load data from stats table... $cat = ""; switch ($type) @@ -111,8 +106,7 @@ if (!empty($_GET['u_id'])) break; } - if (SQL_NUMROWS($result_data) == 1) - { + if (SQL_NUMROWS($result_data) == 1) { // Mail was found! list($subject, $timestamp, $cat) = SQL_FETCHROW($result_data); SQL_FREERESULT($result_data); @@ -129,14 +123,15 @@ if (!empty($_GET['u_id'])) // Load row template $OUT .= LOAD_TEMPLATE("admin_list_links_row", true, $content); - } - else - { - $OUT .= " - - ".$PROBLEM.": ".$DATA." - -\n"; + } else { + // Load template for error + $OUT .= LOAD_TEMPLATE("admin_list_links_problem", + array( + 'sw' => $SW, + 'problem' => $PROBLEM, + 'data' => $DATA + ) + ); } $SW = 3 - $SW; } @@ -155,25 +150,18 @@ if (!empty($_GET['u_id'])) // Load final template LOAD_TEMPLATE("admin_list_links"); } - } - else - { + } else { // No mails left to confirm LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_LINKS_1.$_GET['u_id'].ADMIN_MEMBER_LINKS_2); } - } - else - { + } else { // User not found LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2); } -} - else -{ +} else { // Output selection form with all confirmed user accounts listed ADD_MEMBER_SELECTION_BOX(); } -CLOSE_TABLE(); // ?> diff --git a/0.2.1/inc/modules/admin/what-list_unconfirmed.php b/0.2.1/inc/modules/admin/what-list_unconfirmed.php index 54ea3434b1..a4cfc7b654 100644 --- a/0.2.1/inc/modules/admin/what-list_unconfirmed.php +++ b/0.2.1/inc/modules/admin/what-list_unconfirmed.php @@ -32,11 +32,14 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); +} elseif (!EXT_IS_ACTIVE("mailid")) { + ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid")); + return; } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/0.2.1/inc/modules/admin/what-send_bonus.php b/0.2.1/inc/modules/admin/what-send_bonus.php index 1e64c4dfce..fccbb061a5 100644 --- a/0.2.1/inc/modules/admin/what-send_bonus.php +++ b/0.2.1/inc/modules/admin/what-send_bonus.php @@ -32,11 +32,14 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); +} elseif (!EXT_IS_ACTIVE("order")) { + ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "order")); + return; } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); @@ -45,7 +48,6 @@ if (is_admin()) $WHERE = ""; $EXT_HTML = EXT_IS_ACTIVE("html_mail"); if (empty($_GET['mode'])) $_GET['mode'] = "select"; -OPEN_TABLE("100%", "admin_content admin_content_align", ""); if (isset($_POST['ok'])) { // Check if category and number of receivers is okay @@ -140,9 +142,7 @@ VALUES ('%s', '%s', '%s', '%s', '%s', 'NEW', UNIX_TIMESTAMP(), '%s', '%s', '%s', // Redirect to requested URL LOAD_URL($URL); } -} - else -{ +} else { $result = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$WHERE." ORDER BY sort", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { @@ -239,6 +239,6 @@ WHERE userid=%d AND status='CONFIRMED' AND receive_mails > 0".$MORE." LIMIT 1", OUTPUT_HTML ("".MEMBER_NO_CATS.""); } } -CLOSE_TABLE(); + // ?> diff --git a/0.2.1/inc/modules/chk_login.php b/0.2.1/inc/modules/chk_login.php index 9b4e6b8313..9be4517da9 100644 --- a/0.2.1/inc/modules/chk_login.php +++ b/0.2.1/inc/modules/chk_login.php @@ -55,8 +55,8 @@ if (!empty($GLOBALS['userid']) && !empty($_COOKIE['u_hash']) && !empty($_COOKIE[ $_COOKIE['mxchange_theme'] = $NewTheme; $bonus = false; - if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1")) - { + die("
".print_r($CONFIG, true)."
"); + if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1")) { // Update last login $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET last_login=UNIX_TIMESTAMP() diff --git a/0.2.1/inc/modules/index.php b/0.2.1/inc/modules/index.php index cb6ee90805..afccd22e33 100644 --- a/0.2.1/inc/modules/index.php +++ b/0.2.1/inc/modules/index.php @@ -68,7 +68,7 @@ if (!empty($_GET['msg'])) case CODE_USER_404 : $msg = USER_NOT_FOUND; break; case CODE_STATS_404 : $msg = MAIL_STATS_404; break; case CODE_ALREADY_CONFIRMED: $msg = MAIL_ALREADY_CONFIRMED; break; - case CODE_ERROR_MAILID : $msg = ERROR_CONFIRMING_MAIL; break; + case CODE_ERROR_MAILID : if (EXT_IS_ACTIVE("mailid", true)) { $msg = ERROR_CONFIRMING_MAIL; } else { $msg = sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"); } break; case CODE_EXTENSION_PROBLEM: $msg = sprintf(EXTENSION_PROBLEM_EXT_INACTIVE, "mailid"); break; case CODE_COOKIES_DISABLED : $msg = LOGIN_NO_COOKIES; break; case CODE_BEG_SAME_AS_OWN : $msg = BEG_SAME_UID_AS_OWN; break; diff --git a/0.2.1/inc/modules/login.php b/0.2.1/inc/modules/login.php index 3f617f6e2c..e7e2d35810 100644 --- a/0.2.1/inc/modules/login.php +++ b/0.2.1/inc/modules/login.php @@ -32,20 +32,16 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_LOGGED_IN()) -{ +} elseif (!IS_LOGGED_IN()) { $URL = URL."/modules.php?module=index"; if ($check == "mem_only") $URL .= "&msg=".urlencode(LANG_MEM_ONLY_1.$GLOBALS['module'].LANG_MEM_ONLY_2); LOAD_URL($URL); } -if ($status != "CONFIRMED") -{ +if ($status != "CONFIRMED") { // If the status is different than confirmed move the user away from here switch ($status) { diff --git a/0.2.1/mailid.php b/0.2.1/mailid.php index ca6a2a65e0..b268fa82d8 100644 --- a/0.2.1/mailid.php +++ b/0.2.1/mailid.php @@ -51,18 +51,22 @@ if (defined('mxchange_installed') && (mxchange_installed)) // Is the extension active if (!EXT_IS_ACTIVE("mailid", true)) { // Is not activated/installed yet! - ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "register")); + ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid")); } // Add header require_once(PATH."inc/header.php"); + // Init + $url_uid = 0; $url_bid = 0; $url_mid = 0; + // Secure all data - $url_uid = "0"; $url_bid = "0"; $url_mid = "0"; if (!empty($_GET['uid'])) $url_uid = bigintval($_GET['uid']); if (!empty($_GET['mailid'])) $url_mid = bigintval($_GET['mailid']); if (!empty($_GET['bonusid'])) $url_bid = bigintval($_GET['bonusid']); + //* DEBUG: */ die("*".$url_uid."/".$url_bid."/".$url_mid."*
".print_r($FATAL, true)."
"); + // 01 1 12 3 32 21 1 2 2 10 if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (count($FATAL) == 0)) { @@ -157,8 +161,7 @@ if (defined('mxchange_installed') && (mxchange_installed)) { // If time is zero seconds we have a sponsor mail. 1 Second shall be set to avoid problems if (($time == "0") && ($payment > 0)) { $URL = URL; $time = "1"; } - if (($time > 0) && (($payment > 0) || ($points > 0))) - { + if (($time > 0) && (($payment > 0) || ($points > 0))) { // He can confirm this mail! // Export data into constants for the template define('_UID_VALUE' , $url_uid); @@ -168,47 +171,34 @@ if (defined('mxchange_installed') && (mxchange_installed)) // Load template LOAD_TEMPLATE("mailid_frames"); - } - else - { + } else { $msg = CODE_DATA_INVALID; } - } - else - { + } else { $msg = CODE_POSSIBLE_INVALID; } - } - else - { + } else { $msg = CODE_ACCOUNT_LOCKED; } - } - else - { + } else { SQL_FREERESULT($result); $msg = CODE_USER_404; } - } - else - { + } else { SQL_FREERESULT($result); $msg = CODE_STATS_404; } - } - else - { + } else { SQL_FREERESULT($result); $msg = CODE_ALREADY_CONFIRMED; } - } - else - { + } else { // Nothing entered $msg = CODE_ERROR_MAILID; } - if (!empty($msg)) - { + + // Error code is set? + if (!empty($msg)) { LOAD_URL(URL."/modules.php?module=index&msg=".$msg); } diff --git a/0.2.1/templates/de/html/member/member_header.tpl b/0.2.1/templates/de/html/member/member_header.tpl index 0cb36024d7..d469e344a4 100644 --- a/0.2.1/templates/de/html/member/member_header.tpl +++ b/0.2.1/templates/de/html/member/member_header.tpl @@ -1,21 +1,22 @@ - - -
- - - - - {!MAIN_TITLE!} - - - -
-
- - - - - -
  Hallo - $username!{!SLOGAN!}$date_time  
+ + + +
+ + + - \ No newline at end of file + + + + + + +
+ - - - {!MAIN_TITLE!} - - - +
  Hallo + $username!{!SLOGAN!}$date_time  
+