### 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
./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
// 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",
$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
// 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",
// Language definitions
addMessages(array(
- 'AUTOPURGE_MEMBER_SUBJECT' => "{?POINTS?}-Gutschrift bei Auto-Loeschung",
- 'AUTOPURGE_MEMBER_INACTIVE_SUBJECT' => "Inaktivitaet --> Account wird bald gelöscht.",
- 'AUTOPURGE_MEMBER_UNCONFIRMED_SUBJECT' => "Löschung --> EMail-Adresse nicht bestätigt.",
+ 'MEMBER_AUTOPURGE_SUBJECT' => "{?POINTS?}-Gutschrift bei Auto-Loeschung",
+ 'MEMBER_AUTOPURGE_INACTIVE_SUBJECT' => "Inaktivitaet --> Account wird bald gelöscht.",
+ 'MEMBER_AUTOPURGE_UNCONFIRMED_SUBJECT' => "Löschung --> EMail-Adresse nicht bestätigt.",
'ADMIN_AUTOPURGE_SUBJECT' => "[Auto-Purge:] Bestätigungslinks",
'ADMIN_AUTOPURGE_INACTIVE_SUBJECT' => "Inaktive Mitglieder benachrichtigt",
'ADMIN_AUTOPURGE_DELETE_SUBJECT' => "[Auto-Purge:] Inaktiven Mitgliedern",
'ADMIN_AUTOPURGE_TASKS_SUBJECT' => "[Auto-Purge:] Zu lö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öschungen",
'ADMIN_AUTOPURGE_INACTIVE' => "Sollten inaktive Accounts erkannt und gelöscht werden?",
'ADMIN_AUTOPURGE_INACTIVE_SINCE' => "Dauer bis bestätigtes Account als inaktiv markiert wird",
'ADMIN_AUTOPURGE_NOTIFY_UNCONFIRMED' => "Benachrichtigung bei unbestätigte Accounts löschen",
'ADMIN_AUTOPURGE_NOTIFY_TASKS' => "Benachrichtigung bei veraltete Aufgaben lö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öschten Mitgliedern löschen",
'ADMIN_AUTOPURGE_DELETE_MAILS' => "Sollen die Mailbuchungen von bereits gelöschten Mitgliedern gelöscht werden?",
// Language definitions
addMessages(array(
- 'HAPPY_BIRTHDAY_SUBJECT' => "Herzlichen Glückwunsch zum Geburtstag.",
- 'ADMIN_CONFIG_BIRTHDAY_HEADER' => "Einstellungen zu Geburtstagsmails",
+ 'MEMBER_HAPPY_BIRTHDAY_SUBJECT' => "Herzlichen Glückwunsch zum Geburtstag.",
+ 'ADMIN_CONFIG_BIRTHDAY_TITLE' => "Einstellungen zu Geburtstagsmails",
'ADMIN_BIRTHDAY_POINTS' => "{?POINTS?} als "Geburtstagsgeschenk"",
'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ü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>",
));
// 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
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
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
// 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 = '';
// 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') {
// 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!)
// 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
* 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);
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
//* 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
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
}
// 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",
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
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]
?>
// 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
// 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')) {
<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>
<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>