From: Roland Häder Date: Wed, 3 Dec 2008 08:02:34 +0000 (+0000) Subject: More fixes, thanks to Piter01 X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=b7a1b50bec9d45efcf037db83b7e7c58ba2846dd More fixes, thanks to Piter01 --- diff --git a/inc/databases.php b/inc/databases.php index 1e6813f4a9..3774c5042e 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "587"); +define('CURR_SVN_REVISION', "588"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/modules/admin/what-config_yoomedia.php b/inc/modules/admin/what-config_yoomedia.php index bd7cb10886..e93cc9bb4a 100644 --- a/inc/modules/admin/what-config_yoomedia.php +++ b/inc/modules/admin/what-config_yoomedia.php @@ -35,7 +35,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif (!EXT_IS_ACTIVE("yoomedia")) +} elseif (!EXT_IS_ACTIVE("yoomedia")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "yoomedia"); return; } diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index 7ae01f4d41..8536854d67 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -35,7 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif (!EXT_IS_ACTIVE("top10")) +} elseif (!EXT_IS_ACTIVE("top10")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "top10"); return; } diff --git a/inc/modules/member/what-beg.php b/inc/modules/member/what-beg.php index 47c3a1710c..70af3d4e2c 100644 --- a/inc/modules/member/what-beg.php +++ b/inc/modules/member/what-beg.php @@ -37,7 +37,7 @@ if (!defined('__SECURITY')) { require($INC); } elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} elseif (!EXT_IS_ACTIVE("beg")) +} elseif (!EXT_IS_ACTIVE("beg")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); return; } diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php index f8952e552b..1c9ecfdc69 100644 --- a/inc/modules/member/what-beg2.php +++ b/inc/modules/member/what-beg2.php @@ -37,7 +37,7 @@ if (!defined('__SECURITY')) { require($INC); } elseif (!IS_MEMBER()) { LOAD_URL("modules.php[5~?module=index"); -} elseif (!EXT_IS_ACTIVE("beg")) +} elseif (!EXT_IS_ACTIVE("beg")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); return; } diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index 1c20685a78..9d340d18e7 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -37,7 +37,7 @@ if (!defined('__SECURITY')) { require($INC); } elseif (!IS_MEMBER()) { LOAD_URL("modules.php[5~?module=index"); -} elseif (!EXT_IS_ACTIVE("bonus")) +} elseif (!EXT_IS_ACTIVE("bonus")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus"); return; } diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index b17294aea1..4cbbc22cad 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -37,7 +37,7 @@ if (!defined('__SECURITY')) { require($INC); } elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} elseif (!EXT_IS_ACTIVE("holiday")) +} elseif (!EXT_IS_ACTIVE("holiday")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "holiday"); return; } diff --git a/inc/modules/member/what-nickname.php b/inc/modules/member/what-nickname.php index 13995d1e40..038010f054 100644 --- a/inc/modules/member/what-nickname.php +++ b/inc/modules/member/what-nickname.php @@ -37,7 +37,7 @@ if (!defined('__SECURITY')) { require($INC); } elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} elseif (!EXT_IS_ACTIVE("nickname")) +} elseif (!EXT_IS_ACTIVE("nickname")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "nickname"); return; } @@ -46,35 +46,28 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); $VALID = false; -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Nickname was submitted so let's check if it is not already in use - if (!empty($_POST['nickname'])) - { + if (!empty($_POST['nickname'])) { // Check if nickname is valid $PATTERN = "[".__NICKNAME_PATTERN."]{".__NICKNAME_LENGTH.",}"; - if (ereg($PATTERN, $_POST['nickname'], $array)) - { + if (ereg($PATTERN, $_POST['nickname'], $array)) { // Entered nickname is valid? if ($array[0] == $_POST['nickname']) $VALID = true; - } - } -} + } // END - if + } // END - if +} // END - if -if ($VALID) -{ +if ($VALID) { // Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" ! $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' AND userid != '%s' LIMIT 1", - array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 0) - { + array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__); + if (SQL_NUMROWS($result) == 0) { // Nickname not in use, so set it now $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nickname='%s' WHERE userid=%s LIMIT 1", - array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__); + array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__); $content = NICKNAME_SAVED; - } - else - { + } else { // Free result SQL_FREERESULT($result); @@ -84,20 +77,18 @@ if ($VALID) // Load template LOAD_TEMPLATE("admin_settings_saved", false, $content); -} - else -{ +} else { // Load current nickname define('__NICKNAME', NICKNAME_GET_NICK($GLOBALS['userid'])); // Do we have already submit the form? - if (!empty($_POST['nickname'])) - { + if (!empty($_POST['nickname'])) { OUTPUT_HTML("".NICKNAME_IS_INVALID."

"); - } + } // END - if // Load Template LOAD_TEMPLATE("member_nickname_form"); } + // ?> diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index dccd81ffb8..d352d80cf7 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { } elseif (!IS_MEMBER()) { // Not logged in LOAD_URL("modules.php?module=index"); -} elseif (!EXT_IS_ACTIVE("payout")) +} elseif (!EXT_IS_ACTIVE("payout")) { // Extension "payout" is not active ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "payout"); return; diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php index 7b3a4f13f0..746f59e376 100644 --- a/inc/modules/member/what-primera.php +++ b/inc/modules/member/what-primera.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { } elseif (!IS_MEMBER()) { // User is not logged in LOAD_URL("modules.php?module=index"); -} elseif (!EXT_IS_ACTIVE("primera")) +} elseif (!EXT_IS_ACTIVE("primera")) { // Extension "primera" is not activated ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "primera"); return; diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index 7af1122af8..6698a42def 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -37,7 +37,7 @@ if (!defined('__SECURITY')) { require($INC); } elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} elseif (!EXT_IS_ACTIVE("transfer")) +} elseif (!EXT_IS_ACTIVE("transfer")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "transfer"); return; } diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index 84ca9cd035..8578e52479 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { } elseif (!IS_MEMBER()) { // User is not logged in LOAD_URL("modules.php?module=index"); -} elseif (!EXT_IS_ACTIVE("wernis")) +} elseif (!EXT_IS_ACTIVE("wernis")) { // Extension "wernis" is not activated ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "wernis"); return; diff --git a/inc/modules/order.php b/inc/modules/order.php index c2b8ad8732..a880995003 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -36,7 +36,7 @@ $URL = ""; if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif (!EXT_IS_ACTIVE("order")) +} elseif (!EXT_IS_ACTIVE("order")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "order"); return; } elseif (!IS_MEMBER()) { diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 158977bd0f..b90a230cf3 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -2269,8 +2269,14 @@ ORDER BY ur.refid ASC", // Get unconfirmed mails $row['unconfirmed'] = GET_TOTAL_DATA($row['refid'], "user_links", "id", "userid", true); - // Calculate clickrate - $row['clickrate'] = ($row['mails_confirmed'] / $row['emails_received'] * 100); + // Init clickrate with zero + $row['clickrate'] = 0; + + // Is at least one mail received? + if ($row['emails_received'] > 0) { + // Calculate clickrate + $row['clickrate'] = ($row['mails_confirmed'] / $row['emails_received'] * 100); + } // END - if // Activity is "active" by default because if autopurge is not installed $row['activity'] = MEMBER_ACTIVITY_ACTIVE;