More fixes, thanks to Piter01
authorRoland Häder <roland@mxchange.org>
Wed, 3 Dec 2008 08:02:34 +0000 (08:02 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 3 Dec 2008 08:02:34 +0000 (08:02 +0000)
14 files changed:
inc/databases.php
inc/modules/admin/what-config_yoomedia.php
inc/modules/guest/what-top10.php
inc/modules/member/what-beg.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-holiday.php
inc/modules/member/what-nickname.php
inc/modules/member/what-payout.php
inc/modules/member/what-primera.php
inc/modules/member/what-transfer.php
inc/modules/member/what-wernis.php
inc/modules/order.php
inc/mysql-manager.php

index 1e6813f..3774c50 100644 (file)
@@ -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);
index bd7cb10..e93cc9b 100644 (file)
@@ -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;
 }
index 7ae01f4..8536854 100644 (file)
@@ -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;
 }
index 47c3a17..70af3d4 100644 (file)
@@ -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;
 }
index f8952e5..1c9ecfd 100644 (file)
@@ -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;
 }
index 1c20685..9d340d1 100644 (file)
@@ -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;
 }
index b17294a..4cbbc22 100644 (file)
@@ -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;
 }
index 13995d1..038010f 100644 (file)
@@ -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("<STRONG class=\"member_failed\">".NICKNAME_IS_INVALID."</STRONG><P></P>");
-       }
+       } // END - if
 
        // Load Template
        LOAD_TEMPLATE("member_nickname_form");
 }
+
 //
 ?>
index dccd81f..d352d80 100644 (file)
@@ -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;
index 7b3a4f1..746f59e 100644 (file)
@@ -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;
index 7af1122..6698a42 100644 (file)
@@ -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;
 }
index 84ca9cd..8578e52 100644 (file)
@@ -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;
index c2b8ad8..a880995 100644 (file)
@@ -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()) {
index 158977b..b90a230 100644 (file)
@@ -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;