]> git.mxchange.org Git - mailer.git/commitdiff
Naming convention, more usage of EL, new wrapper function introduced:
authorRoland Häder <roland@mxchange.org>
Tue, 20 Jul 2010 22:48:37 +0000 (22:48 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 20 Jul 2010 22:48:37 +0000 (22:48 +0000)
- Naming convention applied on further more language strings
- New wrapper function isDirectPaymentAllowed() added
- More usage of EL to shorten PHP scripts
- Parameter $locked in function addPointsToRefSystem() optimized out
- TODOs.txt updated

16 files changed:
DOCS/TODOs.txt
birthday_confirm.php
inc/autopurge/purge-inact.php
inc/language/autopurge_de.php
inc/language/birthday_de.php
inc/libs/autopurge_functions.php
inc/libs/beg_functions.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-del_email.php
inc/modules/guest/what-confirm.php
inc/mysql-manager.php
inc/reset/reset_birthday.php
inc/wrapper-functions.php
mailid_top.php
templates/de/html/admin/admin_config_birthday.tpl
templates/de/html/admin/admin_list_autopurge.tpl

index e2b1105de811a8f98d6875000a699a8d4280e391..8a69638369978f393bdaed74b084791593a6e9d4 100644 (file)
@@ -2,7 +2,7 @@
 ### DO NOT EDIT THIS FILE. ###
 ./autoreg.php:60:// @TODO Add processing of request here
 ./beg.php:165:                 // @TODO Opps, what is missing here???
-./birthday_confirm.php:99:             // @TODO Try to rewrite the following unset()
+./birthday_confirm.php:95:             // @TODO Try to rewrite the following unset()
 ./inc/autopurge/purge-inact.php:57:    // @TODO Rewrite these if() blocks to a filter
 ./inc/cache/config-local.php:126:// @TODO Rewrite the following three constants, somehow...
 ./inc/classes/cachesystem.class.php:474:       // @TODO Add support for more types which break in last else-block
@@ -59,7 +59,7 @@
 ./inc/language/refback_de.php:46:// @TODO Rewrite these constants to one
 ./inc/language/sponsor_de.php:119:// @TODO Rewrite these four constants to one and use sprintf()
 ./inc/libs/admins_functions.php:432:           // @TODO This can be, somehow, rewritten
-./inc/libs/beg_functions.php:58:               // @TODO Try to rewrite the following unset()
+./inc/libs/beg_functions.php:54:               // @TODO Try to rewrite the following unset()
 ./inc/libs/bonus_functions.php:204:            // @TODO Move this HTML to a template
 ./inc/libs/bonus_functions.php:288:            // @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/libs/doubler_functions.php:46:// @TODO Lame description
 ./inc/modules/admin/what-usage.php:88: // @TODO This code is double, see loadTemplate() and loadEmailTemplate() in functions.php
 ./inc/modules/admin/what-usr_online.php:51:    // @TODO Add a filter for sponsor
 ./inc/modules/guest/what-beg.php:53:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
-./inc/modules/guest/what-confirm.php:120:                                      // @TODO Try to rewrite the following unset()
+./inc/modules/guest/what-confirm.php:111:                                      // @TODO Try to rewrite the following unset()
 ./inc/modules/guest/what-login.php:114:        // @TODO Move this HTML code into a template
 ./inc/modules/guest/what-mediadata.php:183:// @TODO Rewrite all these if-blocks to filters
 ./inc/modules/guest/what-mediadata.php:70:     // @TODO Find a better formular than this one
 ./inc/modules/member/what-unconfirmed.php:143: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/order.php:76:            // @TODO Unused: 2,4
 ./inc/monthly/monthly_bonus.php:69:    // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1164:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1411:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1509:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1876:                  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1920:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1168:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1415:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1513:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1880:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1924:// @TODO Fix inconsistency between last_module and getWhat()
 ./inc/mysql-manager.php:370:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:46:// @TODO Can we cache this?
 ./inc/reset/reset_beg.php:51:// @TODO This should be converted in a daily beg rallye
 ./mailid_top.php:179:                                                  // @TODO Rewrite this to a filter
 ./mailid_top.php:186:                                                                  // @TODO Rewrite this to a filter
 ./mailid_top.php:221:                                                                  // @TODO Rewrite these blocks to filter
-./mailid_top.php:256:                                                                          // @TODO Try to rewrite the following unset()
+./mailid_top.php:254:                                                                          // @TODO Try to rewrite the following unset()
 ./mailid_top.php:99:           // @TODO Rewrite this to a filter
 ./show_bonus.php:107:                  // @TODO No more needed? $content['points'] = translateComma($content['points']);
 ./view.php:70:         // @TODO No banner found, output some default banner
index 91d5f911c3068a2539ec0360f4bed9375ccb7881..818001a631e5da1fc2fdfeca24c7a6e2a53c2d13 100644 (file)
@@ -91,14 +91,10 @@ if (SQL_NUMROWS($result) == 1) {
 
        // Is the account confirmed?
        if ($data['status'] == 'CONFIRMED') {
-               // Set mode depending on how many mails the member has to confirm
-               $locked = false;
-               if (($data['ref_payout'] > 0) && (getConfig('allow_direct_pay') != 'Y')) $locked = true;
-
                // Add points to account
                // @TODO Try to rewrite the following unset()
                unset($GLOBALS['ref_level']);
-               addPointsThroughReferalSystem('birthday_confirm', $userid, $data['points'], false, 0, $locked, strtolower(getConfig('birthday_mode')));
+               addPointsThroughReferalSystem('birthday_confirm', $userid, $data['points'], false, 0, strtolower(getConfig('birthday_mode')));
 
                // Remove entry from table
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_birthday` WHERE `userid`=%s AND `chk_value`='%s' LIMIT 1",
@@ -108,11 +104,11 @@ if (SQL_NUMROWS($result) == 1) {
                $content['message'] = loadTemplate('birthday_msg', true, $data);
        } else {
                // Unconfirmed / locked accounts cannot get points
-               $content['message'] = getMaskedMessage('BIRTHDAY_CANNOT_STATUS', translateUserStatus($data['status']));
+               $content['message'] = getMaskedMessage('MEMBER_BIRTHDAY_CANNOT_STATUS', translateUserStatus($data['status']));
        }
 } else {
        // Cannot load data!
-       $content['message'] = '{--BIRTHDAY_CANNOT_LOAD_DATA--}';
+       $content['message'] = '{--MEMBER_BIRTHDAY_CANNOT_LOAD_DATA--}';
 }
 
 // Free memory
index 70eae0be2d438da8a5079760d4c1c80443fa709e..bca267d2e42650ac6cad19ddb6c65a8943dadc99 100644 (file)
@@ -101,7 +101,7 @@ ORDER BY
 
                        // Load mail template
                        $message = loadEmailTemplate('member_autopurge_inactive', $content, bigintval($content['userid']));
-                       sendEmail($content['email'], '{--AUTOPURGE_MEMBER_INACTIVE_SUBJECT--}', $message);
+                       sendEmail($content['email'], '{--MEMBER_AUTOPURGE_INACTIVE_SUBJECT--}', $message);
 
                        // Update this account
                        addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ap_notified`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1",
index 2d27da65ac18ee9b6b518030e240d22c14a4d8d9..5294aea9654d3f928be52edbf41ce9d89143e5db 100644 (file)
@@ -44,9 +44,9 @@ if (!defined('__SECURITY')) {
 
 // Language definitions
 addMessages(array(
-       'AUTOPURGE_MEMBER_SUBJECT' => "{?POINTS?}-Gutschrift bei Auto-Loeschung",
-       'AUTOPURGE_MEMBER_INACTIVE_SUBJECT' => "Inaktivitaet --> Account wird bald gel&ouml;scht.",
-       'AUTOPURGE_MEMBER_UNCONFIRMED_SUBJECT' => "L&ouml;schung --> EMail-Adresse nicht best&auml;tigt.",
+       'MEMBER_AUTOPURGE_SUBJECT' => "{?POINTS?}-Gutschrift bei Auto-Loeschung",
+       'MEMBER_AUTOPURGE_INACTIVE_SUBJECT' => "Inaktivitaet --> Account wird bald gel&ouml;scht.",
+       'MEMBER_AUTOPURGE_UNCONFIRMED_SUBJECT' => "L&ouml;schung --> EMail-Adresse nicht best&auml;tigt.",
        'ADMIN_AUTOPURGE_SUBJECT' => "[Auto-Purge:] Best&auml;tigungslinks",
        'ADMIN_AUTOPURGE_INACTIVE_SUBJECT' => "Inaktive Mitglieder benachrichtigt",
        'ADMIN_AUTOPURGE_DELETE_SUBJECT' => "[Auto-Purge:] Inaktiven Mitgliedern",
@@ -54,7 +54,6 @@ addMessages(array(
        'ADMIN_AUTOPURGE_TASKS_SUBJECT' => "[Auto-Purge:] Zu l&ouml;schen marktierte Aufgaben",
        'ADMIN_AUTOPURGE_TURBO_SUBJECT' => "[Auto-Purge:] Veraltete Bonus-Eintraege",
        'ADMIN_AUTOPURGE_DELETE_MAILS_SUBJECT' => "[Auto-Purge:] Mailbuchungen bereits gel. Mitglieder",
-
        'ADMIN_AUTOPURGE_CONFIGURATION' => "Konfiguration der automatischen L&ouml;schungen",
        'ADMIN_AUTOPURGE_INACTIVE' => "Sollten inaktive Accounts erkannt und gel&ouml;scht werden?",
        'ADMIN_AUTOPURGE_INACTIVE_SINCE' => "Dauer bis best&auml;tigtes Account als inaktiv markiert wird",
@@ -72,7 +71,7 @@ addMessages(array(
        'ADMIN_AUTOPURGE_NOTIFY_UNCONFIRMED' => "Benachrichtigung bei unbest&auml;tigte Accounts l&ouml;schen",
        'ADMIN_AUTOPURGE_NOTIFY_TASKS' => "Benachrichtigung bei veraltete Aufgaben l&ouml;schen",
        'ADMIN_LIST_AUTOPURGE_FOOTER' => "Hier sollte ein Hinweis kommen.",
-       'AUTOPURGE_NOTIFIED' => "Benachrichtigt",
+       'ADMIN_AUTOPURGE_NOTIFIED' => "Benachrichtigt",
 
        'ADMIN_AUTOPURGE_DELETE_MAILS_TITLE' => "Mails von gel&ouml;schten Mitgliedern l&ouml;schen",
        'ADMIN_AUTOPURGE_DELETE_MAILS' => "Sollen die Mailbuchungen von bereits gel&ouml;schten Mitgliedern gel&ouml;scht werden?",
index 62f46fee6f38a89c818e37dae0b624a16f0262b0..2652dc6dabca60235a47887481915705ae71e535 100644 (file)
@@ -44,15 +44,15 @@ if (!defined('__SECURITY')) {
 
 // Language definitions
 addMessages(array(
-       'HAPPY_BIRTHDAY_SUBJECT' => "Herzlichen Gl&uuml;ckwunsch zum Geburtstag.",
-       'ADMIN_CONFIG_BIRTHDAY_HEADER' => "Einstellungen zu Geburtstagsmails",
+       'MEMBER_HAPPY_BIRTHDAY_SUBJECT' => "Herzlichen Gl&uuml;ckwunsch zum Geburtstag.",
+       'ADMIN_CONFIG_BIRTHDAY_TITLE' => "Einstellungen zu Geburtstagsmails",
        'ADMIN_BIRTHDAY_POINTS' => "{?POINTS?} als &quot;Geburtstagsgeschenk&quot;",
        'ADMIN_BIRTHDAY_POINTS_NOTE' => "Wert <strong>0</strong> deaktiviert die Extragutschrift.",
-       'BIRTHDAY_CANNOT_STATUS' => "Kann keine {?POINTS?} gutschreiben! Status Ihres Accounts: <span class=\"data\">%s</span>",
-       'BIRTHDAY_CANNOT_LOAD_DATA' => "Entweder haben Sie bereits Ihr Geburtsgeschenk erhalten oder Sie haben heute keinen Geburtstag.",
+       'MEMBER_BIRTHDAY_CANNOT_STATUS' => "Kann keine {?POINTS?} gutschreiben! Status Ihres Accounts: <span class=\"data\">%s</span>",
+       'MEMBER_BIRTHDAY_CANNOT_LOAD_DATA' => "Entweder haben Sie bereits Ihr Geburtsgeschenk erhalten oder Sie haben heute keinen Geburtstag.",
        'ADMIN_SELECT_BIRTHDAY_MODE' => "Verg&uuml;tungsmodus der {?POINTS?}",
-       'BIRTHDAY_MODE_DIRECT' => "Nur direktem Mitglied gutschreiben.",
-       'BIRTHDAY_MODE_REF' => "Auch dem Werber des Mitgliedes gutschreiben.",
+       'ADMIN_BIRTHDAY_MODE_DIRECT' => "Nur direktem Mitglied gutschreiben.",
+       'ADMIN_BIRTHDAY_MODE_REF' => "Auch dem Werber des Mitgliedes gutschreiben.",
        'ADMIN_BIRTHDAY_ONLY_ACTIVE' => "Nur aktive Mitglieder erhalten die Geburtstagsgutschrift?<br /><div class=\"admin_note\">(Nur in Verbindung mit der Erweiterung <strong>autopurge</strong>!)</div>",
 ));
 
index fe3cdd4b586c22d6f55f2e95f96677966c55089b..3d90fba9279d398cd68e0d20a5bf86c2163afc3f 100644 (file)
@@ -49,7 +49,7 @@ function addPointsAutoPurge ($userid, $points) {
 
        // Send out mail to user
        $message = loadEmailTemplate('member_autopurge_points', array('points' => $points), $userid);
-       sendEmail($userid, '{--AUTOPURGE_MEMBER_SUBJECT--}', $message);
+       sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message);
 }
 
 // Checks wether auto-purging is active
index 4a22933c8fcf1f9f7bc3ae90aa465f7db925dd63..cc648742f04b4ead6951694dcbd87cfecdccbcad 100644 (file)
@@ -50,14 +50,10 @@ function addPointsBeg ($userid, $points) {
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_points`=`beg_points`+%s WHERE `userid`=%s LIMIT 1",
                        array($points, $userid), __FUNCTION__, __LINE__);
        } else {
-               // Set mode depending on how many mails the member has to confirm
-               $locked = false;
-               if ((getConfig('ref_payout') > 0) && (getConfig('allow_direct_pay') != 'Y')) $locked = true;
-
                // Add points to account
                // @TODO Try to rewrite the following unset()
                unset($GLOBALS['ref_level']);
-               addPointsThroughReferalSystem('beg', $userid, $points, false, 0, $locked, strtolower(getConfig('beg_mode')));
+               addPointsThroughReferalSystem('beg', $userid, $points, false, 0, strtolower(getConfig('beg_mode')));
        }
 
        // Subtract begged points from member account if the admin has selected one
index 8f6056b541beee2744218db9318b15fce5bddead..365be6cc8f2cf2947c390800aea17f372ac6fdd2 100644 (file)
@@ -165,7 +165,7 @@ WHERE
        if (!empty($message)) {
                // When do so...
                loadTemplate('admin_settings_saved', false, $message);
-       }
+       } // END - if
 } elseif (getRequestParameter('sub') == 'settings') {
        // Setup some settings like direct pay and so on
        // Including new add-mode for one-time referal bonus
@@ -178,13 +178,13 @@ WHERE
        // One-time referal bonus add-mode
        foreach (array('reg_points_mode_ref','reg_points_mode_direct') as $entry) {
                $content[$entry] = '';
-       } // END - if
+       } // END - foreach
        $content['reg_points_mode_' . strtolower(getConfig('reg_points_mode'))] = ' checked="checked"';
 
        // Load template
        loadTemplate('admin_config_point_settings', false, $content);
 } elseif (getRequestParameter('sub') == 'ref') {
-       // 12                  3     32    2                  3     32    2               3            4     43    21
+       // 12          3     32    2                         3     32    2                        3321
        if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (ifPostContainsSelections())) {
                // Delete entries
                $OUT = '';
index 0e98689ede7330a8e340a42fa0cf8f17967f270c..819770ab744b038eb5108897899de5cd9575cb6f 100644 (file)
@@ -110,7 +110,7 @@ LIMIT 1",
 
                                // Pay back points
                                //* DEBUG: */ debugOutput('PAYBACK:'.$sender);
-                               addPointsThroughReferalSystem('mail_deleted', $sender, $totalPoints, true, 0, false,'direct');
+                               addPointsDirectly('mail_deleted', $sender, $totalPoints);
 
                                // Output message
                                if (getConfig('repay_deleted_mails') == 'REPAY') {
index 569f4d4e0a607d94636e3fec610d61b57a4f7345..ad16f5ea30a7b7558c94643666705f2650a6dacd 100644 (file)
@@ -97,15 +97,6 @@ LIMIT 1",
                                        // Update ref counter...
                                        updateReferalCounter($refid);
 
-                                       // Shall I 'pay' the referal points imidiately?
-                                       if (getConfig('ref_payout') == '0') {
-                                               // Yes, 'pay' it now
-                                               $locked = false;
-                                       } else {
-                                               // No, 'pay' it later
-                                               $locked = true;
-                                       }
-
                                        // If version matches add ref bonus to refid's account
                                        if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (isBonusRallyeActive())) {
                                                // Add points (directly only!)
@@ -119,7 +110,7 @@ LIMIT 1",
                                        // Add one-time referal bonus over referal system or directly
                                        // @TODO Try to rewrite the following unset()
                                        unset($GLOBALS['ref_level']);
-                                       addPointsThroughReferalSystem('referal_bonus', $refid, getPointsRef(), true, bigintval($userid), $locked, getConfig('reg_points_mode'));
+                                       addPointsThroughReferalSystem('referal_bonus', $refid, getPointsRef(), true, bigintval($userid), getConfig('reg_points_mode'));
                                } // END - if
                        } // END - if
 
index 51e24c8eded41fdbbf2e3cf17bb56d1479ac8a14..43de04889b35120e41da8ec646ba78a606b41453 100644 (file)
@@ -994,7 +994,7 @@ function getReferalLevelPercents ($level) {
  * add_mode    = Add points only to $userid or also refs? (WARNING! Changing 'ref' to 'direct'
  *               for default value will cause no referal will get points ever!!!)
  */
-function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $locked = false, $add_mode = 'ref') {
+function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $add_mode = 'ref') {
        //* DEBUG: */ debugOutput('----------------------- <font color="#00aa00">' . __FUNCTION__ . ' - ENTRY</font> ------------------------<ul><li>');
        // Convert mode to lower-case
        $add_mode = strtolower($add_mode);
@@ -1006,21 +1006,6 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                return;
        } // END - if
 
-       // Prepare data for the filter
-       $filterData = array(
-               'subject'  => $subject,
-               'userid'   => $userid,
-               'points'   => $points,
-               'notify'   => $sendNotify,
-               'refid'    => $refid,
-               'locked'   => $locked,
-               'mode'     => 'add',
-               'sub_mode' => $add_mode,
-       );
-
-       // Filter it now
-       runFilterChain('add_points', $filterData);
-
        // Count up referal depth
        if (!isset($GLOBALS['ref_level'])) {
                // Initialialize referal system
@@ -1074,6 +1059,25 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                                //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):data='.$data.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$add_mode.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
                        } // END - if
 
+                       // Determine wether the user has some mails to click before he/she gets the points
+                       $locked = false;
+                       if ((getUserData('ref_payout') > 0) && (!isDirectPaymentAllowed())) $locked = true;
+
+                       // Prepare data for the filter
+                       $filterData = array(
+                               'subject'  => $subject,
+                               'userid'   => $userid,
+                               'points'   => $points,
+                               'notify'   => $sendNotify,
+                               'refid'    => $refid,
+                               'locked'   => $locked,
+                               'mode'     => 'add',
+                               'sub_mode' => $add_mode,
+                       );
+
+                       // Filter it now
+                       runFilterChain('add_points', $filterData);
+
                        // Points updated, maybe I shall send him an email?
                        if (($sendNotify === true) && (isValidUserId(getUserData('refid'))) && ($locked === false)) {
                                // Prepare content
@@ -1107,7 +1111,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                        if ((isValidUserId(getUserData('refid'))) && ($points > 0) && (getUserData('refid') != $userid) && ($add_mode == 'ref')) {
                                // Then let's credit him here...
                                //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',ref='.getUserData('refid').',points='.$points.' - ADVANCE!');
-                               addPointsThroughReferalSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, $sendNotify, getUserData('refid'), $locked);
+                               addPointsThroughReferalSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, $sendNotify, getUserData('refid'));
                        } // END - if
                } // END - if
        } // END - if
index 9f02208566e3b5e628f51b0fb316f3383b2f00dc..4321e31bd4f0819b4a7938487e4687e36e6773d8 100644 (file)
@@ -108,7 +108,7 @@ if (SQL_NUMROWS($result_birthday) > 0) {
                }
 
                // Send email
-               sendEmail($content['email'], '{--HAPPY_BIRTHDAY_SUBJECT--}', $message);
+               sendEmail($content['email'], '{--MEMBER_HAPPY_BIRTHDAY_SUBJECT--}', $message);
 
                // Remember him that he has received a birthday mail
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `birthday_sent`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1",
index 036a89b0046f9efa308bd4f9142d422816e752b6..894c2f4d4e19bc8c26bb1b0053cabdcf762a37b1 100644 (file)
@@ -682,7 +682,7 @@ function addPointsDirectly ($subject, $userid, $points) {
        unset($GLOBALS['ref_level']);
 
        // Call more complicated method (due to more parameters)
-       return addPointsThroughReferalSystem($subject, $userid, $points, false, 0, false, 'direct');
+       return addPointsThroughReferalSystem($subject, $userid, $points, false, 0, 'direct');
 }
 
 // Wrapper for redirectToUrl but URL comes from a configuration entry
@@ -1874,5 +1874,17 @@ function isUrlBlacklistEnabled () {
        return $GLOBALS['is_url_blacklist_enabled'];
 }
 
+// Checks wether direct payment is allowed in configuration
+function isDirectPaymentAllowed () {
+       // Do we have cache?
+       if (!isset($GLOBALS['is_direct_payment_allowed'])) {
+               // Determine it
+               $GLOBALS['is_direct_payment_allowed'] = (getConfig('allow_direct_pay') == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['is_direct_payment_allowed'];
+}
+
 // [EOF]
 ?>
index 36a5c007856fbe55ff9fffaa52399a9f51bd51f9..ba47505ab9043fd61461c75d9d6bdbfa163d822d 100644 (file)
@@ -238,13 +238,11 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                                        // Right code entered?
                                                                        if (bigintval(postRequestParameter('gfx_check')) == $img_code) {
                                                                                // Add points over referal system is the default
-                                                                               $locked = false;
                                                                                $template = 'mailid_points_done';
 
                                                                                // Right code entered add points and remove entry
-                                                                               if ((getUserData('ref_payout') > 0) && (getConfig('allow_direct_pay') != 'Y')) {
+                                                                               if ((getUserData('ref_payout') > 0) && (!isDirectPaymentAllowed())) {
                                                                                        // Don't add points over the referal system
-                                                                                       $locked = true;
                                                                                        $template = 'mailid_points_locked';
                                                                                } // END - if
 
@@ -255,7 +253,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                                                // Add points
                                                                                // @TODO Try to rewrite the following unset()
                                                                                unset($GLOBALS['ref_level']);
-                                                                               addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment, false, 0, $locked);
+                                                                               addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment);
 
                                                                                // Shall I add bonus points for "turbo clickers" ?
                                                                                if (isExtensionInstalledAndNewer('bonus', '0.2.2')) {
index ab849346b42b8823d21e0e270bdf5da4f699a190..5aaa2c613784b4051fecda45868d2a1582b0fa96 100644 (file)
@@ -3,7 +3,7 @@
 <table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
        <tr>
                <td colspan="2" align="center" class="admin_title bottom">
-                       <strong>{--ADMIN_CONFIG_BIRTHDAY_HEADER--}</strong>
+                       <strong>{--ADMIN_CONFIG_BIRTHDAY_TITLE--}</strong>
                </td>
        </tr>
        <tr>
        <tr>
                <td class="bottom" align="right">
                        <input type="radio" name="birthday_mode" class="admin_normal" value="DIRECT"$content[mode_direct] />
-                       {--BIRTHDAY_MODE_DIRECT--}
+                       {--ADMIN_BIRTHDAY_MODE_DIRECT--}
                </td>
                <td class="bottom" align="center">
                        <input type="radio" name="birthday_mode" class="admin_normal" value="REF"$content[mode_ref] />
-                       {--BIRTHDAY_MODE_REF--}
+                       {--ADMIN_BIRTHDAY_MODE_REF--}
                </td>
        </tr>
        <tr>
index 28c65fcad8b21421c8269d1cc97c995721913096..488400de4191996a773060d97359f3e5ac832b9b 100644 (file)
@@ -8,7 +8,7 @@
                <td class="header_column bottom right" align="center"><strong>{--EMAIL--}</strong></td>
                <td class="header_column bottom right" align="center"><strong>{--MEMBER_JOINED--}</strong></td>
                <td class="header_column bottom right" align="center"><strong>{--LAST_SEEN--}</strong></td>
-               <td class="header_column bottom" align="center"><strong>{--AUTOPURGE_NOTIFIED--}</strong></td>
+               <td class="header_column bottom" align="center"><strong>{--ADMIN_AUTOPURGE_NOTIFIED--}</strong></td>
        </tr>
        $content[rows]
        <tr>