Refback and referal points hopefully fixed:
authorRoland Häder <roland@mxchange.org>
Fri, 15 Jul 2011 01:21:46 +0000 (01:21 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 15 Jul 2011 01:21:46 +0000 (01:21 +0000)
- All userids are now initialized NULL and not '0'
- Template added for deleted bonus mails
- Handling of refback and referal points now fully fixed (I hope so)
- Several debug lines extended with more debugging data
- TODOs.txt updated

26 files changed:
.gitattributes
DOCS/TODOs.txt
inc/extensions/ext-surfbar.php
inc/filter-functions.php
inc/filter/mediadata_filter.php
inc/filter/online_filter.php
inc/filters.php
inc/functions.php
inc/language/bonus_de.php
inc/language/mailid_de.php
inc/libs/doubler_functions.php
inc/libs/mediadata_functions.php
inc/libs/refback_functions.php
inc/libs/surfbar_functions.php
inc/libs/user_functions.php
inc/modules/guest/what-login.php
inc/mysql-manager.php
inc/purge/purge-general.php
inc/referal-functions.php
inc/template-functions.php
inc/wrapper-functions.php
mailid_top.php
show_bonus.php
templates/de/html/mailid/mailid_points_failed2.tpl [new file with mode: 0644]
templates/de/html/show_bonus_msg.tpl
theme/default/css/mailid.css

index 850311d11a25e2f46d97e0b254bccfb87e98e53c..576fc54534100eedb582914434f114c509e64b9f 100644 (file)
@@ -1635,6 +1635,7 @@ templates/de/html/mailid/mailid_frames.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_done.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_done2.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_failed.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_done.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_done2.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_failed.tpl svneol=native#text/plain
+templates/de/html/mailid/mailid_points_failed2.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_locked.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_locked2.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_timer.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_locked.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_points_locked2.tpl svneol=native#text/plain
 templates/de/html/mailid/mailid_timer.tpl svneol=native#text/plain
index 755bab4c48dd588863a426e7befe637cb3537cae..cf8ac019abcd9ebe07ce11077a1816241970c71f 100644 (file)
@@ -66,7 +66,7 @@
 ./inc/libs/admins_functions.php:474:           // @TODO This can be, somehow, rewritten
 ./inc/libs/bonus_functions.php:194:            // @TODO Move this HTML to a template
 ./inc/libs/doubler_functions.php:44:// @TODO Lame description
 ./inc/libs/admins_functions.php:474:           // @TODO This can be, somehow, rewritten
 ./inc/libs/bonus_functions.php:194:            // @TODO Move this HTML to a template
 ./inc/libs/doubler_functions.php:44:// @TODO Lame description
-./inc/libs/doubler_functions.php:91:                   // @TODO Can't this be moved into EL?
+./inc/libs/doubler_functions.php:93:                   // @TODO Can't this be moved into EL?
 ./inc/libs/mailid_functions.php:47:            // @TODO Rewrite this to a dynamic include or so
 ./inc/libs/rallye_functions.php:439:   // @TODO Deprecated variable and global statement, please try to rewrite this
 ./inc/libs/rallye_functions.php:704:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
 ./inc/libs/mailid_functions.php:47:            // @TODO Rewrite this to a dynamic include or so
 ./inc/libs/rallye_functions.php:439:   // @TODO Deprecated variable and global statement, please try to rewrite this
 ./inc/libs/rallye_functions.php:704:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
@@ -76,8 +76,8 @@
 ./inc/libs/register_functions.php:290: // @TODO Rewrite these all to a single filter
 ./inc/libs/sponsor_functions.php:159:                                  // @TODO Rewrite this to API function
 ./inc/libs/sponsor_functions.php:430:                  // @TODO Rewrite this to API function
 ./inc/libs/register_functions.php:290: // @TODO Rewrite these all to a single filter
 ./inc/libs/sponsor_functions.php:159:                                  // @TODO Rewrite this to API function
 ./inc/libs/sponsor_functions.php:430:                  // @TODO Rewrite this to API function
-./inc/libs/surfbar_functions.php:1621:         // @TODO This can be somehow rewritten
-./inc/libs/surfbar_functions.php:729:// @TODO Can't we use our new expression language instead of this ugly code?
+./inc/libs/surfbar_functions.php:1623:         // @TODO This can be somehow rewritten
+./inc/libs/surfbar_functions.php:731:// @TODO Can't we use our new expression language instead of this ugly code?
 ./inc/libs/task_functions.php:247:             // @TODO These can be rewritten to filter
 ./inc/libs/task_functions.php:51:// @TODO Move all extension-dependent queries into filters
 ./inc/libs/theme_functions.php:93:     // @TODO Can't this be rewritten to an API function?
 ./inc/libs/task_functions.php:247:             // @TODO These can be rewritten to filter
 ./inc/libs/task_functions.php:51:// @TODO Move all extension-dependent queries into filters
 ./inc/libs/theme_functions.php:93:     // @TODO Can't this be rewritten to an API function?
 ./inc/modules/member/what-unconfirmed.php:227:                         // @TODO This 'userid' cannot be saved because of encapsulated EL code
 ./inc/modules/order.php:74:            // @TODO Unused: 2,4
 ./inc/monthly/monthly_bonus.php:64:    // @TODO Rewrite this to a filter
 ./inc/modules/member/what-unconfirmed.php:227:                         // @TODO This 'userid' cannot be saved because of encapsulated EL code
 ./inc/modules/order.php:74:            // @TODO Unused: 2,4
 ./inc/monthly/monthly_bonus.php:64:    // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1249:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1313:          // @TODO Rewrite these lines to a filter
-./inc/mysql-manager.php:1337:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1596:                  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1640:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1251:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1315:          // @TODO Rewrite these lines to a filter
+./inc/mysql-manager.php:1339:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1598:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1642:// @TODO Fix inconsistency between last_module and getWhat()
 ./inc/mysql-manager.php:371:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
 ./inc/mysql-manager.php:371:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
 ./mailid_top.php:192:                                                                  // @TODO Rewrite this to a filter
 ./mailid_top.php:227:                                                                  // @TODO Rewrite these blocks to filter
 ./network-check.php:54:// @TODO Add processing of request here
 ./mailid_top.php:192:                                                                  // @TODO Rewrite this to a filter
 ./mailid_top.php:227:                                                                  // @TODO Rewrite these blocks to filter
 ./network-check.php:54:// @TODO Add processing of request here
-./show_bonus.php:105:                  // @TODO No more needed? $content['points'] = translateComma($content['points']);
 ./view.php:68:         // @TODO No banner found, output some default banner
 ./templates/de/html/admin/admin_add_country.tpl:23:                    <!-- @TODO Rewrite this selection box to our generic functions //-->
 ./templates/de/html/admin/admin_admins_contct_form.tpl:4:      <!-- @TODO Shouldn't we add a title here? //-->
 ./view.php:68:         // @TODO No banner found, output some default banner
 ./templates/de/html/admin/admin_add_country.tpl:23:                    <!-- @TODO Rewrite this selection box to our generic functions //-->
 ./templates/de/html/admin/admin_admins_contct_form.tpl:4:      <!-- @TODO Shouldn't we add a title here? //-->
index 3c1902ebffea3a3a639aef1dac18f316f4023b1d..199fcef0cd05f4b6750bda4f9851c11c9623a178 100644 (file)
@@ -55,7 +55,7 @@ switch (getExtensionMode()) {
                addDropTableSql('surfbar_urls');
                addCreateTableSql('surfbar_urls', "
 `url_id` BIGINT(20) UNSIGNED  NOT NULL AUTO_INCREMENT,
                addDropTableSql('surfbar_urls');
                addCreateTableSql('surfbar_urls', "
 `url_id` BIGINT(20) UNSIGNED  NOT NULL AUTO_INCREMENT,
-`url_userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
+`url_userid` BIGINT(20) UNSIGNED  NULL DEFAULT NULL,
 `url` VARCHAR(255) NOT NULL DEFAULT '',
 `url_last_salt` VARCHAR(255) NOT NULL DEFAULT '',
 `url_views_total` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
 `url` VARCHAR(255) NOT NULL DEFAULT '',
 `url_last_salt` VARCHAR(255) NOT NULL DEFAULT '',
 `url_views_total` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
index d4d890b7c59a3c94bfb07143e1ff74354fc2c32c..615bdba025207b71b8b86a4cb63cd35ef4c8aac5 100644 (file)
@@ -275,6 +275,7 @@ function runFilterChain ($filterName, $filterData = null) {
        } // END - if
 
        // Default return value
        } // END - if
 
        // Default return value
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',count()=' . count($GLOBALS['cache_array']['filter']['chains'][$filterName]));
        $returnValue = $filterData;
 
        // Then run all filters
        $returnValue = $filterData;
 
        // Then run all filters
index 4b28c25e3afbdf2933bc9af0938b59a42e356b7b..3194c66b014bac0470db96d4ff55df2b63ad7c9a 100644 (file)
@@ -43,11 +43,11 @@ if (!defined('__SECURITY')) {
 // Filter for updating media data
 function FILTER_UPDATE_MEDIADATA_ENTRY ($filterData) {
        // Execute the filter function
 // Filter for updating media data
 function FILTER_UPDATE_MEDIADATA_ENTRY ($filterData) {
        // Execute the filter function
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added[' . gettype($filterData['added']) . ']=' . intval($filterData['added']) . ' - Called!');
        $filterData['added'] = ($filterData['added'] === true && updateMediadataEntry(array('total_points'), $filterData['mode'], $filterData['points']));
 
        // Return data
        $filterData['added'] = ($filterData['added'] === true && updateMediadataEntry(array('total_points'), $filterData['mode'], $filterData['points']));
 
        // Return data
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added[' . gettype($filterData['added']) . ']=' . intval($filterData['added']) . ' - Done!');
        return $filterData;
 }
 
        return $filterData;
 }
 
index e438cc3651217d6361ccb8348d9bddfe2653cde8..9c4855ab1890ee9ea1b462395262bac375004287 100644 (file)
@@ -56,7 +56,7 @@ function FILTER_UPDATE_ONLINE_LIST ($filterData) {
        } // END - if
 
        // Initialize variables
        } // END - if
 
        // Initialize variables
-       $userid = '0';
+       $userid   = NULL;
        $isMember = convertBooleanToYesNo(isMember());
        $isAdmin  = convertBooleanToYesNo(isAdmin());
        $action   = getActionFromModuleWhat(getModule(), getWhat());
        $isMember = convertBooleanToYesNo(isMember());
        $isAdmin  = convertBooleanToYesNo(isAdmin());
        $action   = getActionFromModuleWhat(getModule(), getWhat());
index b0ed40a050b7036a77c498f571fbcfae054f491f..3cd51808454fe7031598e8ed8029df251309668f 100644 (file)
@@ -971,9 +971,11 @@ function FILTER_FLUSH_TEMPLATE_CACHE () {
 }
 
 // Filter for loading user data
 }
 
 // Filter for loading user data
-function FILTER_FETCH_USER_DATA ($userid = 0) {
+function FILTER_FETCH_USER_DATA ($userid = NULL) {
        // Is the userid not set? Then use member id
        // Is the userid not set? Then use member id
-       if (($userid == '0') || (is_null($userid))) $userid = getMemberId();
+       if (!isValidUserId($userid)) {
+               $userid = getMemberId();
+       } // END - if
 
        // Get user data
        if (!fetchUserData($userid)) {
 
        // Get user data
        if (!fetchUserData($userid)) {
index 2dddd0d30fa38a87429d51d50af2a2c66e1f976e..a14ad083909ab1b1ff0ecffa1f698fdce9626594 100644 (file)
@@ -1406,7 +1406,7 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $inserted, $seek=0
 }
 
 // Send notification to admin
 }
 
 // Send notification to admin
-function sendAdminNotification ($subject, $templateName, $content = array(), $userid = '0') {
+function sendAdminNotification ($subject, $templateName, $content = array(), $userid = NULL) {
        if ((isExtensionInstalledAndNewer('admins', '0.4.1')) && (function_exists('sendAdminsEmails'))) {
                // Send new way
                /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'admins=Y,subject=' . $subject . ',templateName=' . $templateName);
        if ((isExtensionInstalledAndNewer('admins', '0.4.1')) && (function_exists('sendAdminsEmails'))) {
                // Send new way
                /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'admins=Y,subject=' . $subject . ',templateName=' . $templateName);
index 27fcdab34e2bc1c205301eef0306f630cec2b5ca..d5de40d6bccc28a22ea6e83c49db21309b8bd247 100644 (file)
@@ -122,6 +122,8 @@ addMessages(array(
        'ADMIN_NO_NOTIFICATIONS' => "Keine Benachrichtigungen gefunden.",
        'ADMIN_LINKS_BONUS_MAIL_TITLE' => "Bonus-Mail <span class=\"data\">%s</span>:",
        'ADMIN_EDIT_BONUS_EMAIL_TITLE' => "Daten der Bonus-Mail Nr. <span class=\"data\">%s</span> &auml;ndern",
        'ADMIN_NO_NOTIFICATIONS' => "Keine Benachrichtigungen gefunden.",
        'ADMIN_LINKS_BONUS_MAIL_TITLE' => "Bonus-Mail <span class=\"data\">%s</span>:",
        'ADMIN_EDIT_BONUS_EMAIL_TITLE' => "Daten der Bonus-Mail Nr. <span class=\"data\">%s</span> &auml;ndern",
+       'MONTHLY_BONUS_RALLYE_GOOD_LUCK' => "Wir w&uuml;nschen allen Mitgliedern viel Gl&uuml;ck bei der monatlichen Aktiv-Rallye!",
+       'MONTHLY_BONUS_RALLYE_RANKS_NOTE' => "Es k&ouml;nnen nur die ersten <span class=\"data\">{?bonus_ranks?}</span> die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.",
 
        // Switches
        'ADMIN_CONFIG_BONUS_RALLYE_IS_ACTIVE'       => "Ist die Aktiv-Rallye aktiv?",
 
        // Switches
        'ADMIN_CONFIG_BONUS_RALLYE_IS_ACTIVE'       => "Ist die Aktiv-Rallye aktiv?",
index 9e4dd191669dda0951bf60e2a131b482f5641331..ebbf09cb8545a65127a4f0c66ffe9359fbebb8c2 100644 (file)
@@ -47,6 +47,7 @@ addMessages(array(
        'MEMBER_THANX_POINTS_ADDED' => "Vielen Dank f&uuml;r die Best&auml;tigung der Mail. Die <span class=\"data\">{%%pipe,translateComma=%s%%}</span> {?POINTS?} wurden Ihnen gerade gutgeschrieben.",
        'MEMBER_THANX_POINTS_LOCKED' => "Vielen Dank f&uuml;r die Best&auml;tigung der Mail. Die <span class=\"data\">{%%pipe,translateComma=%s%%}</span> {?POINTS?} werden Ihnen bald gutgeschrieben.",
        'MEMBER_POINTS_NOT_ADDED' => "Falscher Best&auml;tigungscode eingegeben! Die <span class=\"data\">{%%pipe,translateComma=%s%%}</span> {?POINTS?} wurden dem Versender wieder gutgeschrieben.",
        'MEMBER_THANX_POINTS_ADDED' => "Vielen Dank f&uuml;r die Best&auml;tigung der Mail. Die <span class=\"data\">{%%pipe,translateComma=%s%%}</span> {?POINTS?} wurden Ihnen gerade gutgeschrieben.",
        'MEMBER_THANX_POINTS_LOCKED' => "Vielen Dank f&uuml;r die Best&auml;tigung der Mail. Die <span class=\"data\">{%%pipe,translateComma=%s%%}</span> {?POINTS?} werden Ihnen bald gutgeschrieben.",
        'MEMBER_POINTS_NOT_ADDED' => "Falscher Best&auml;tigungscode eingegeben! Die <span class=\"data\">{%%pipe,translateComma=%s%%}</span> {?POINTS?} wurden dem Versender wieder gutgeschrieben.",
+       'MEMBER_POINTS_NOT_ADDED2' =>"Falscher Best&auml;tigungscode eingegeben! Die <span class=\"data\">{%%pipe,translateComma=%s%%}</span> {?POINTS?} wurden Ihnen nicht gutgeschrieben.",
        'MEMBER_ENTER_CODE' => "Code eingeben",
        'MEMBER_TIME_COUNTER_1' => "Gutschrift der {?POINTS?} erfolgt in <span class=\"data\">",
        'MEMBER_TIME_COUNTER_2' => "</span> ...",
        'MEMBER_ENTER_CODE' => "Code eingeben",
        'MEMBER_TIME_COUNTER_1' => "Gutschrift der {?POINTS?} erfolgt in <span class=\"data\">",
        'MEMBER_TIME_COUNTER_2' => "</span> ...",
index 94148e21bc63f7d3976ee259e5692a9e4afb209e..f5f7a233539a60c710032d2a74ef0b163bf62192 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
 
 // Generates a HTML table based on given data
 // @TODO Lame description
 
 // Generates a HTML table based on given data
 // @TODO Lame description
-function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') {
+function generateDoublerTable ($userid = NULL, $done = 'N', $ref = 'N', $sort = 'ASC') {
        $add = ''; $DT_MODE = '0';
        if (isValidUserId($userid)) {
                // Load entries only from a single user
        $add = ''; $DT_MODE = '0';
        if (isValidUserId($userid)) {
                // Load entries only from a single user
@@ -72,7 +72,9 @@ function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = '
 FROM
        `{?_MYSQL_PREFIX?}_doubler`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_doubler`
 WHERE
-       `completed`='%s' AND `is_ref`='%s'" . $add . "
+       `completed`='%s' AND
+       `is_ref`='%s'
+       " . $add . "
 ORDER BY
        `timemark` %s
 LIMIT %s",
 ORDER BY
        `timemark` %s
 LIMIT %s",
index 60b713ae1d207585c63b101bc40e8f7ca63b1024..546d44a18c0a6087b3ddbab4c2c793e47ae382f3 100644 (file)
@@ -42,8 +42,9 @@ if (!defined('__SECURITY')) {
 
 // Update an entry
 function updateMediadataEntry ($keys_array, $mode, $value) {
 
 // Update an entry
 function updateMediadataEntry ($keys_array, $mode, $value) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keys_array[]=' . gettype($keys_array) . ',mode=' . $mode . ',value=' . $value . ' - ENTERED!');
        // Default is nothing added/updated
        // Default is nothing added/updated
-       $added = null;
+       $added = false;
 
        // Do we have entries?
        if (is_array($keys_array) && ($value > 0)) {
 
        // Do we have entries?
        if (is_array($keys_array) && ($value > 0)) {
@@ -55,8 +56,9 @@ function updateMediadataEntry ($keys_array, $mode, $value) {
 FROM
        `{?_MYSQL_PREFIX?}_mediadata`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_mediadata`
 WHERE
-       `media_key` = '%s'
+       `media_key`='%s'
 LIMIT 1", array($key), __FUNCTION__, __LINE__);
 LIMIT 1", array($key), __FUNCTION__, __LINE__);
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',SQL_NUMROWS()=' . SQL_NUMROWS($result_media));
                        if (SQL_NUMROWS($result_media) == 0) {
                                // Not found so we create it (mode will be ignored here!)
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mediadata` (`media_key`, `media_value`) VALUES ('%s', '%s')",
                        if (SQL_NUMROWS($result_media) == 0) {
                                // Not found so we create it (mode will be ignored here!)
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mediadata` (`media_key`, `media_value`) VALUES ('%s', '%s')",
@@ -79,16 +81,9 @@ LIMIT 1", array($key), __FUNCTION__, __LINE__);
                                }
                        }
 
                                }
                        }
 
-                       // Check affected rows
-                       if (is_null($added)) {
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
-                               $added = (!SQL_HASZEROAFFECTED());
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
-                       } else {
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
-                               $added = ($added && (!SQL_HASZEROAFFECTED()));
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
-                       }
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added=' . intval($added));
+                       $added = (!SQL_HASZEROAFFECTED());
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added=' . intval($added));
                } // END - foreach
        } // END - if
 
                } // END - foreach
        } // END - if
 
@@ -99,6 +94,7 @@ LIMIT 1", array($key), __FUNCTION__, __LINE__);
        } // END - if
 
        // Return result
        } // END - if
 
        // Return result
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keys_array[]=' . gettype($keys_array) . ',mode=' . $mode . ',value=' . $value . ',added=' . intval($added) . ' - EXIT!');
        return $added;
 }
 
        return $added;
 }
 
index 59336045ee583af438905b60294043ed5c979e9d..5938bd79bf606dc7c665036ac70e95576c11ccb8 100644 (file)
@@ -55,38 +55,42 @@ function addRefbackPoints ($userid, $ref, $points, $ref_points) {
 
        // "Walk" through all level
        while ($content = SQL_FETCHARRAY($result_refs)) {
 
        // "Walk" through all level
        while ($content = SQL_FETCHARRAY($result_refs)) {
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'level=' . $content['level'] . ',percents=' . $content['percents'] . ' - LOOP START!');
                // Reset ref depths
                initReferalSystem();
 
                // Reset ref depths
                initReferalSystem();
 
-               // "Walk" through all refids
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',level=' . $content['level'] . ',percents=' . $content['refback_percents'] . ',points=' . $points . ' - LOOP START!');
-               foreach (getArrayFromRefbackLevel($userid, $content['level']) as $refid) {
-                       // Skip level zero or if both are the same
-                       if ($userid == $refid) {
-                               continue;
-                       } // END - if
+               // Init array
+               $refids = getArrayFromRefbackLevel($userid, $content['level']);
 
 
-                       // Get refback percents
-                       $percents = getRefbackPercents($userid, $refid);
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',refid=' . $refid . ',points=' . $points . ',percents=' . $percents);
+               // "Walk" through all refids
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',level=' . $content['level'] . ',percents=' . $content['percents'] . ',points=' . $points . ' - LOOP START!');
+               foreach ($refids as $refid) {
+                       /*
+                        * Get refback percents, do not swap $refid and $userid by the next
+                        * call. If you do so, you will check the wrong direction, $userid
+                        * is always bigger than $refid.
+                        */
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero($refid) . ' - CALLING getRefbackPercents()');
+                       $content['refback_percents'] = getRefbackPercents($refid, $userid);
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero($refid) . ',refback_percents=' . $content['refback_percents']);
 
                        // Some percents given?
 
                        // Some percents given?
-                       if ($percents > 0) {
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'points=' . $points . ',refback_percents=' . $content['refback_percents'] . ',percents=' . $percents . ',level=' . $content['level']);
+                       if ($content['refback_percents'] > 0) {
                                // Calculate points for refback
                                // Calculate points for refback
-                               $refback = $points * ($content['refback_percents'] / 100) * ($percents / 100);
+                               $refbackPoints = $points * ($content['percents'] / 100) * ($content['refback_percents'] / 100);
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'points=' . $points . ',percents=' . $content['percents'] . ',refback_percents=' . $content['refback_percents'] . ',level=' . $content['level'] . ',refback_points=' . $refbackPoints);
 
                                // Update refback table ('refid' and 'userid' must be exchanged!)
 
                                // Update refback table ('refid' and 'userid' must be exchanged!)
-                               SQL_QUERY_ESC("UPDATE
+                               SQL_QUERY_ESC('UPDATE
        `{?_MYSQL_PREFIX?}_user_refs`
 SET
        `refback_points`=`refback_points`+%s
 WHERE
        `userid`=%s AND
        `refid`=%s
        `{?_MYSQL_PREFIX?}_user_refs`
 SET
        `refback_points`=`refback_points`+%s
 WHERE
        `userid`=%s AND
        `refid`=%s
-LIMIT 1",
+LIMIT 1',
                                        array(
                                        array(
-                                               $refback,
+                                               $refbackPoints,
                                                $refid,
                                                $userid
                                        ), __FUNCTION__, __LINE__);
                                                $refid,
                                                $userid
                                        ), __FUNCTION__, __LINE__);
@@ -94,17 +98,18 @@ LIMIT 1",
                                // Something must have been updated
                                if (SQL_HASZEROAFFECTED()) {
                                        // Please report this bug
                                // Something must have been updated
                                if (SQL_HASZEROAFFECTED()) {
                                        // Please report this bug
-                                       debug_report_bug(__FUNCTION__, __LINE__, 'Nothing has been updated in user_refs,userid=' . $userid . ',refid=' . $refid . ',refback=' . $refback);
+                                       debug_report_bug(__FUNCTION__, __LINE__, 'Nothing has been updated in user_refs,userid=' . $userid . ',refid=' . makeNullToZero($refid) . ',refbackPoints=' . $refbackPoints);
                                } // END - if
 
                                // Add points again, but only directly
                                } // END - if
 
                                // Add points again, but only directly
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refback=' . $refback . ',userid=' . $userid . ',ref=' . $ref . ',refid=' . $refid . ' - UPDATE! (' . SQL_AFFECTEDROWS() . ')');
-                               addPointsThroughReferalSystem(sprintf("refback:%s", $refid), $userid, $refback);
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refbackPoints=' . $refbackPoints . ',userid=' . $userid . ',ref=' . $ref . ',refid=' . makeNullToZero($refid) . ' - REFBACK-UPDATE! (' . SQL_AFFECTEDROWS() . ')');
+                               addPointsThroughReferalSystem(sprintf("refback:%s", $refid), $userid, $refbackPoints);
 
                                // Reduce points if refid is found
 
                                // Reduce points if refid is found
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . $refid . ',ref=' . $ref . ' - REDUCING?');
                                if ($refid == $ref) {
                                        // Reduce points here!
                                if ($refid == $ref) {
                                        // Reduce points here!
-                                       $return = $points * ($content['refback_percents'] / 100) - $refback;
+                                       $return = $points * ($content['percents'] / 100) - $refbackPoints;
                                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'return=' . $return . ' - REDUCED!');
                                } // END - if
                        } // END - if
                                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'return=' . $return . ' - REDUCED!');
                                } // END - if
                        } // END - if
@@ -122,31 +127,40 @@ LIMIT 1",
        return $return;
 }
 
        return $return;
 }
 
-// "Getter" for refback percents
-function getRefbackPercents ($userid, $ref) {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ' - ENTERED!');
-       // Skip identical ids
-       if ($userid == $ref) {
+/**
+ * "Getter" for refback percents
+ *
+ * @param      $userid         "Current" user's userid
+ * @param      $refid          $userid has this userid as referal
+ * @return     $percents       Refback percents $userid has given to $refid
+ */
+function getRefbackPercents ($userid, $refid) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . $refid . ' - ENTERED!');
+       if ((!isValidUserId($userid)) || (!isValidUserId($refid))) {
+               // userid and/or refid is invalid
+               debug_report_bug(__FUNCTION__, __LINE__, 'userid=' . makeNullToZero($userid) . ', refid=' . makeNullToZero($refid) . ' - Both must be > 0');
+       } elseif ($userid == $refid) {
+               // Skip identical ids
                return 0;
        } // END - if
 
        // Is it cached?
                return 0;
        } // END - if
 
        // Is it cached?
-       if (!isset($GLOBALS['refback_percents'][$userid][$ref])) {
+       if (!isset($GLOBALS['refback_percents'][$userid][$refid])) {
                // Default is zero
                // Default is zero
-               $GLOBALS['refback_percents'][$userid][$ref] = '0';
+               $GLOBALS['refback_percents'][$userid][$refid] = '0';
 
                // Get percents from database
                $result = SQL_QUERY_ESC("SELECT `refback_percents` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `refid`=%s LIMIT 1",
 
                // Get percents from database
                $result = SQL_QUERY_ESC("SELECT `refback_percents` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `refid`=%s LIMIT 1",
-                       array($ref, $userid), __FUNCTION__, __LINE__);
+                       array($userid, $refid), __FUNCTION__, __LINE__);
 
                // Entry found? (Should be!)
                if (SQL_NUMROWS($result) == 1) {
                        // Fetch percents
 
                // Entry found? (Should be!)
                if (SQL_NUMROWS($result) == 1) {
                        // Fetch percents
-                       list($GLOBALS['refback_percents'][$userid][$ref]) = SQL_FETCHROW($result);
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',percents=' . $GLOBALS['refback_percents'][$userid][$ref]);
+                       list($GLOBALS['refback_percents'][$userid][$refid]) = SQL_FETCHROW($result);
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . $refid . ',percents=' . $GLOBALS['refback_percents'][$userid][$refid]);
                } else {
                } else {
-                       // Debug log
-                       logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ' - No entry found. :-(');
+                       // Please report all findings
+                       debug_report_bug(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . $refid . ' - No entry found. :-(');
                }
 
                // Free result
                }
 
                // Free result
@@ -154,13 +168,13 @@ function getRefbackPercents ($userid, $ref) {
        } // END - if
 
        // Return percents
        } // END - if
 
        // Return percents
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',refback_percents=' . $GLOBALS['refback_percents'][$userid][$ref] . ' - EXIT!');
-       return $GLOBALS['refback_percents'][$userid][$ref];
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . $refid . ',refback_percents=' . $GLOBALS['refback_percents'][$userid][$refid] . ' - EXIT!');
+       return $GLOBALS['refback_percents'][$userid][$refid];
 }
 
 // "Getter" for userid array which will return only one entry
 function getArrayFromRefbackLevel ($refid, $level) {
 }
 
 // "Getter" for userid array which will return only one entry
 function getArrayFromRefbackLevel ($refid, $level) {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . $refid . ',level=' . $level);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . makeNullToZero($refid) . ',level=' . $level . ' - ENTERED!');
        // Init userids
        $userIds = array();
 
        // Init userids
        $userIds = array();
 
@@ -181,7 +195,7 @@ ORDER BY
        if (!SQL_HASZERONUMS($result)) {
                // Add all
                while ($content = SQL_FETCHARRAY($result)) {
        if (!SQL_HASZERONUMS($result)) {
                // Add all
                while ($content = SQL_FETCHARRAY($result)) {
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . $refid . ',level=' . $level . ',userid=' . $content['userid']);
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . makeNullToZero($refid) . ',level=' . $level . ',userid=' . $content['userid']);
                        $userIds[] = $content['userid'];
                } // END - while
        } // END - if
                        $userIds[] = $content['userid'];
                } // END - while
        } // END - if
@@ -190,7 +204,7 @@ ORDER BY
        SQL_FREERESULT($result);
 
        // Return array
        SQL_FREERESULT($result);
 
        // Return array
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . $refid . ',userIds()=' . count($userIds) . ' - EXIT!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . makeNullToZero($refid) . ',userIds()=' . count($userIds) . ' - EXIT!');
        return $userIds;
 }
 
        return $userIds;
 }
 
index 9072b7439a78115016f526edd7548d2fc5d677aa..9a8edbbb8d2bb5726215a8c4302bcdc7bf9f594b 100644 (file)
@@ -653,7 +653,9 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
        $userid = bigintval($urlData['url_userid']);
 
        // Is the id set?
        $userid = bigintval($urlData['url_userid']);
 
        // Is the id set?
-       if (empty($userid)) $userid = '0';
+       if (empty($userid)) {
+               $userid = NULL;
+       } // END - if
 
        // Just run the insert query for now
        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_urls` (`url_userid`, `url`, `url_status`, `url_views_max`, `url_views_allowed`, `url_fixed_reload`) VALUES (%s,'%s','%s',%s,%s,%s)",
 
        // Just run the insert query for now
        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_urls` (`url_userid`, `url`, `url_status`, `url_views_max`, `url_views_allowed`, `url_fixed_reload`) VALUES (%s,'%s','%s',%s,%s,%s)",
@@ -974,13 +976,13 @@ LIMIT 1",
 }
 
 // Check wether the user is allowed to book more URLs
 }
 
 // Check wether the user is allowed to book more URLs
-function SURFBAR_IF_USER_BOOK_MORE_URLS ($userid = '0') {
+function SURFBAR_IF_USER_BOOK_MORE_URLS ($userid = NULL) {
        // Is this admin and userid is zero or does the user has some URLs left to book?
        return ((($userid == '0') && (isAdmin())) || (SURFBAR_GET_TOTAL_USER_URLS($userid, '', array('REJECTED')) < getSurfbarMaxOrder()));
 }
 
 // Get total amount of URLs of given status for current user
        // Is this admin and userid is zero or does the user has some URLs left to book?
        return ((($userid == '0') && (isAdmin())) || (SURFBAR_GET_TOTAL_USER_URLS($userid, '', array('REJECTED')) < getSurfbarMaxOrder()));
 }
 
 // Get total amount of URLs of given status for current user
-function SURFBAR_GET_TOTAL_USER_URLS ($userid = '0', $status = '', $exclude = '') {
+function SURFBAR_GET_TOTAL_USER_URLS ($userid = NULL, $status = '', $exclude = '') {
        // Is the user 0 and user is logged in?
        if (($userid == '0') && (isMember())) {
                // Then use this userid
        // Is the user 0 and user is logged in?
        if (($userid == '0') && (isMember())) {
                // Then use this userid
index 7ae54fa9ddb6bae93cf49b604697d05648e48b38..601ca42eb0d702991a8771d7b531677ebf809569 100644 (file)
@@ -472,7 +472,7 @@ function doNewUserPassword ($email, $userid) {
 }
 
 // Get timestamp for given stats type and data
 }
 
 // Get timestamp for given stats type and data
-function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = '0') {
+function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = NULL) {
        // Default timestamp is zero
        $data['inserted'] = '0';
 
        // Default timestamp is zero
        $data['inserted'] = '0';
 
@@ -548,7 +548,7 @@ function doConfirmUserAccount ($hash) {
        );
 
        // Initialize the user id
        );
 
        // Initialize the user id
-       $userid = '0';
+       $userid = NULL;
 
        // Search for an unconfirmed or confirmed account
        $result = SQL_QUERY_ESC("SELECT `userid`, `refid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1",
 
        // Search for an unconfirmed or confirmed account
        $result = SQL_QUERY_ESC("SELECT `userid`, `refid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1",
@@ -587,7 +587,7 @@ LIMIT 1",
                        sendEmail($userid, '{--GUEST_THANX_CONFIRM--}', $message);
 
                        // Maybe he got "referaled"?
                        sendEmail($userid, '{--GUEST_THANX_CONFIRM--}', $message);
 
                        // Maybe he got "referaled"?
-                       if (($refid > 0) && ($refid != $userid)) {
+                       if ((isValidUserId($refid)) && ($refid != $userid)) {
                                // Select the referal userid
                                if (fetchUserData($refid)) {
                                        // Update ref counter...
                                // Select the referal userid
                                if (fetchUserData($refid)) {
                                        // Update ref counter...
index 3cad847ee16e55f3d1f926961c2b1536abae077b..1129585e3b7220fd07f6c9d8422795ab535f4784 100644 (file)
@@ -71,7 +71,7 @@ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) {
        }
 } elseif (isPostRequestParameterSet('new_pass')) {
        // New password requested
        }
 } elseif (isPostRequestParameterSet('new_pass')) {
        // New password requested
-       $userid = '0';
+       $userid = NULL;
        if (isPostRequestParameterSet('email')) {
                // Email is set
                $userid = SQL_ESCAPE(postRequestParameter('email'));
        if (isPostRequestParameterSet('email')) {
                // Email is set
                $userid = SQL_ESCAPE(postRequestParameter('email'));
@@ -87,7 +87,7 @@ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) {
        } // END - if
 } else {
        // Not logged in
        } // END - if
 } else {
        // Not logged in
-       $userid = '0';
+       $userid = NULL;
        $hash = '';
 }
 
        $hash = '';
 }
 
index 4c79c47eddec8640ebd55b2e57e58125e6d7b7ad..d54e46a23322e7a6d2fa4d47e21e218411d5853a 100644 (file)
@@ -451,10 +451,12 @@ function fetchUserData ($value, $column = 'userid') {
                        debug_report_bug(__FUNCTION__, __LINE__, 'User id ' . $value . ' is invalid.');
                } elseif (isUserDataValid()) {
                        // Use cache, so it is fine
                        debug_report_bug(__FUNCTION__, __LINE__, 'User id ' . $value . ' is invalid.');
                } elseif (isUserDataValid()) {
                        // Use cache, so it is fine
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value=' . $value . ' is valid, using cache #1');
                        return true;
                }
        } elseif (isUserDataValid())  {
                // Using cache is fine
                        return true;
                }
        } elseif (isUserDataValid())  {
                // Using cache is fine
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value=' . $value . ' is valid, using cache #2');
                return true;
        }
 
                return true;
        }
 
@@ -1621,7 +1623,7 @@ function reduceRecipientReceivedMails ($column, $id, $count) {
 }
 
 // Creates a new task
 }
 
 // Creates a new task
-function createNewTask ($subject, $notes, $taskType, $userid = '0', $adminId = '0', $strip = true) {
+function createNewTask ($subject, $notes, $taskType, $userid = NULL, $adminId = '0', $strip = true) {
        // Insert the task data into the database
        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`, `userid`, `status`, `task_type`, `subject`, `text`, `task_created`) VALUES (%s,%s,'NEW','%s','%s','%s', UNIX_TIMESTAMP())",
                array(
        // Insert the task data into the database
        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`, `userid`, `status`, `task_type`, `subject`, `text`, `task_created`) VALUES (%s,%s,'NEW','%s','%s','%s', UNIX_TIMESTAMP())",
                array(
index 30c18977e406b2e62e40ac4afdffd2be1ade0adf..b37bce06136f0ab45657f527be6ffe0e266467ec 100644 (file)
@@ -66,7 +66,8 @@ ORDER BY
        s.userid ASC', __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result)) {
                // Start deleting procedure
        s.userid ASC', __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result)) {
                // Start deleting procedure
-               $userid = '0'; $points = '0';
+               $userid = NULL;
+               $points = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Check if confirmation links are purged or not
                        $result_links = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s LIMIT 1",
                while ($content = SQL_FETCHARRAY($result)) {
                        // Check if confirmation links are purged or not
                        $result_links = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s LIMIT 1",
index ac0299e6d950c45c8b3b342ef50a8b921f742b8b..384f1a8a88d2a4191932da6b01b9bb18f5d48de5 100644 (file)
@@ -83,17 +83,15 @@ function getReferalLevelPercents ($level) {
 }
 
 /**
 }
 
 /**
- *
  * Dynamic referal and points system, can also send mails!
  *
  * subject       = Subject line, write in lower-case letters and underscore is allowed
  * userid        = Referal id wich should receive...
  * points        = ... xxx points
  * refid         = inc/modules/guest/what-confirm.php need this
  * Dynamic referal and points system, can also send mails!
  *
  * subject       = Subject line, write in lower-case letters and underscore is allowed
  * userid        = Referal id wich should receive...
  * points        = ... xxx points
  * refid         = inc/modules/guest/what-confirm.php need this
- * locked        = Shall I pay it to normal (false) or locked (true) points ammount?
  */
 function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NULL) {
  */
 function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NULL) {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',refid=' . $refid . ' - ENTERED!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',refid=' . makeNullToZero($refid) . ' - ENTERED!');
        // By default nothing has been added
        $added = false;
 
        // By default nothing has been added
        $added = false;
 
@@ -101,14 +99,17 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NUL
        $paymentMethod = strtoupper(getPaymentMethodFromSubject($subject));
        $sendNotify    = isPaymentRecipientNotificationEnabled($subject);
 
        $paymentMethod = strtoupper(getPaymentMethodFromSubject($subject));
        $sendNotify    = isPaymentRecipientNotificationEnabled($subject);
 
-       // When $userid = '0' add points to jackpot
-       if (($userid == '0') && ($paymentMethod == 'DIRECT') && (isExtensionActive('jackpot'))) {
+       // When $userid is NULL add points to jackpot
+       if ((!isValidUserId($userid)) && ($paymentMethod == 'DIRECT') && (isExtensionActive('jackpot'))) {
                // Add points to jackpot only in DIRECT mode
                return addPointsToJackpot($points);
        } // END - if
 
                // Add points to jackpot only in DIRECT mode
                return addPointsToJackpot($points);
        } // END - if
 
+       // Set userid as current
+       setCurrentUserId($userid);
+
        // Check user account
        // Check user account
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',points=' . $points);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',points=' . $points . ',paymentMethod=' . $paymentMethod . ',sendNotify=' . intval($sendNotify));
        if (fetchUserData($userid)) {
                // Determine wether the user has some mails to click before he/she gets the points
                $locked = ifUserPointsLocked($userid);
        if (fetchUserData($userid)) {
                // Determine wether the user has some mails to click before he/she gets the points
                $locked = ifUserPointsLocked($userid);
@@ -116,24 +117,21 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NUL
                // Detect database column
                $pointsColumn = determinePointsColumnFromSubjectLocked($subject, $locked);
 
                // Detect database column
                $pointsColumn = determinePointsColumnFromSubjectLocked($subject, $locked);
 
-               // This is the user and his ref
-               $GLOBALS['cache_array']['add_userid'][getUserData('refid')] = $userid;
-
                // Get percents
                $per = getReferalLevelPercents($GLOBALS['ref_level']);
                // Get percents
                $per = getReferalLevelPercents($GLOBALS['ref_level']);
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid.',points='.$points.',depth='.$GLOBALS['ref_level'].',per='.$per.',mode='.$paymentMethod);
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',points=' . $points . ',depth=' . makeNullToZero($GLOBALS['ref_level']) . ',per=' . $per . ',mode=' . $paymentMethod . ',pointsColumn=' . $pointsColumn . ',locked=' . intval($locked) . ',refid=' . getUserData('refid'));
 
                // Some percents found?
                if ($per > 0) {
                        // Calculate new points
                        $ref_points = $points * $per / 100;
 
                // Some percents found?
                if ($per > 0) {
                        // Calculate new points
                        $ref_points = $points * $per / 100;
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid.',points='.$points.',per='.$per.',depth='.$GLOBALS['ref_level'].',ref_points='.$ref_points);
 
                        // Pay refback here if level > 0 and in ref-mode
 
                        // Pay refback here if level > 0 and in ref-mode
-                       if ((isExtensionActive('refback')) && ($GLOBALS['ref_level'] > 0) && ($per < 100) && ($paymentMethod == 'REFERAL') && (isset($GLOBALS['cache_array']['add_userid'][$userid]))) {
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid.',data='.$GLOBALS['cache_array']['add_userid'][$userid].',ref_points='.$ref_points.',depth='.$GLOBALS['ref_level'].' - BEFORE!');
-                               $ref_points = addRefbackPoints($GLOBALS['cache_array']['add_userid'][$userid], $userid, $points, $ref_points);
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid.',data='.$GLOBALS['cache_array']['add_userid'][$userid].',ref_points='.$ref_points.',depth='.$GLOBALS['ref_level'].' - AFTER!');
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero(getUserData('refid')) . ',points=' . $points . ',paymentMethod=' . $paymentMethod);
+                       if (($userid != $refid) && ($paymentMethod == 'REFERAL') && (isValidUserId(getUserData('refid'))) && (isExtensionActive('refback'))) {
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero(getUserData('refid')) . ',ref_points=' . $ref_points . ',depth=' . makeNullToZero($GLOBALS['ref_level']) . ' - BEFORE!');
+                               $ref_points = addRefbackPoints($userid, getUserData('refid'), $points, $ref_points);
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero(getUserData('refid')) . ',ref_points=' . $ref_points . ',depth=' . makeNullToZero($GLOBALS['ref_level']) . ' - AFTER!');
                        } // END - if
 
                        // Update points...
                        } // END - if
 
                        // Update points...
@@ -157,7 +155,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NUL
                                                bigintval($GLOBALS['ref_level'])
                                        ), __FUNCTION__, __LINE__);
                        }
                                                bigintval($GLOBALS['ref_level'])
                                        ), __FUNCTION__, __LINE__);
                        }
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'pointsColumn='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$paymentMethod.' - UPDATE! ('.SQL_AFFECTEDROWS().')');
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'pointsColumn='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.makeNullToZero($GLOBALS['ref_level']).',mode='.$paymentMethod.' - UPDATE! ('.SQL_AFFECTEDROWS().')');
 
                        // No entry updated?
                        if (SQL_HASZEROAFFECTED()) {
 
                        // No entry updated?
                        if (SQL_HASZEROAFFECTED()) {
@@ -169,12 +167,12 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NUL
                                                makeZeroToNull($GLOBALS['ref_level']),
                                                $ref_points
                                        ), __FUNCTION__, __LINE__);
                                                makeZeroToNull($GLOBALS['ref_level']),
                                                $ref_points
                                        ), __FUNCTION__, __LINE__);
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'data='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$paymentMethod.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'data='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.makeNullToZero($GLOBALS['ref_level']).',mode='.$paymentMethod.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
                        } // END - if
 
                        // Check affected rows
                        } // END - if
 
                        // Check affected rows
-                       $added = SQL_AFFECTEDROWS();
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
+                       $added = (SQL_AFFECTEDROWS() == 1);
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added=' . intval($added) . ' - BEFORE FILTER');
 
                        // Prepare data for the filter
                        $filterData = array(
 
                        // Prepare data for the filter
                        $filterData = array(
@@ -196,7 +194,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NUL
 
                        // Extract $added
                        $added = $filterData['added'];
 
                        // Extract $added
                        $added = $filterData['added'];
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added=' . intval($added) . ' - AFTER FILTER');
 
                        // Points updated, maybe I shall send him an email?
                        if (($sendNotify === true) && (isValidUserId(getUserData('refid'))) && ($locked === false)) {
 
                        // Points updated, maybe I shall send him an email?
                        if (($sendNotify === true) && (isValidUserId(getUserData('refid'))) && ($locked === false)) {
@@ -231,20 +229,27 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NUL
                                } // END - if
                        }
 
                                } // END - if
                        }
 
-                       // Increase referal level
-                       $GLOBALS['ref_level']++;
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' Referal level increased, ref_level=' . $GLOBALS['ref_level']);
+                       // Increase referal level, if payment method is REFERAL
+                       if ($paymentMethod == 'REFERAL') {
+                               // Increase it
+                               $GLOBALS['ref_level']++;
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Referal level increased, ref_level=' . makeNullToZero($GLOBALS['ref_level']) . ',points=' . $points . ',refid=' . makeNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
+                       } elseif (isDebugModeEnabled()) {
+                               // Not increasing referal level, DIRECT payment method
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Referal level *NOT* increased, ref_level=' . makeNullToZero($GLOBALS['ref_level']) . ',points=' . $points . ',refid=' . makeNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
+                       }
 
                        // Maybe there's another ref?
 
                        // Maybe there's another ref?
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'points=' . $points . ',refid(var|data)=' . makeNullToZero($refid) . '|' . makeNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
                        if ((isValidUserId(getUserData('refid'))) && ($points > 0) && (getUserData('refid') != $userid) && ($paymentMethod == 'REFERAL')) {
                                // Then let's credit him here...
                        if ((isValidUserId(getUserData('refid'))) && ($points > 0) && (getUserData('refid') != $userid) && ($paymentMethod == 'REFERAL')) {
                                // Then let's credit him here...
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . getUserData('refid') . ',points=' . $points . ',ref_points=' . $ref_points . ' - ADVANCE!');
-                               $added = ($added && addPointsThroughReferalSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, getUserData('refid')));
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero(getUserData('refid')) . ',points=' . $points . ',ref_points=' . $ref_points . ',added[' . gettype($added) . ']=' . intval($added) . ' - ADVANCE!');
+                               $added = ($added && addPointsThroughReferalSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, getFetchedUserData('userid', getUserData('refid'), 'refid')));
                        } // END - if
                } // END - if
        } // END - if
 
                        } // END - if
                } // END - if
        } // END - if
 
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',sendNotify=' . intval($sendNotify) . ',refid=' . $refid . ',paymentMethod=' . $paymentMethod . ' - EXIT!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',sendNotify=' . intval($sendNotify) . ',refid=' . makeNullToZero($refid) . ',paymentMethod=' . $paymentMethod . ' - EXIT!');
        return $added;
 }
 
        return $added;
 }
 
@@ -585,15 +590,15 @@ function addMissingReferalLevels ($userid) {
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid);
                        // Does the refid have an array?
                        if (isset($GLOBALS['referal_refid'][$refid])) {
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid);
                        // Does the refid have an array?
                        if (isset($GLOBALS['referal_refid'][$refid])) {
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid . ',count()=' . count($GLOBALS['referal_refid'][$refid]));
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . makeNullToZero($refid) . ',count()=' . count($GLOBALS['referal_refid'][$refid]));
                                // Okay, then walk through here, too
                                foreach ($GLOBALS['referal_refid'][$refid] as $refLevel=>$refArray) {
                                // Okay, then walk through here, too
                                foreach ($GLOBALS['referal_refid'][$refid] as $refLevel=>$refArray) {
-                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid . ',refLevel=' . $refLevel . ',count()=' . count($refArray));
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . makeNullToZero($refid) . ',refLevel=' . $refLevel . ',count()=' . count($refArray));
                                        // Also walk through this one
                                        foreach ($refArray as $refRefid) {
                                                // Calculate new level
                                                $newLevel =  $level + $refLevel;
                                        // Also walk through this one
                                        foreach ($refArray as $refRefid) {
                                                // Calculate new level
                                                $newLevel =  $level + $refLevel;
-                                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid . ',refLevel=' . $refLevel . ',refRefid=' . $refRefid . ',newLevel=' . $newLevel);
+                                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . makeNullToZero($refid) . ',refLevel=' . $refLevel . ',refRefid=' . $refRefid . ',newLevel=' . $newLevel);
                                                // Is the refRefid not in?
                                                if ((!isset($GLOBALS['referal_refid'][$userid][$newLevel])) || (!in_array($refRefid, $GLOBALS['referal_refid'][$userid][$newLevel]))) {
                                                        // Then we must add this ref's refid to the userid's next level
                                                // Is the refRefid not in?
                                                if ((!isset($GLOBALS['referal_refid'][$userid][$newLevel])) || (!in_array($refRefid, $GLOBALS['referal_refid'][$userid][$newLevel]))) {
                                                        // Then we must add this ref's refid to the userid's next level
index 382e4a6c9c7c18280b99ffc1fc42aeba346e0f17..6e2e4730660d0f0e803575ab0fc29e97f4435cb1 100644 (file)
@@ -437,7 +437,7 @@ function detectExtraTemplatePath ($template) {
 }
 
 // Loads an email template and compiles it
 }
 
 // Loads an email template and compiles it
-function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadUserData = true) {
+function loadEmailTemplate ($template, $content = array(), $userid = NULL, $loadUserData = true) {
        // @TODO $DATA is deprecated and should be avoided and replaced with $content
        global $DATA;
 
        // @TODO $DATA is deprecated and should be avoided and replaced with $content
        global $DATA;
 
index 4e235f5017f328826646ee982577b6540d444d5b..46822ca578fcfc563ac60e7a6b2a074282759256 100644 (file)
@@ -949,6 +949,7 @@ function initUserData () {
        } // END - if
 
        // Init the user
        } // END - if
 
        // Init the user
+       unset($GLOBALS['is_userdata_valid'][getCurrentUserId()]);
        $GLOBALS['user_data'][getCurrentUserId()] = array();
 }
 
        $GLOBALS['user_data'][getCurrentUserId()] = array();
 }
 
@@ -1009,7 +1010,9 @@ function getUserDataArray () {
 // in, but you should use isMember() if you want to find that out.
 function isUserDataValid () {
        // User id should not be zero so abort here
 // in, but you should use isMember() if you want to find that out.
 function isUserDataValid () {
        // User id should not be zero so abort here
-       if (!isCurrentUserIdSet()) return false;
+       if (!isCurrentUserIdSet()) {
+               return false;
+       } // END - if
 
        // Is it cached?
        if (!isset($GLOBALS['is_userdata_valid'][getCurrentUserId()])) {
 
        // Is it cached?
        if (!isset($GLOBALS['is_userdata_valid'][getCurrentUserId()])) {
index b88616de73d9260a7cfacbda1ad7d02c96937989..54f17d5ad32b494b566fdaa0c7e4d39847110970 100644 (file)
@@ -176,10 +176,10 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                        if ($isValid === true) {
                                                if (($time == '0') && ($payment > 0)) $time = 1;
                                                if (($time > 0) && ($payment > 0)) {
                                        if ($isValid === true) {
                                                if (($time == '0') && ($payment > 0)) $time = 1;
                                                if (($time > 0) && ($payment > 0)) {
-                                                       $img_code = '0';
+                                                       $realCode = '0';
                                                        if (!empty($code)) {
                                                        if (!empty($code)) {
-                                                               // Generate code
-                                                               $img_code = generateRandomCode(getCodeLength(), $code, $userId, $urlId);
+                                                               // Generate code (the user sees in the CAPTCHA)
+                                                               $realCode = generateRandomCode(getCodeLength(), $code, $userId, $urlId);
                                                        } // END - if
 
                                                        // @TODO Rewrite this to a filter
                                                        } // END - if
 
                                                        // @TODO Rewrite this to a filter
@@ -227,7 +227,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                                                        // @TODO Rewrite these blocks to filter
                                                                        if (isExtensionInstalledAndNewer('user', '0.1.2')) {
                                                                                // Update counter
                                                                        // @TODO Rewrite these blocks to filter
                                                                        if (isExtensionInstalledAndNewer('user', '0.1.2')) {
                                                                                // Update counter
-                                                                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE `userid`=%s LIMIT 1",
+                                                                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `mails_confirmed`=`mails_confirmed`+1 WHERE `userid`=%s LIMIT 1",
                                                                                        array($userId), __FILE__, __LINE__);
 
                                                                                // Update random confirmed as well?
                                                                                        array($userId), __FILE__, __LINE__);
 
                                                                                // Update random confirmed as well?
@@ -239,10 +239,10 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                                                        } // END - if
 
                                                                        // Insert stats record
                                                                        } // END - if
 
                                                                        // Insert stats record
-                                                                       insertUserStatsRecord($userId, $type, $stats_data);
+                                                                       //insertUserStatsRecord($userId, $type, $stats_data);
 
                                                                        // Right code entered?
 
                                                                        // Right code entered?
-                                                                       if (bigintval(postRequestParameter('gfx_check')) == $img_code) {
+                                                                       if (bigintval(postRequestParameter('gfx_check')) == $realCode) {
                                                                                // Set HTTP status to okay
                                                                                setHttpStatus('200 OK');
 
                                                                                // Set HTTP status to okay
                                                                                setHttpStatus('200 OK');
 
@@ -300,8 +300,17 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                                                                // Wrong image code! So add points to sender's account
                                                                                addPointsThroughReferalSystem('mailid_payback', $sender, $payment);
 
                                                                                // Wrong image code! So add points to sender's account
                                                                                addPointsThroughReferalSystem('mailid_payback', $sender, $payment);
 
+                                                                               // Add payment points
+                                                                               $content['points'] = $payment;
+
                                                                                // Load template
                                                                                loadTemplate('mailid_points_failed', false, $content);
                                                                                // Load template
                                                                                loadTemplate('mailid_points_failed', false, $content);
+                                                                       } else {
+                                                                               // Add payment points (again)
+                                                                               $content['points'] = $payment;
+
+                                                                               // Load template
+                                                                               loadTemplate('mailid_points_failed2', false, $content);
                                                                        }
 
                                                                        // Remove link from table
                                                                        }
 
                                                                        // Remove link from table
@@ -310,7 +319,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                                                        break;
 
                                                                case 'img':
                                                                        break;
 
                                                                case 'img':
-                                                                       generateImageOrCode($img_code);
+                                                                       generateImageOrCode($realCode);
                                                                        break;
 
                                                                case 'confirm':
                                                                        break;
 
                                                                case 'confirm':
@@ -323,11 +332,11 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                                                                $content['banner'] = loadTemplate('mailid_banner', true);
                                                                                if (getCodeLength() > 0) {
                                                                                        // Generate Code
                                                                                $content['banner'] = loadTemplate('mailid_banner', true);
                                                                                if (getCodeLength() > 0) {
                                                                                        // Generate Code
-                                                                                       $content['image'] = generateCaptchaCode($code, $type, $urlId, $userId);
+                                                                                       $content['image'] = generateCaptchaCode($realCode, $type, $urlId, $userId);
                                                                                        $templ = 'mailid_enter_code';
                                                                                } else {
                                                                                        // Disabled code
                                                                                        $templ = 'mailid_enter_code';
                                                                                } else {
                                                                                        // Disabled code
-                                                                                       $content['gfx'] = $img_code;
+                                                                                       $content['gfx'] = $realCode;
                                                                                        $templ = 'mailid_confirm_buttom';
                                                                                }
 
                                                                                        $templ = 'mailid_confirm_buttom';
                                                                                }
 
index 319b15d7229bb08af61a106540f13131ba6ab473..90b0024e5ccbcbc9a33a5124be47001cd785eee1 100644 (file)
@@ -78,7 +78,7 @@ if ((isValidUserId(getRequestParameter('userid'))) && (getRequestParameter('d')
        if (!empty($t)) {
                // Check for data
                $result = SQL_QUERY_ESC("SELECT
        if (!empty($t)) {
                // Check for data
                $result = SQL_QUERY_ESC("SELECT
-       d.`gender`, d.`surname`, d.`family`, b.`level`, b.`points`
+       d.`userid`, b.`level`, b.`points`
 FROM
        `{?_MYSQL_PREFIX?}_user_data` AS d
 INNER JOIN
 FROM
        `{?_MYSQL_PREFIX?}_user_data` AS d
 INNER JOIN
@@ -102,7 +102,6 @@ LIMIT 1",
                        $content = SQL_FETCHARRAY($result);
 
                        // Prepare constants for the pre-template
                        $content = SQL_FETCHARRAY($result);
 
                        // Prepare constants for the pre-template
-                       // @TODO No more needed? $content['points'] = translateComma($content['points']);
                        $content['mailid'] = bigintval(getRequestParameter('d'));
                        $content['rows']   = addBonusRanks(bigintval(getRequestParameter('d')), $t, bigintval(getRequestParameter('userid')));
 
                        $content['mailid'] = bigintval(getRequestParameter('d'));
                        $content['rows']   = addBonusRanks(bigintval(getRequestParameter('d')), $t, bigintval(getRequestParameter('userid')));
 
diff --git a/templates/de/html/mailid/mailid_points_failed2.tpl b/templates/de/html/mailid/mailid_points_failed2.tpl
new file mode 100644 (file)
index 0000000..b9b4c5c
--- /dev/null
@@ -0,0 +1,14 @@
+<div align="center">
+<table border="0" cellspacing="0" cellpadding="0" class="mailid_table">
+       <tr>
+               <td width="220" align="center">
+                       {%message,MEMBER_POINTS_NOT_ADDED2=$content[points]%}
+               </td>
+               <td align="center">
+                       <div class="banner dashed">
+                               $content[banner]
+                       </div>
+               </td>
+       </tr>
+</table>
+</div>
index d5953d6305f7661e0555212154fe3d5753231d6c..8f7343e1081d3ed1e6aeb1421db042092a8bff29 100644 (file)
@@ -1,19 +1,29 @@
-<div>
-       Hallo {%pipe,translateGender=$content[gender]%} $content[surname] $content[family]!
+<div align="center">
+
+<div class="big">
+       Hallo {%user,gender,translateGender=$content[userid]%} {%user,surname=$content[userid]%} {%user,family=$content[userid]%}!
 </div>
 </div>
+
 <div>
        {%message,MEMBER_BONUS_SHOW_TITLE=$content[mailid]%}:
 </div>
 <div>
        {%message,MEMBER_BONUS_SHOW_TITLE=$content[mailid]%}:
 </div>
+
 <table border="0" cellspacing="0" cellpadding="0" width="300" class="table dashed">
        <tr>
 <table border="0" cellspacing="0" cellpadding="0" width="300" class="table dashed">
        <tr>
-               <td width="80" align="center" class="header_column bottom"><strong>{--BONUS_RANK--}:</strong></td>
-               <td width="120" align="center" class="header_column bottom"><strong>{--_USERID--}:</strong></td>
-               <td width="100" align="center" class="header_column bottom"><strong>{?POINTS?}:</strong></td>
+               <td width="80" align="center" class="header_column bottom">
+                       <strong>{--BONUS_RANK--}:</strong>
+               </td>
+               <td width="120" align="center" class="header_column bottom">
+                       <strong>{--_USERID--}:</strong>
+               </td>
+               <td width="100" align="center" class="header_column bottom">
+                       <strong>{?POINTS?}:</strong>
+               </td>
        </tr>
        $content[rows]
        <tr>
                <td colspan="3" class="table_footer" align="center">
        </tr>
        $content[rows]
        <tr>
                <td colspan="3" class="table_footer" align="center">
-                       <div class="tiny">$content[own]</div>
+                       $content[own]
                </td>
        </tr>
 </table>
                </td>
        </tr>
 </table>
        $content[rankings]
 </div>
 
        $content[rankings]
 </div>
 
-<div style="padding-top:5px;padding-bottom:5px" class="notice">
+<div style="padding-top:5px;padding-bottom:5px">
        <div>
        <div>
-               Wir w&uuml;nschen allen Gewinnern viel Gl&uuml;ck bei der monatlichen Aktiv-Rallye!
+               {--MONTHLY_BONUS_RALLYE_GOOD_LUCK--}
        </div>
        <div>
        </div>
        <div>
-               Es k&ouml;nnen nur die ersten <u>{?bonus_ranks?}</u> die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.
+               {--MONTHLY_BONUS_RALLYE_RANKS_NOTE--}
        </div>
 </div>
        </div>
 </div>
+</div>
index a528ee061850d4526ca4f912a6a76be787e94d21..37d260b8c0594ef3be28e17d1491270f34b1453d 100644 (file)
@@ -1,4 +1,4 @@
-.mailid_table {
+table.mailid_table {
        background-color: #ddeedd;
        width: 100%;
        height: 100%;
        background-color: #ddeedd;
        width: 100%;
        height: 100%;