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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
// 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");
}
+
//
?>
} 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;
} 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;
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;
}
} 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;
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()) {
// 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;