Admin user details extended, DEBUG_LOG() rewritten, random userid on refid=0 added
authorRoland Häder <roland@mxchange.org>
Fri, 7 Nov 2008 14:38:56 +0000 (14:38 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 7 Nov 2008 14:38:56 +0000 (14:38 +0000)
24 files changed:
click.php
inc/databases.php
inc/extensions.php
inc/extensions/ext-debug.php
inc/extensions/ext-user.php
inc/functions.php
inc/language/de.php
inc/libs/refback_functions.php
inc/libs/surfbar_functions.php
inc/libs/user_functions.php
inc/libs/wernis_functions.php
inc/libs/yoomedia_functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-config_refid.php
inc/modules/admin/what-list_user.php
inc/modules/member/what-order.php
inc/monthly/monthly_beg.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/session.php
mailid_top.php
templates/de/html/admin/admin_config_refid.tpl
templates/de/html/admin/admin_user_details.tpl
view.php

index 4dd6144..c10ff14 100644 (file)
--- a/click.php
+++ b/click.php
@@ -54,11 +54,11 @@ if (((!empty($_GET['user'])) || (!empty($_GET['reseller']))) && (!empty($_GET['b
                } else {
                        LOAD_URL("shop_reseller.php?reseller=".bigintval($_GET['user']));
                }
-       }
-       exit();
-} else {
-       // Do nothing for now
-       die();
-}
-//
+       } // END - if
+} // END - if
+
+// Load index page
+LOAD_URL("index.php");
+
+// [EOF]
 ?>
index 8ac9e4a..8896da0 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "524");
+define('CURR_SVN_REVISION', "525");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 8be7feb..fee99ba 100644 (file)
@@ -367,7 +367,7 @@ function EXT_IS_ACTIVE ($ext_name) {
        }
 
        // Debug message
-       //DEBUG_LOG(__FUNCTION__.": ext_name={$ext_name},active={$active}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, " ext_name={$ext_name},active={$active}");
 
        // Is this extension activated? (For admins we always have active extensions...)
        return ($active == "Y");
index 3e310c0..642a4ff 100644 (file)
@@ -55,6 +55,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
 `sender_id` BIGINT(20) NOT NULL DEFAULT 0,
 `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`file` VARCHAR(255) NOT NULL DEFAULT '',
+`line` MEDIUMINT NOT NOT NULL DEFAULT 0,
 `message` LONGTEXT,
 `comment` TINYTEXT,
 `status` ENUM('NEW','PENDING','ACCEPTED','FIXED','INVALID','DUBLICATE','SPAM') NOT NULL DEFAULT 'NEW',
index 64a17c7..f12042f 100644 (file)
@@ -38,10 +38,10 @@ if (!defined('__SECURITY')) {
 }
 
 // Version number
-$EXT_VERSION = "0.3.3";
+$EXT_VERSION = "0.3.4";
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3");
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4");
 
 switch ($EXT_LOAD_MODE)
 {
@@ -79,7 +79,7 @@ case "update": // Update an extension
                break;
 
        case "0.1.1": // SQL queries for v0.1.1
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='user' AND ext_has_css='N' LIMIT 1";
+               $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='user' AND `ext_has_css`='N' LIMIT 1";
 
                // This update depends on sql_patches update!
                $EXT_UPDATE_DEPENDS = "sql_patches";
@@ -209,6 +209,15 @@ case "update": // Update an extension
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Mitglieder sind nun per Formular kontaktierbar (es wird eine EMail versendet), gesperrte und best&auml;tigte Mitglieder-Accounts sind seperat oder gemeinsam auflistbar (seperat nur mit der Erweiterung <em>task</em>!)";
                break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `select_user_zero_refid` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_min_confirmed` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 10";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `rand_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitglieder werden per Zufall als Referal-ID ausgew&auml;hlt, die eine Mindestanzahl an best&auml;tigten Mails haben, wenn die Ref-Id 0 ist.";
+               break;
        }
        break;
 
@@ -222,5 +231,5 @@ $EXT_LANG_PREFIX = "user";
 // Keep this extension always active!
 $EXT_ALWAYS_ACTIVE = "Y";
 
-//
+// [EOF]
 ?>
index 73b15f5..6472c60 100644 (file)
@@ -207,7 +207,7 @@ function ADD_FATAL ($message, $extra="") {
        }
 
        // Log fatal messages away
-       DEBUG_LOG(__FUNCTION__."(".__LINE__."): message={$message}");
+       DEBUG_LOG(__FUNCTION__, __LINE__, " message={$message}");
 }
 
 // Load a template file and return it's content (only it's name; do not use ' or ")
@@ -443,7 +443,7 @@ Message : ".$MSG."
 </pre>\n";
 
                // Log the mail away
-               if (defined('DEBUG_MAIL')) DEBUG_LOG(__FUNCTION__.":to={$TO},subject={$SUBJECT},msg={$MSG}");
+               if (defined('DEBUG_MAIL')) DEBUG_LOG(__FUNCTION__, __LINE__, "to={$TO},subject={$SUBJECT},msg={$MSG}");
        } elseif (($HTML == "Y") && (EXT_IS_ACTIVE("html_mail"))) {
                // Send mail as HTML away
                SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM);
@@ -598,7 +598,7 @@ function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) {
        } // END - if
 
        // Debug log
-       //DEBUG_LOG(__FUNCTION__.":dotted={$dotted},maxComma={$maxComma}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "dotted={$dotted},maxComma={$maxComma}");
 
        // Translate it now
        switch (GET_LANGUAGE()) {
@@ -1262,7 +1262,7 @@ function bigintval($num, $castValue = true) {
        // Has the whole value changed?
        if ("".$ret."" != "".$num."") {
                // Log the values
-               DEBUG_LOG(__FUNCTION__.": num={$num},ret={$ret}");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " num={$num},ret={$ret}");
        } // END - if
 
        // Return result
@@ -2362,12 +2362,12 @@ function merge_array ($array1, $array2) {
        die("</pre>");
 }
 // Debug message logger
-function DEBUG_LOG ($message, $force=false) {
+function DEBUG_LOG ($file, $line, $message, $force=false) {
        // Is debug mode enabled?
        if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force)) {
                // Log this message away
                $fp = fopen(PATH."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!");
-               fwrite($fp, date("d.m.Y|H:i:s", time())."|".strip_tags($message)."\n");
+               fwrite($fp, date("d.m.Y|H:i:s", time())."|".basename(__FILE__)."|".__LINE__."|".strip_tags($message)."\n");
                fclose($fp);
        } // END - if
 }
@@ -2598,7 +2598,7 @@ function REBUILD_CACHE ($cache, $inc="") {
                                require($fqfn);
                        } else {
                                // Include not found!
-                               DEBUG_LOG(__FUNCTION__.":Include {$inc} not found. cache={$cache}");
+                               DEBUG_LOG(__FUNCTION__, __LINE__, "Include {$inc} not found. cache={$cache}");
                        }
                } // END - if
        } // END - if
@@ -2613,7 +2613,7 @@ function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
                return false;
        } elseif (!is_object($cacheInstance)) {
                // No cache instance!
-               DEBUG_LOG(__FUNCTION__.": No cache instance found.");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " No cache instance found.");
                return false;
        } elseif ((!isset($_CONFIG['cache_admin_menu'])) || ($_CONFIG['cache_admin_menu'] == "N")) {
                // Caching disabled (currently experiemental!)
@@ -2728,9 +2728,46 @@ function ADD_NEW_BONUS_MAIL ($data, $mode="", $output=true) {
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MORE_SELECTED);
        } else {
                // Debug log
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): cat={$data['cat']},receiver={$data['receiver']},data=".base64_encode(serialize($data))." More selected, than available!");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " cat={$data['cat']},receiver={$data['receiver']},data=".base64_encode(serialize($data))." More selected, than available!");
        }
 }
+// Determines referal id and sets it
+function DETERMINE_REFID () {
+       global $_CONFIG, $CLICK, $_SERVER;
+
+       // Check if refid is set
+       if ((!empty($_GET['user'])) && ($CLICK == 1) && (basename($_SERVER['PHP_SELF']) == "click.php")) {
+               // The variable user comes from the click-counter script click.php and we only accept this here
+               $GLOBALS['refid'] = bigintval($_GET['user']);
+       } elseif (!empty($_POST['refid'])) {
+               // Get referal id from variable refid (so I hope this makes my script more compatible to other scripts)
+               $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_POST['refid']));
+       } elseif (!empty($_GET['refid'])) {
+               // Get referal id from variable refid (so I hope this makes my script more compatible to other scripts)
+               $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['refid']));
+       } elseif (!empty($_GET['ref'])) {
+               // Set refid=ref (the referal link uses such variable)
+               $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['ref']));
+       } elseif ((isSessionVariableSet('refid')) && (get_session('refid') != 0)) {
+               // Set session refid als global
+               $GLOBALS['refid'] = bigintval(get_session('refid'));
+       } elseif ((GET_EXT_VERSION("sql_patches") != "") && ($_CONFIG['def_refid'] > 0)) {
+               // Set default refid as refid in URL
+               $GLOBALS['refid'] = bigintval($_CONFIG['def_refid']);
+       } elseif ((GET_EXT_VERSION("user") >= "0.3.4") && ($_CONFIG['select_user_zero_refid']) == "Y") {
+               // Select a random user which has confirmed enougth mails
+               $GLOBALS['refid'] = SELECT_RANDOM_REFID();
+       } else {
+               // No default ID when sql_patches is not installed or none set
+               $GLOBALS['refid'] = 0;
+       }
+
+       // Set cookie when default refid > 0
+       if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && (isset($_CONFIG['def_refid'])) && ($_CONFIG['def_refid'] > 0))) {
+               // Set cookie
+               set_session('refid', $GLOBALS['refid']);
+       } // END - if
+}
 
 //////////////////////////////////////////////////
 //                                              //
index cab9bc3..1df932e 100644 (file)
@@ -526,7 +526,7 @@ define('ADMIN_LAST_MODULE', "Letzte Aktion");
 define('RECEIVE_MAILS', "Kann Mails empfangen");
 define('REF_CLICKS', "Klicks auf Ref-Link");
 define('TOTAL_LOGINS', "Logins gesamt");
-define('USED_POINTS', "Verwendete {!POINTS!}");
+define('USED_POINTS', "Ausgegebene {!POINTS!}");
 define('MAILS_SENT', "Mails versendet");
 define('HAS_JOINED', "Beigetreten am");
 define('TOTAL_POINTS', "{!POINTS!} gesamt");
@@ -944,7 +944,7 @@ define('BONUS_EXTENSION_UPGRADE_1', "Bitte aktualisieren Sie Ihre Bonus-Erweiter
 define('BONUS_EXTENSION_UPGRADE_2', "</U> oder neuer!");
 define('_ON', "an");
 define('CLICK_STATISTICS', "Mail-Statistik");
-define('ADMIN_SELECT_DEF_REFID', "Standart Referal-ID bei Anmeldung &uuml;ber keinen Ref-Link");
+define('ADMIN_SELECT_DEF_REFID', "Standart Referal-ID bei Anmeldung &uuml;ber <strong>keinen</strong> Ref-Link");
 define('ADMIN_SELECT_REFID_TARGRT', "Ziel-Seite des Referal-Linkes");
 define('ADMIN_REF_TARGET_REGISTER', "Zur Anmeldeseite");
 define('ADMIN_REF_TARGET_INDEX', "Zur Eingangsseite");
@@ -1182,6 +1182,13 @@ define('MEMBER_NO_MAILS_IN_STATS', "Keine versandten Buchungen gefunden!");
 define('ADMIN_RESET_PASSWORD', "Passwort vergessen?");
 define('EMAIL_DETAILS', "Email-Details");
 define('EMAIL_DETAILS_LINK', "Details anzeigen");
+define('ADMIN_CONFIG_REFID_TITLE', "Einstellungen zum Referal-Link");
+define('ADMIN_RANDOM_ZERO_REFID', "Soll per Zufall ein User nach folgenden Kriterien ausgew&auml;hlt werden, wenn keine Standart-Refid eingestellt ist?");
+define('ADMIN_RAND_REFID_ENABLED', "Mitglieder per Zufall w&auml;hlen");
+define('ADMIN_RAND_REFID_DISABLED', "Referal-Id 0 verwenden");
+define('ADMIN_RANDOM_MIN_CONFIRMED', "Wie viele best&auml;tigte Mails muss ein Mitglied mindestens haben, um per Zufall ausgew&auml;hlt zu werden?");
+define('EMAILS_RECEIVED', "Emails bereits empfangen");
+define('MAILS_CONFIRMED', "Emails best&auml;tigt");
 
 define('MEMBER_MAIL_BONUS_CONFIRMED_ON', "Sie haben diese Bonusmail <span class=\"data\">%s</span> best&auml;tigt.");
 define('MEMBER_MAIL_NORMAL_CONFIRMED_ON', "Sie haben diese Klickmail <span class=\"data\">%s</span> best&auml;tigt.");
index 83aa8a9..4f7e655 100644 (file)
@@ -123,7 +123,7 @@ function GET_REFBACK_PERCENTS ($uid, $ref) {
        } else {
                // Debug log
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />\n";
-               DEBUG_LOG(__FUNCTION__.": uid={$uid},ref={$ref} - No entry found! :-(");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " uid={$uid},ref={$ref} - No entry found! :-(");
        }
 
        // Free result
index 37d3c94..9256ec8 100644 (file)
@@ -240,7 +240,7 @@ function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) {
                $performed = call_user_func_array($functionName, $urlData);
        } else {
                // Log invalid request
-               DEBUG_LOG(__FUNCTION__.": action={$formData['action']},id={$formData['id']},function={$functionName}");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " action={$formData['action']},id={$formData['id']},function={$functionName}");
        }
 
        // Return status
@@ -625,7 +625,7 @@ function SURFBAR_CHECK_RELOAD_FULL() {
 
        // Cache static reload lock
        $SURFBAR_CACHE['surf_lock'] = $_CONFIG['surfbar_static_lock'];
-       //DEBUG_LOG(__FUNCTION__.":Fixed surf lock is ".$_CONFIG['surfbar_static_lock']."");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "Fixed surf lock is ".$_CONFIG['surfbar_static_lock']."");
 
        // Do we have dynamic model?
        if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
@@ -656,7 +656,7 @@ LIMIT 1",
        $total = SURFBAR_GET_TOTAL_URLS();
 
        // Do we have some URLs in lock? Admins can always surf on own URLs!
-       //DEBUG_LOG(__FUNCTION__.":userLocks=".SURFBAR_GET_DATA('user_locks').",total={$total}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "userLocks=".SURFBAR_GET_DATA('user_locks').",total={$total}");
        $isFull = ((SURFBAR_GET_DATA('user_locks') == $total) && ($total > 0));
 
        // Return result
@@ -764,16 +764,16 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
                if (empty($salt)) {
                        // Generate random hashed string
                        $SURFBAR_CACHE['salt'] = sha1(GEN_PASS(255));
-                       //DEBUG_LOG(__FUNCTION__.":newSalt=".SURFBAR_GET_SALT()."");
+                       //DEBUG_LOG(__FUNCTION__, __LINE__, "newSalt=".SURFBAR_GET_SALT()."");
                } else {
                        // Use this as salt!
                        $SURFBAR_CACHE['salt'] = $salt;
-                       //DEBUG_LOG(__FUNCTION__.":oldSalt=".SURFBAR_GET_SALT()."");
+                       //DEBUG_LOG(__FUNCTION__, __LINE__, "oldSalt=".SURFBAR_GET_SALT()."");
                }
 
                // ... and now the validation code
                $valCode = GEN_RANDOM_CODE($length, sha1(SURFBAR_GET_SALT().":".$urlId), $GLOBALS['userid']);
-               //DEBUG_LOG(__FUNCTION__.":valCode={$valCode}");
+               //DEBUG_LOG(__FUNCTION__, __LINE__, "valCode={$valCode}");
        } // END - while
 
        // Hash it with md5() and salt it with the random string
@@ -783,7 +783,7 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
        $valHashedCode = generatePassString($hashedCode);
 
        // Return hashed value
-       //DEBUG_LOG(__FUNCTION__.":finalValCode={$valHashedCode}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "finalValCode={$valHashedCode}");
        return $valHashedCode;
 }
 // Check validation code
@@ -797,8 +797,8 @@ function SURFBAR_CHECK_VALIDATION_CODE ($urlId, $check, $salt) {
        $code = SURFBAR_GENERATE_VALIDATION_CODE($urlId, $salt);
 
        // Return result of checking hashes and salts
-       //DEBUG_LOG(__FUNCTION__.":---".$code."|".$check."---");
-       //DEBUG_LOG(__FUNCTION__.":+++".$salt."|".SURFBAR_GET_DATA('last_salt')."+++");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "---".$code."|".$check."---");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "+++".$salt."|".SURFBAR_GET_DATA('last_salt')."+++");
        return (($code == $check) && ($salt == SURFBAR_GET_DATA('last_salt')));
 }
 // Lockdown the userid/id combination (reload lock)
@@ -816,13 +816,13 @@ function SURFBAR_LOCKDOWN_ID ($urlId) {
 // Pay points to the user and remove it from the sender
 function SURFBAR_PAY_POINTS ($urlId) {
        // Remove it from the URL owner
-       //DEBUG_LOG(__FUNCTION__.":uid=".SURFBAR_GET_USERID().",costs=".SURFBAR_GET_COSTS()."");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".SURFBAR_GET_USERID().",costs=".SURFBAR_GET_COSTS()."");
        if (SURFBAR_GET_USERID() > 0) {
                SUB_POINTS(SURFBAR_GET_USERID(), SURFBAR_GET_COSTS());
        } // END - if
 
        // Book it to the user
-       //DEBUG_LOG(__FUNCTION__.":uid=".$GLOBALS['userid'].",reward=".SURFBAR_GET_REWARD()."");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".$GLOBALS['userid'].",reward=".SURFBAR_GET_REWARD()."");
        ADD_POINTS_REFSYSTEM($GLOBALS['userid'], SURFBAR_GET_DATA('reward'));
 }
 // Updates the statistics of current URL/userid
@@ -875,7 +875,7 @@ function SURFBAR_UPDATE_SALT_STATS () {
                array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), $GLOBALS['userid']), __FILE__, __LINE__);
 
        // Debug message
-       //DEBUG_LOG(__FUNCTION__.":salt=".SURFBAR_GET_SALT().",id=".SURFBAR_GET_ID().",uid=".$GLOBALS['userid']."");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "salt=".SURFBAR_GET_SALT().",id=".SURFBAR_GET_ID().",uid=".$GLOBALS['userid']."");
 
        // Was that okay?
        if (SQL_AFFECTEDROWS() < 1) {
@@ -885,14 +885,14 @@ function SURFBAR_UPDATE_SALT_STATS () {
        } // END - if
 
        // Debug message
-       //DEBUG_LOG(__FUNCTION__.":affectedRows=".SQL_AFFECTEDROWS()."");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "affectedRows=".SQL_AFFECTEDROWS()."");
 
        // Return if the update was okay
        return (SQL_AFFECTEDROWS() == 1);
 }
 // Check if the reload lock is active for given id
 function SURFBAR_CHECK_RELOAD_LOCK ($urlId) {
-       //DEBUG_LOG(__FUNCTION__.":id={$urlId}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "id={$urlId}");
        // Ask the database
        $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
 FROM "._MYSQL_PREFIX."_surfbar_locks
@@ -909,7 +909,7 @@ LIMIT 1",
        SQL_FREERESULT($result);
 
        // Return check
-       //DEBUG_LOG(__FUNCTION__.":cnt={$cnt},".SURFBAR_GET_DATA('surf_lock')."");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "cnt={$cnt},".SURFBAR_GET_DATA('surf_lock')."");
        return ($cnt == 1);
 }
 // Determine which user hash no more points left
@@ -952,12 +952,12 @@ ORDER BY u.userid ASC", __FILE__, __LINE__);
        while (list($uid, $notified) = SQL_FETCHROW($result)) {
                // Get total points
                $points = GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points");
-               //DEBUG_LOG(__FUNCTION__.":uid={$uid},points={$points}");
+               //DEBUG_LOG(__FUNCTION__, __LINE__, "uid={$uid},points={$points}");
 
                // Shall we add this to ignore?
                if ($points <= $limit) {
                        // Ignore this one!
-                       //DEBUG_LOG(__FUNCTION__.":uid={$uid} has depleted points amount!");
+                       //DEBUG_LOG(__FUNCTION__, __LINE__, "uid={$uid} has depleted points amount!");
                        $UIDs['uid'][$uid] = $uid;
                        $UIDs['points'][$uid] = $points;
                        $UIDs['notified'][$uid] = $notified;
@@ -968,7 +968,7 @@ ORDER BY u.userid ASC", __FILE__, __LINE__);
        SQL_FREERESULT($result);
 
        // Debug message
-       //DEBUG_LOG(__FUNCTION__.":UIDs::count=".count($UIDs)." (with own userid=".$GLOBALS['userid'].")");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "UIDs::count=".count($UIDs)." (with own userid=".$GLOBALS['userid'].")");
 
        // Return result
        return $UIDs;
@@ -1154,17 +1154,17 @@ ORDER BY
        // Load all entries
        while (list($lid, $url, $last) = SQL_FETCHROW($result)) {
                // Debug message
-               //DEBUG_LOG(__FUNCTION__.":next - lid={$lid},url={$url},rest=".(time() - $last)."/".SURFBAR_GET_DATA('surf_lock')."");
+               //DEBUG_LOG(__FUNCTION__, __LINE__, "next - lid={$lid},url={$url},rest=".(time() - $last)."/".SURFBAR_GET_DATA('surf_lock')."");
 
                // Skip entries that are too old
                if (($last > (time() - SURFBAR_GET_DATA('surf_lock'))) && (!in_array($url, $ignored))) {
                        // Debug message
-                       //DEBUG_LOG(__FUNCTION__.":okay - lid={$lid},url={$url},last={$last}");
+                       //DEBUG_LOG(__FUNCTION__, __LINE__, "okay - lid={$lid},url={$url},last={$last}");
 
                        // Add only if missing or bigger
                        if ((!isset($IDs[$url])) || ($IDs[$url] > $last)) {
                                // Debug message
-                               //DEBUG_LOG(__FUNCTION__.":ADD - lid={$lid},url={$url},last={$last}");
+                               //DEBUG_LOG(__FUNCTION__, __LINE__, "ADD - lid={$lid},url={$url},last={$last}");
 
                                // Add this ID
                                $IDs[$url] = $last;
@@ -1172,7 +1172,7 @@ ORDER BY
                        } // END - if
                } else {
                        // Debug message
-                       //DEBUG_LOG(__FUNCTION__.":ignore - lid={$lid},url={$url},last={$last}");
+                       //DEBUG_LOG(__FUNCTION__, __LINE__, "ignore - lid={$lid},url={$url},last={$last}");
 
                        // Ignore these old entries!
                        $ignored[] = $url;
@@ -1201,7 +1201,7 @@ WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND (sbu.views_allowed=0 OR (s
 GROUP BY sbu.id", __FILE__, __LINE__);
 
        // Log last query
-       //DEBUG_LOG(__FUNCTION__.":lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."");
 
        // Fetch max rand
        $maxRand = SQL_NUMROWS($result);
@@ -1317,7 +1317,7 @@ function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) {
                } // END - if
 
                // And query the database
-               //DEBUG_LOG(__FUNCTION__.":randNum={$randNum},maxRand={$maxRand},surfLock=".SURFBAR_GET_DATA('surf_lock')."");
+               //DEBUG_LOG(__FUNCTION__, __LINE__, "randNum={$randNum},maxRand={$maxRand},surfLock=".SURFBAR_GET_DATA('surf_lock')."");
                $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.views_total, sbu.views_max, sbu.views_allowed, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed
 FROM "._MYSQL_PREFIX."_surfbar_urls AS sbu
 LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs
@@ -1345,12 +1345,12 @@ LIMIT 1",
        }
 
        // Is there an id number?
-       //DEBUG_LOG(__FUNCTION__.":lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."");
        if (SQL_NUMROWS($result) == 1) {
                // Load/cache data
-               //DEBUG_LOG(__FUNCTION__.":count(".count($SURFBAR_CACHE).") - BEFORE");
+               //DEBUG_LOG(__FUNCTION__, __LINE__, "count(".count($SURFBAR_CACHE).") - BEFORE");
                $SURFBAR_CACHE = merge_array($SURFBAR_CACHE, SQL_FETCHARRAY($result));
-               //DEBUG_LOG(__FUNCTION__.":count(".count($SURFBAR_CACHE).") - AFTER");
+               //DEBUG_LOG(__FUNCTION__, __LINE__, "count(".count($SURFBAR_CACHE).") - AFTER");
 
                // Determine waiting time
                $SURFBAR_CACHE['time'] = SURFBAR_DETERMINE_WAIT_TIME();
@@ -1358,28 +1358,28 @@ LIMIT 1",
                // Is the last salt there?
                if (is_null($SURFBAR_CACHE['last_salt'])) {
                        // Then repair it wit the static!
-                       //DEBUG_LOG(__FUNCTION__.":last_salt - FIXED!");
+                       //DEBUG_LOG(__FUNCTION__, __LINE__, "last_salt - FIXED!");
                        $SURFBAR_CACHE['last_salt'] = "";
                } // END - if
 
                // Fix missing last_surfed
                if ((!isset($SURFBAR_CACHE['last_surfed'])) || (is_null($SURFBAR_CACHE['last_surfed']))) {
                        // Fix it here
-                       //DEBUG_LOG(__FUNCTION__.":last_surfed - FIXED!");
+                       //DEBUG_LOG(__FUNCTION__, __LINE__, "last_surfed - FIXED!");
                        $SURFBAR_CACHE['last_surfed'] = 0;
                } // END - if
 
                // Get base/fixed reward and costs
                $SURFBAR_CACHE['reward'] = SURFBAR_DETERMINE_REWARD();
                $SURFBAR_CACHE['costs']  = SURFBAR_DETERMINE_COSTS();
-               //DEBUG_LOG(__FUNCTION__.":BASE/STATIC - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
+               //DEBUG_LOG(__FUNCTION__, __LINE__, "BASE/STATIC - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
 
                // Only in dynamic model add the dynamic bonus!
                if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
                        // Calculate dynamic reward/costs and add it
                        $SURFBAR_CACHE['reward'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
                        $SURFBAR_CACHE['costs']  += SURFBAR_CALCULATE_DYNAMIC_ADD();
-                       //DEBUG_LOG(__FUNCTION__.":DYNAMIC+ - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
+                       //DEBUG_LOG(__FUNCTION__, __LINE__, "DYNAMIC+ - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
                } // END - if
 
                // Now get the id
@@ -1390,7 +1390,7 @@ LIMIT 1",
        SQL_FREERESULT($result);
 
        // Return result
-       //DEBUG_LOG(__FUNCTION__.":nextId={$nextId}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "nextId={$nextId}");
        return $nextId;
 }
 // -----------------------------------------------------------------------------
@@ -1400,7 +1400,7 @@ LIMIT 1",
 // Private getter for data elements
 function SURFBAR_GET_DATA ($element) {
        global $SURFBAR_CACHE;
-       //DEBUG_LOG(__FUNCTION__.":element={$element}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "element={$element}");
 
        // Default is null
        $data = null;
@@ -1417,7 +1417,7 @@ function SURFBAR_GET_DATA ($element) {
        }
 
        // Return result
-       //DEBUG_LOG(__FUNCTION__.":element[$element]={$data}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "element[$element]={$data}");
        return $data;
 }
 // Getter for reward from cache
index 115bec7..75cf35e 100644 (file)
@@ -37,6 +37,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
+// Add links for selecting some users
 function alpha($sortby, $colspan, $return=false)
 {
        global $_CONFIG;
@@ -86,7 +87,8 @@ function alpha($sortby, $colspan, $return=false)
                OUTPUT_HTML($OUT);
        }
 }
-//
+
+// Add links for sorting
 function SortLinks($letter, $sortby, $colspan, $return=false)
 {
        $OUT = "";
@@ -132,7 +134,8 @@ function SortLinks($letter, $sortby, $colspan, $return=false)
                OUTPUT_HTML($OUT);
        }
 }
-//
+
+// Add page navigation
 function ADD_PAGENAV($PAGES, $offset, $show_form, $colspan,$return=false)
 {
        if (!$show_form)
@@ -197,6 +200,7 @@ function ADD_PAGENAV($PAGES, $offset, $show_form, $colspan,$return=false)
                OUTPUT_HTML($OUT);
        }
 }
+
 // Create email link to user's account
 function USER_CREATE_EMAIL_LINK($email, $mod="admin")
 {
@@ -221,5 +225,42 @@ WHERE email='%s'".$locked." LIMIT 1",
        // Return rewritten (?) email address
        return $email;
 }
-//
+
+// Selects a random user id as the new referal id if they have at least X confirmed mails in this run
+function SELECT_RANDOM_REFID () {
+       global $_CONFIG;
+
+       // Default is zero refid
+       $refid = 0;
+
+       // Is the extension version fine?
+       if (GET_EXT_VERSION("user") >= "0.3.4") {
+               // Get all user ids
+               $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true, " AND `rand_confirmed` >= ".$_CONFIG['user_min_confirmed']."");
+
+               // Do we have at least one?
+               if ($totalUsers > 0) {
+                       // Then choose random number
+                       $randNum = mt_rand(0, ($totalUsers - 1));
+
+                       // Look for random user
+                       $result = SQL_QUERY_ESC("SELECT `userid` FROM `"._MYSQL_PREFIX."_user_data` WHERE `status`='CONFIRMED' AND `rand_confirmed` >= %s ORDER BY `rand_confirmed` DESC LIMIT %s, 1",
+                               array($_CONFIG['user_min_confirmed'], $randNum), __FILE__, __LINE__);
+
+                       // Do we have one entry there?
+                       if (SQL_NUMROWS($result) == 1) {
+                               // Use that userid as new referal id
+                               list($refid) = SQL_FETCHROW($result);
+                       } // END - if
+
+                       // Free result
+                       SQL_FREERESULT($result);
+               } // END - if
+       } // END - if
+
+       // Return result
+       return $refid;
+}
+
+// [EOF]
 ?>
index fed9c42..011e217 100644 (file)
@@ -340,7 +340,7 @@ function WERNIS_TAKE_FEE ($points, $mode) {
        //* DEBUG: */ echo "mode={$mode},points={$points}<br />\n";
        if (!in_array($mode, array('payout', 'withdraw'))) {
                // Log error and abort
-               DEBUG_LOG(__FUNCTION__.":uid={$GLOBALS['userid']},mode={$mode},points={$points}");
+               DEBUG_LOG(__FUNCTION__, __LINE__, "uid={$GLOBALS['userid']},mode={$mode},points={$points}");
                return false;
        } // END - if
 
@@ -391,7 +391,7 @@ function WERNIS_ADD_FEES_TO_ARRAY (&$array) {
        // Is the array an array? ;-)
        if (!is_array($array)) {
                // Log error and return
-               DEBUG_LOG(__FUNCTION__.": Type ".gettype($array)." != array.");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " Type ".gettype($array)." != array.");
                return;
        } // END - if
 
index 10132b6..6cf2f20 100644 (file)
@@ -64,10 +64,10 @@ function YOOMEDIDA_TEST_CONFIG ($data) {
        // Log the response if failed
        if (count($response) == 0) {
                // Queries depleted (as we count here!)
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): Requested depleted. Maxmimum was: ".$_CONFIG['yoomedia_requests_total']);
+               DEBUG_LOG(__FUNCTION__, __LINE__, " Requested depleted. Maxmimum was: ".$_CONFIG['yoomedia_requests_total']);
        } elseif (count($response) <= 10) {
                // Log serialized raw response
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): Raw response=".base64_encode(serialize($response)));
+               DEBUG_LOG(__FUNCTION__, __LINE__, " Raw response=".base64_encode(serialize($response)));
        } // END - if
 
        // Do we have some data there?
@@ -276,7 +276,7 @@ function YOOMEDIA_TRANSLATE_INDEX ($type, $index) {
                $return = $yoomediaTranslationTable[$type][$index];
        } else {
                // Not found!
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): type={$type},index={$index} not found.");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " type={$type},index={$index} not found.");
        }
 
        // Return value
@@ -296,7 +296,7 @@ function YOOMEDIA_TRANSLATE_ERROR ($errorCode) {
                $return = $yoomediaTranslationTable['error_codes'][$errorCode];
        } else {
                // Log missing entries
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): errorCode={$errorCode}");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " errorCode={$errorCode}");
        }
 
        // Return value
index 395bc3e..b99efa4 100644 (file)
@@ -913,7 +913,11 @@ function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions,
                        $content['sw'] = $SW;
 
                        // Then list it
-                       $OUT .= LOAD_TEMPLATE("admin_".$listType."_".$table."_row", true, $content);
+                       $OUT .= LOAD_TEMPLATE(sprintf("admin_%s_%s_row",
+                                       $listType,
+                                       $table
+                               ), true, $content
+                       );
 
                        // Switch color
                        $SW = 3 - $SW;
@@ -924,7 +928,11 @@ function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions,
        } // END - foreach
 
        // Load master template
-       LOAD_TEMPLATE("admin_".$listType."_".$table."", false, $OUT);
+       LOAD_TEMPLATE(sprintf("admin_%s_%s",
+                       $listType,
+                       $table
+               ), false, $OUT
+       );
 }
 // Change status of "build" list
 function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray) {
@@ -984,7 +992,12 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct
                        } // END - if
 
                        // Finish SQL statement
-                       $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." AND ".$statusColumn."='".$oldStatus."' LIMIT 1";
+                       $SQL = substr($SQL, 0, -1) . sprintf(" WHERE %s=%s AND %s='%s' LIMIT 1",
+                               $idColumn,
+                               bigintval($id),
+                               $statusColumn,
+                               $oldStatus
+                       );
 
                        // Run the SQL
                        SQL_QUERY($SQL, __FILE__, __LINE__);
index 7d88ace..7bc5d32 100644 (file)
@@ -47,13 +47,38 @@ if (isset($_POST['ok'])) {
        // Prepare contants for the template
        define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['def_refid'], false, true, true, "def_refid"));
 
-       switch ($_CONFIG['refid_target'])       {
-               case "index":    define('__DEF_RT_INDEX', " selected=\"selected\""); define('__DEF_RT_REGISTER', "");          break;
-               case "register": define('__DEF_RT_INDEX', "");          define('__DEF_RT_REGISTER', " selected=\"selected\""); break;
-       }
+       switch ($_CONFIG['refid_target']) {
+               case "index":
+                       define('__DEF_RT_INDEX'   , " selected=\"selected\"");
+                       define('__DEF_RT_REGISTER', "");
+                       break;
+
+               case "register":
+                       define('__DEF_RT_INDEX'   , "");
+                       define('__DEF_RT_REGISTER', " selected=\"selected\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['select_user_zero_refid']) {
+               case "Y":
+                       define('__RAND_REFID_Y', " selected=\"selected\"");
+                       define('__RAND_REFID_N', "");
+                       break;
+
+               case "N":
+                       define('__RAND_REFID_Y', "");
+                       define('__RAND_REFID_N', " selected=\"selected\"");
+                       break;
+       } // END - switch
+
+       // Prepare content
+       $content = array(
+               'user_min_confirmed' => $_CONFIG['user_min_confirmed']
+       );
 
        // Load template
-       LOAD_TEMPLATE("admin_config_refid");
+       LOAD_TEMPLATE("admin_config_refid", false, $content);
 }
-//
+
+// [EOF]
 ?>
index ce84588..9ecd2c4 100644 (file)
@@ -54,9 +54,19 @@ if (!empty($_GET['mode'])) {
 // Remember it
 define('__TITLE', $listHeader);
 
-$MORE = ", userid"; $colspan = "4"; //                 27
+// Init variables
+$MORE = ", userid"; $colspan = "4";
+
+// Add nickname if extension is found&active
 if (EXT_IS_ACTIVE("nickname")) { $MORE = ", nickname"; }
 
+// Add random confirmed if extension version matches
+if (GET_EXT_VERSION("user") >= "0.3.4") {
+       // Add it...
+       $MORE .= ", rand_confirmed";
+} // END - if
+
+// Init unset data (bad that we change $_GET here!)
 if (empty($_GET['letter'])) { $_GET['letter'] = _ALL2;    }
 if (empty($_GET['sortby'])) { $_GET['sortby'] = "userid"; }
 if (empty($_GET['page']))   { $_GET['page']   = "1";      }
@@ -68,57 +78,80 @@ if (!empty($_GET['u_id'])) {
        // Secure the user ID
        $uid = bigintval($_GET['u_id']);
 
-       // Does the account exists?        0      1        2         3       4     5      6       7         8          9          10           11           12         13     14         15           16          17            18           19           20           21        22        23             24              25         26
-       $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, zip, city, country, email, birth_day, birth_month, birth_year, max_mails, receive_mails, refid, status, REMOTE_ADDR, last_online, last_module, ref_clicks, total_logins, used_points, emails_sent, joined, last_update, last_profile_sent, notified, ref_payout".$MORE."
+       // Does the account exists?
+       $result_user = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, zip, city, country, email, birth_day, birth_month, birth_year, max_mails, receive_mails, refid, status, REMOTE_ADDR, last_online, last_module, ref_clicks, total_logins, used_points, emails_sent, joined, last_update, last_profile_sent, notified, ref_payout, emails_received, mails_confirmed".$MORE."
 FROM "._MYSQL_PREFIX."_user_data
-WHERE userid=%s LIMIT 1",
-        array($uid), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 1) {
+WHERE userid=%s
+LIMIT 1",
+               array($uid), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_user) == 1) {
                // Account found!
-               $DATA  = SQL_FETCHROW($result);
-               SQL_FREERESULT($result);
+               $DATA  = SQL_FETCHARRAY($result_user);
 
+               // Get count/sum of refs, selected categories, unconfirmed mails
                $REFS  = GET_TOTAL_DATA($uid, "refsystem", "counter");
                $CATS  = GET_TOTAL_DATA($uid, "user_cats", "id", "userid", true);
                $LINKS = GET_TOTAL_DATA($uid, "user_links", "id", "userid", true);
 
+               // Add links to the numbers
                if ($LINKS > 0) $LINKS = $BASE."&amp;what=list_links&amp;u_id=".$uid."\">".$LINKS."</A>]";
-               if ($DATA[13] > 0) $DATA[13] = str_replace(("u_id=".$uid), ("u_id=".$DATA[13]), $BASE."&amp;what=list_user\">".$DATA[13]."</A>]");
-               if (empty($DATA[17])) $DATA[17] = "---";
+               if ($DATA['refid'] > 0) $DATA['refid'] = $BASE."&amp;what=list_user&amp;u_id=".$DATA['refid']."\">".$DATA['refid']."</A>]";
+               if (empty($DATA['last_module'])) $DATA['last_module'] = "---";
                if ($REFS > 0) $REFS = $BASE."&amp;what=list_refs&amp;u_id=".$uid."\">".$REFS."</A>]";
                if ($CATS > 0) $CATS = $BASE."&amp;what=list_cats&amp;u_id=".$uid."\">".$CATS."</A>]";
 
                // Prepare data for template
-               define('_BIRTHDAY', MAKE_DATETIME(mktime(0, 0, 0, $DATA[9], $DATA[8], $DATA[10]), "3"));
+               define('_BIRTHDAY', MAKE_DATETIME(mktime(0, 0, 0, $DATA['birth_month'], $DATA['birth_day'], $DATA['birth_year']), "3"));
                define('_REFS' , $REFS);
                define('_CATS' , $CATS);
                define('_LINKS', $LINKS);
-               define('_ADMIN_LINKS', MEMBER_ACTION_LINKS($uid, $DATA[14]));
-               $DATA[0]      = TRANSLATE_GENDER($DATA[0]);
-               $DATA[28]     = CREATE_EMAIL_LINK($DATA[7], "user_data");
-               $DATA[14]     = TRANSLATE_STATUS($DATA[14]);
-               $DATA[16]     = MAKE_DATETIME($DATA[16], "0");
-               $DATA[20]     = TRANSLATE_COMMA($DATA[20]);
-               if ($DATA[21] > 0) $DATA[21] = $BASE."&amp;what=email_details&amp;u_id=".$uid."\">".TRANSLATE_COMMA($DATA[21])."</A>]";
-               $DATA[22]     = MAKE_DATETIME($DATA[22], "0");
-               $DATA[23]     = MAKE_DATETIME($DATA[23], "0");
-               $DATA[24]     = MAKE_DATETIME($DATA[24], "0");
-               if ((empty($DATA[27])) || ($DATA[27] == $uid)) $DATA[27] = "---";
-               $DATA['total']  = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points"));
-               $DATA['locked'] = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
-
+               define('_ADMIN_LINKS', MEMBER_ACTION_LINKS($uid, $DATA['status']));
+               $DATA['gender']            = TRANSLATE_GENDER($DATA['gender']);
+               $DATA['email_link']        = CREATE_EMAIL_LINK($DATA['email'], "user_data");
+               $DATA['status']            = TRANSLATE_STATUS($DATA['status']);
+               $DATA['last_online']       = MAKE_DATETIME($DATA['last_online'], "0");
+               $DATA['used_points']       = TRANSLATE_COMMA($DATA['used_points']);
+               if ($DATA['emails_sent'] > 0) $DATA['emails_sent'] = $BASE."&amp;what=email_details&amp;u_id=".$uid."\">".TRANSLATE_COMMA($DATA['emails_sent'])."</A>]";
+               $DATA['joined']            = MAKE_DATETIME($DATA['joined'], "0");
+               $DATA['last_update']       = MAKE_DATETIME($DATA['last_update'], "0");
+               $DATA['last_profile_sent'] = MAKE_DATETIME($DATA['last_profile_sent'], "0");
+               $DATA['total']             = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points"));
+               $DATA['locked']            = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
+
+               // Nickname inclusion?
                if (EXT_IS_ACTIVE("nickname")) {
-                       if ((empty($DATA[27])) || ($DATA[27] == $uid)) $DATA[27] = "---";
+                       // Nickname not set or invalid? Then 
+                       if ((empty($DATA['nickname'])) || ($DATA['nickname'] == $uid)) $DATA['nickname'] = "---";
                } else {
-                       $DATA[27] = EXT_NICKNAME_404;
+                       // Extension not found
+                       $DATA['nickname'] = EXT_NICKNAME_404;
                }
 
-               // Template laden
+               // Is the user extension newer?
+               if (GET_EXT_VERSION("user") >= "0.3.4") {
+                       // Then "translate" the number
+                       $DATA['rand_confirmed'] = TRANSLATE_COMMA($DATA['rand_confirmed']);
+               } // END - if
+
+               // Clickrate
+               $DATA['click_rate'] = 0;
+               if ($DATA['emails_received'] > 0) {
+                       $DATA['click_rate'] = TRANSLATE_COMMA($DATA['mails_confirmed'] / $DATA['emails_received'] * 100);
+               } // END - if
+
+               // "Translate" more data
+               $DATA['mails_confirmed'] = TRANSLATE_COMMA($DATA['mails_confirmed']);
+               $DATA['emails_received'] = TRANSLATE_COMMA($DATA['emails_received']);
+
+               // Load user-details template
                LOAD_TEMPLATE("admin_user_details", false, $uid);
        } else {
-               // Account does not exists!
+               // Account does not exist!
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_404_1.$uid.ADMIN_MEMBER_404_2);
        }
+
+       // Free the result
+       SQL_FREERESULT($result_user);
 } else {
        $whereStatement = "";
        if (($_GET['letter'] != _ALL2) && ($_GET['letter'] != _OTHERS) && (!empty($_GET['letter']))) {
index a41eb09..1f216e1 100644 (file)
@@ -204,14 +204,16 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1",
        {
                // Check if category and number of receivers is okay
                $ADD = "";
-               if (($_CONFIG['order_multi_page'] == "Y") && (!empty($_POST['zip']))) $ADD = "AND d.zip LIKE '".bigintval($_POST['zip'])."{PER}'";
+               if (($_CONFIG['order_multi_page'] == "Y") && (!empty($_POST['zip']))) {
+                       // Choose recipients by ZIP code
+                       $ADD = " AND d.zip LIKE '".bigintval($_POST['zip'])."{PER}'";
+               } // END - if
 
                // Check for userids
                $result = SQL_QUERY_ESC("SELECT DISTINCT c.userid FROM "._MYSQL_PREFIX."_user_cats AS c
 LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
 ON c.userid=d.userid
-WHERE c.cat_id=%s AND c.userid != '%s' AND d.status='CONFIRMED' AND d.receive_mails > 0
-".$ADD."
+WHERE c.cat_id=%s AND c.userid != '%s' AND d.status='CONFIRMED' AND d.receive_mails > 0".$ADD."
 ORDER BY d.%s %s",
  array(
        bigintval($_POST['cat']),
index 73d3a57..fde8d23 100644 (file)
@@ -57,7 +57,7 @@ if (($curr != $_CONFIG['last_month']) && ($_CONFIG['last_month'] > 0) && ($_CONF
                // Use last online stamp only when autopurge for inactive members is activated
                if (($_CONFIG['ap_inactive_since'] > 0) && ($_CONFIG['beg_active'] == "Y")) {
                        // Okay, include last online timestamp
-                       $whereStatement1 = sprintf("AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval($_CONFIG['ap_inactive_since']));;
+                       $whereStatement1 = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval($_CONFIG['ap_inactive_since']));;
                        $whereStatement2 = bigintval($_CONFIG['beg_ranks']);
                } // END - if
        } // END - if
@@ -65,7 +65,7 @@ if (($curr != $_CONFIG['last_month']) && ($_CONFIG['last_month'] > 0) && ($_CONF
        // SQL string to check for accounts
        $result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points AS points
 FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' ".$whereStatement1." AND beg_points > 0
+WHERE status='CONFIRMED'".$whereStatement1." AND beg_points > 0
 ORDER BY beg_points DESC, userid
 LIMIT %s",
                array($whereStatement2), __FILE__, __LINE__);
index 7bbaee5..a700311 100644 (file)
@@ -67,7 +67,7 @@ function __errorHandler ($errno, $errstr, $errfile, $errline) {
        );
 
        // Write debug log message
-       DEBUG_LOG(__FUNCTION__.":".$msg, true);
+       DEBUG_LOG(__FUNCTION__, __LINE__, "".$msg, true);
 
        // Output message to user and die
        if (EXT_IS_ACTIVE("debug")) {
index 00f7d15..28dd178 100644 (file)
@@ -335,11 +335,11 @@ function ADD_MENU($MODE, $act, $wht) {
 
        // Non-admin shall not see all menus
        if (!IS_ADMIN()) {
-               $AND = "AND visible='Y' AND locked='N'";
+               $AND = " AND visible='Y' AND locked='N'";
        }
 
        // Load SQL data and add the menu to the output stream...
-       $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE (what='' OR what IS NULL) ".$AND." ORDER BY sort",
+       $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE (what='' OR what IS NULL)".$AND." ORDER BY sort",
         array($MODE), __FILE__, __LINE__);
        //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
        if (SQL_NUMROWS($result_main) > 0) {
@@ -1076,16 +1076,16 @@ function REMOVE_RECEIVER(&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fal
 }
 
 // Calculate sum (default) or count records of given criteria
-function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false, $add="") {
+function GET_TOTAL_DATA ($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false, $add="") {
        $ret = 0;
-       if ($onlyRows) {
+       if (($onlyRows) || ($lookFor == "userid")) {
                // Count rows
-               $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `"._MYSQL_PREFIX."_%s` WHERE `%s`='%s'%s",
-                array($lookFor, $tableName, $whereStatement, $search, $add), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `"._MYSQL_PREFIX."_%s` WHERE `%s`='%s'".$add,
+                       array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__);
        } else {
                // Add all rows
-               $result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `"._MYSQL_PREFIX."_%s` WHERE `%s`='%s'%s",
-                array($lookFor, $tableName, $whereStatement, $search, $add), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `"._MYSQL_PREFIX."_%s` WHERE `%s`='%s'".$add,
+                       array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__);
        }
 
        // Load row
@@ -1866,7 +1866,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") {
        }
 
        // Run database update
-       //DEBUG_LOG(__FUNCTION__.":entries={$entries}");
+       //DEBUG_LOG(__FUNCTION__, __LINE__, "entries={$entries}");
        SQL_QUERY("UPDATE "._MYSQL_PREFIX."_config SET ".$entries." WHERE config=0 LIMIT 1", __FILE__, __LINE__);
 
        // Get affected rows
@@ -2199,7 +2199,7 @@ function USER_STATS_INSERT_RECORD ($uid, $type, $data) {
                        array(bigintval($uid), $type, $data), __FILE__, __LINE__);
        } elseif (is_array($data)) {
                // Invalid data!
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): uid={$uid},type={$type},data={".gettype($data).": Invalid statistics data type!");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " uid={$uid},type={$type},data={".gettype($data).": Invalid statistics data type!");
        }
 }
 
index 3170dc7..46dd7e3 100644 (file)
@@ -62,35 +62,8 @@ require_once(PATH."inc/language.php");
 // Load extensions here
 require_once(PATH."inc/load_extensions.php");
 
-// Check if refid is set
-if ((!empty($_GET['user'])) && ($CLICK == 1) && (basename($_SERVER['PHP_SELF']) == "click.php")) {
-       // The variable user comes from the click-counter script click.php and we only accept this here
-       $GLOBALS['refid'] = bigintval($_GET['user']);
-} elseif (!empty($_POST['refid'])) {
-       // Get referal id from variable refid (so I hope this makes my script more compatible to other scripts)
-       $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_POST['refid']));
-} elseif (!empty($_GET['refid'])) {
-       // Get referal id from variable refid (so I hope this makes my script more compatible to other scripts)
-       $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['refid']));
-} elseif (!empty($_GET['ref'])) {
-       // Set refid=ref (the referal link uses such variable)
-       $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['ref']));
-} elseif (isSessionVariableSet('refid')) {
-       // Set session refid als global
-       $GLOBALS['refid'] = bigintval(get_session('refid'));
-} elseif (GET_EXT_VERSION("sql_patches") != "") {
-       // Set default refid as refid in URL
-       $GLOBALS['refid'] = bigintval($_CONFIG['def_refid']);
-} else {
-       // No default ID when sql_patches is not installed
-       $GLOBALS['refid'] = 0;
-}
-
-// Set cookie when default refid > 0
-if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && (isset($_CONFIG['def_refid'])) && ($_CONFIG['def_refid'] > 0))) {
-       // Set cookie
-       set_session('refid', $GLOBALS['refid']);
-} // END - if
+// Determine and set referal id
+DETERMINE_REFID();
 
 // Transfer userid from session and validate it
 if (isset($_SESSION['userid'])) {
index 33c4aca..60ee809 100644 (file)
@@ -175,7 +175,7 @@ if (isBooleanConstantAndTrue('mxchange_installed'))
                                                                        switch ($ltype)
                                                                        {
                                                                        case "NORMAL":
-                                                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET clicks=clicks+1 WHERE id=%s LIMIT 1",
+                                                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
                                                                                 array($url_mid), __FILE__, __LINE__);
 
                                                                                // Update mediadata as well
@@ -187,7 +187,7 @@ if (isBooleanConstantAndTrue('mxchange_installed'))
                                                                                break;
 
                                                                        case "BONUS":
-                                                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET clicks=clicks+1 WHERE id=%s LIMIT 1",
+                                                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
                                                                                 array($url_bid), __FILE__, __LINE__);
 
                                                                                // Update mediadata as well
@@ -206,8 +206,15 @@ if (isBooleanConstantAndTrue('mxchange_installed'))
                                                                        // Only when user extension = v0.1.2: Update mails-confirmed counter
                                                                        if (GET_EXT_VERSION("user") >= "0.1.2") {
                                                                                // Update counter
-                                                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET mails_confirmed=mails_confirmed+1 WHERE userid=%s LIMIT 1",
-                                                                                array($url_uid), __FILE__, __LINE__);
+                                                                               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET mails_confirmed=mails_confirmed + 1 WHERE userid=%s LIMIT 1",
+                                                                                       array($url_uid), __FILE__, __LINE__);
+
+                                                                               // Update random confirmed as well?
+                                                                               if (GET_EXT_VERSION("user") >= "0.3.4") {
+                                                                                       // Update second counter
+                                                                                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET rand_confirmed=rand_confirmed + 1 WHERE userid=%s LIMIT 1",
+                                                                                               array($url_uid), __FILE__, __LINE__);
+                                                                               } // END - if
                                                                        }
 
                                                                        // Insert stats record
index de8157f..2fbda21 100644 (file)
@@ -1,49 +1,61 @@
-<FORM action="{!URL!}/modules.php?module=admin&amp;what=config_refid"
-       method="POST">
-<TABLE border="0" cellspacing="0" cellpadding="0" align="center"
-       class="admin_table dashed">
+<FORM action="{!URL!}/modules.php?module=admin&amp;what=config_refid" method="POST">
+<TABLE border="0" cellspacing="0" cellpadding="0" align="center" width="450" class="admin_table dashed">
        <TR>
-               <TD class="admin_title bottom2 seperator" height="30" width="10">&nbsp;</TD>
-               <TD class="admin_title bottom2" colspan="4" align="center"><STRONG>{--EDIT_REGFORM_SETTINGS--}</STRONG>
+               <TD class="admin_title2 bottom2" colspan="2" align="center">
+                       <STRONG>{--ADMIN_CONFIG_REFID_TITLE--}</STRONG>
                </TD>
-               <TD class="admin_title bottom2 seperator" width="10">&nbsp;</TD>
        </TR>
+
+       <TR><TD colspan="2" height="4" class="seperator">&nbsp;</TD></TR>
+
        <TR>
-               <TD colspan="6" height="7" class="seperator">&nbsp;</TD>
-       </TR>
-       <TR>
-               <TD width="10" class="seperator">&nbsp;</TD>
-               <TD align="right" width="200">{--ADMIN_SELECT_DEF_REFID--}:</TD>
-               <TD width="10" class="seperator">&nbsp;</TD>
-               <TD colspan="2">
+               <TD align="right" width="200" style="padding-right:5px">{--ADMIN_SELECT_DEF_REFID--}:</TD>
+               <TD align="center">
                        {!__MEMBER_SELECTION!}
                </TD>
-               <TD width="10" class="seperator">&nbsp;</TD>
        </TR>
+
+       <TR><TD colspan="2" height="4" class="seperator">&nbsp;</TD></TR>
+
        <TR>
-               <TD colspan="6" height="7" class="seperator">&nbsp;</TD>
+               <TD align="right" width="200" style="padding-right:5px">{--ADMIN_SELECT_REFID_TARGRT--}:</TD>
+               <TD align="center">
+                       <SELECT name="refid_target" size="1" class="admin_select">
+                               <OPTION value="register"{!__DEF_RT_REGISTER!}">{--ADMIN_REF_TARGET_REGISTER--}</OPTION>
+                               <OPTION value="index"{!__DEF_RT_INDEX!}">{--ADMIN_REF_TARGET_INDEX--}</OPTION>
+                       </SELECT>
+               </TD>
        </TR>
+
+       <TR><TD colspan="2" height="4" class="seperator bottom2">&nbsp;</TD></TR>
+       <TR><TD colspan="2" height="4" class="seperator">&nbsp;</TD></TR>
+
        <TR>
-               <TD width="10" class="seperator">&nbsp;</TD>
-               <TD align="right" width="200">{--ADMIN_SELECT_REFID_TARGRT--}:</TD>
-               <TD width="10" class="seperator">&nbsp;</TD>
-               <TD colspan="2"><SELECT name="refid_target" size="1"
-                       class="admin_select">
-                       <OPTION value="register"{!__DEF_RT_REGISTER!}">{--ADMIN_REF_TARGET_REGISTER--}</OPTION>
-                       <OPTION value="index"{!__DEF_RT_INDEX!}">{--ADMIN_REF_TARGET_INDEX--}</OPTION>
-               </SELECT></TD>
-               <TD width="10" class="seperator">&nbsp;</TD>
+               <TD align="right" width="200" style="padding-right:5px">{--ADMIN_RANDOM_ZERO_REFID--}:</TD>
+               <TD align="center">
+                       <SELECT name="select_user_zero_refid" size="1" class="admin_select">
+                               <OPTION value="Y"{!__RAND_REFID_Y!}">{--ADMIN_RAND_REFID_ENABLED--}</OPTION>
+                               <OPTION value="N"{!__RAND_REFID_N!}">{--ADMIN_RAND_REFID_DISABLED--}</OPTION>
+                       </SELECT>
+               </TD>
        </TR>
+
+       <TR><TD colspan="2" height="4" class="seperator">&nbsp;</TD></TR>
+
        <TR>
-               <TD colspan="6" height="7" class="seperator bottom2">&nbsp;</TD>
+               <TD align="right" width="200" style="padding-right:5px">{--ADMIN_RANDOM_MIN_CONFIRMED--}:</TD>
+               <TD align="center">
+                       <INPUT type="text" name="user_min_confirmed" class="admin_normal" size="3" maxlength="3" value="$content[user_min_confirmed]" />
+               </TD>
        </TR>
+
+       <TR><TD colspan="2" height="4" class="seperator bottom2">&nbsp;</TD></TR>
+
        <TR>
-               <TD width="10" class="admin_footer seperator">&nbsp;</TD>
-               <TD class="admin_footer" colspan="4" align="center"><INPUT
-                       type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
-               <INPUT type="submit" name="ok" class="admin_submit"
-                       value="{--SAVE_SETTINGS--}" /></TD>
-               <TD width="10" class="admin_footer seperator">&nbsp;</TD>
+               <TD class="admin_footer" colspan="2" align="center">
+                       <INPUT type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
+                       <INPUT type="submit" name="ok" class="admin_submit" value="{--SAVE_SETTINGS--}" />
+               </TD>
        </TR>
 </TABLE>
-</FORM>
\ No newline at end of file
+</FORM>
index f0ef072..9afdf66 100644 (file)
@@ -7,55 +7,55 @@
        </TR>
        <TR>
                <TD align="center" width="20%" class="top right">{--GENDER--}:<BR />
-               <STRONG>$DATA[0]</STRONG></TD>
+               <STRONG>$DATA[gender]</STRONG></TD>
                <TD align="center" width="20%" class="top right">{--SURNAME--}:<BR />
-               <STRONG>$DATA[1]</STRONG></TD>
+               <STRONG>$DATA[surname]</STRONG></TD>
                <TD align="center" width="20%" class="top right">{--FAMILY_NAME--}:<BR />
-               <STRONG>$DATA[2]</STRONG></TD>
+               <STRONG>$DATA[family]</STRONG></TD>
                <TD align="center" width="20%" class="top right">{--STREET_NR--}:<BR />
-               <STRONG>$DATA[3]</STRONG></TD>
+               <STRONG>$DATA[street_nr]</STRONG></TD>
                <TD align="center" width="20%" class="top">{--BIRTHDAY2--}:<BR />
                <STRONG>{!_BIRTHDAY!}</STRONG></TD>
        </TR>
        <TR>
                <TD align="center" class="top right">{--COUNTRY--}:<BR />
-               <STRONG>$DATA[6]</STRONG></TD>
+               <STRONG>$DATA[country]</STRONG></TD>
                <TD align="center" class="top right">{--ZIP--}:<BR />
-               <STRONG>$DATA[4]</STRONG></TD>
+               <STRONG>$DATA[zip]</STRONG></TD>
                <TD align="center" class="top right">{--CITY--}:<BR />
-               <STRONG>$DATA[5]</STRONG></TD>
+               <STRONG>$DATA[city]</STRONG></TD>
                <TD align="center" class="top right">{--ADDY--}:<BR />
-               <STRONG><A href="$DATA[28]">$DATA[7]</A></TD>
+               <STRONG><A href="$DATA[email_link]">$DATA[email]</A></TD>
                <TD align="center" class="top">{--ACCOUNT_STATUS--}:<BR />
-               <STRONG>$DATA[14]</STRONG></TD>
+               <STRONG>$DATA[status]</STRONG></TD>
        </TR>
        <TR>
                <TD align="center" class="top right">{--RECEIVE_MAILS--}:<BR />
-               <STRONG>$DATA[12]</STRONG></TD>
+               <STRONG>$DATA[receive_mails]</STRONG></TD>
                <TD align="center" class="top right">{--MAX_PER_DAY--}:<BR />
-               <STRONG>$DATA[11]</TD>
+               <STRONG>$DATA[max_mails]</TD>
                <TD align="center" class="top right">{--REF_UID--}:<BR />
-               <STRONG>$DATA[13]</STRONG></TD>
+               <STRONG>$DATA[refid]</STRONG></TD>
                <TD align="center" class="top right">{--REF_CLICKS--}:<BR />
-               <STRONG>$DATA[18]</STRONG></TD>
+               <STRONG>$DATA[ref_clicks]</STRONG></TD>
                <TD align="center" class="top">{--TOTAL_LOGINS--}:<BR />
-               <STRONG>$DATA[19]</STRONG></TD>
+               <STRONG>$DATA[total_logins]</STRONG></TD>
        </TR>
        <TR>
                <TD align="center" class="top right">{--REMOTE_IP--}:<BR />
-               <STRONG>$DATA[15]</STRONG></TD>
+               <STRONG>$DATA[REMOTE_ADDR]</STRONG></TD>
                <TD align="center" class="top right">{--ADMIN_LAST_ONLINE--}:<BR />
-               <STRONG>$DATA[16]</STRONG></TD>
+               <STRONG>$DATA[last_online]</STRONG></TD>
                <TD align="center" class="top right">{--ADMIN_LAST_MODULE--}:<BR />
-               <STRONG>$DATA[17]</STRONG></TD>
+               <STRONG>$DATA[last_module]</STRONG></TD>
                <TD align="center" class="top right">{--HAS_JOINED--}:<BR />
-               <STRONG>$DATA[22]</STRONG></TD>
+               <STRONG>$DATA[joined]</STRONG></TD>
                <TD align="center" class="top">{--MAILS_SENT--}:<BR />
-               <STRONG>$DATA[21]</STRONG></TD>
+               <STRONG>$DATA[emails_sent]</STRONG></TD>
        </TR>
        <TR>
                <TD align="center" class="top right">{--USED_POINTS--}:<BR />
-               <STRONG>$DATA[20]</STRONG></TD>
+               <STRONG>$DATA[used_points]</STRONG></TD>
                <TD align="center" class="top right">{--TOTAL_POINTS--}:<BR />
                <STRONG>$DATA[total]</STRONG></TD>
                <TD align="center" class="top right">{--TOTAL_REFERRALS--}:<BR />
                <TD align="center" class="top right">{--LOCKED_POINTS--}:<BR />
                <STRONG>$DATA[locked]</STRONG></TD>
                <TD align="center" class="top right">{--LAST_UPDATE--}:<BR />
-               <STRONG>$DATA[23]</STRONG></TD>
+               <STRONG>$DATA[last_update]</STRONG></TD>
                <TD align="center" class="top right">{--LAST_PROFILE_SENT--}:<BR />
-               <STRONG>$DATA[24]</STRONG></TD>
+               <STRONG>$DATA[last_profile_sent]</STRONG></TD>
                <TD align="center" class="top right">{--USER_REF_PAYOUT--}:<BR />
-               <STRONG>$DATA[26]</STRONG></TD>
+               <STRONG>$DATA[ref_payout]</STRONG></TD>
                <TD align="center" class="top">{--USER_NICKNAME--}:<BR />
-               <STRONG>$DATA[27]</STRONG></TD>
+               <STRONG>$DATA[nickname]</STRONG></TD>
+       </TR>
+       <TR>
+               <TD align="center" class="top right">{--CLICK_RATE--}:<BR />
+               <STRONG>$DATA[click_rate]%</STRONG></TD>
+               <TD align="center" class="top right">{--EMAILS_RECEIVED--}:<BR />
+               <STRONG>$DATA[emails_received]</STRONG></TD>
+               <TD align="center" class="top right">{--MAILS_CONFIRMED--}:<BR />
+               <STRONG>$DATA[mails_confirmed]</STRONG></TD>
+               <TD align="center" class="top right">{--RAND_CONFIRMED--}:<BR />
+               <STRONG>$DATA[rand_confirmed]</STRONG></TD>
+               <TD align="center" class="top">{--__UNUSED--}:<BR />
+               <STRONG>---</STRONG></TD>
        </TR>
        <TR>
                <TD align="center" class="admin_footer top" colspan="5">
-               {--ADMIN_MEMBER_FUNCTIONS--}:<BR />
+               <STRONG>{--ADMIN_MEMBER_FUNCTIONS--}:</STRONG><BR />
                {!_ADMIN_LINKS!}</TD>
        </TR>
 </TABLE>
\ No newline at end of file
index 2c45b0d..8194fa6 100644 (file)
--- a/view.php
+++ b/view.php
@@ -62,11 +62,10 @@ if (((!empty($_GET['user'])) || (!empty($_GET['reseller']))) && (!empty($_GET['b
                // Free memory
                SQL_FREERESULT($result);
        }
-       exit();
 } else {
        // Do nothing for now
        LOAD_URL (URL."/index.php");
 }
 
-//
+// // END - if
 ?>