### WARNING: THIS FILE IS AUTO-GENERATED BY ./DOCS/todo-builder.sh (uid=/user=quix0r) ###
### DO NOT EDIT THIS FILE. ###
./autoreg.php:60:// @TODO Add processing of request here
-./beg.php:173: // @TODO Opps, what is missing here???
+./beg.php:172: // @TODO Opps, what is missing here???
./birthday_confirm.php:99: // @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/libs/refback_functions.php:61: // @TODO Try to rewrite the following unset()
./inc/libs/register_functions.php:296: // @TODO Rewrite these all to a single filter
./inc/libs/register_functions.php:372: // @TODO Rewrite this to a filter
-./inc/libs/register_functions.php:379: // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
-./inc/libs/register_functions.php:380: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
+./inc/libs/register_functions.php:379: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
./inc/libs/surfbar_functions.php:1540: // @TODO This can be somehow rewritten
./inc/libs/surfbar_functions.php:712:// @TODO Can't we use our new expression language instead of this ugly code?
./inc/libs/surfbar_functions.php:953: // @TODO Invalid salt should be refused
./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:1410: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1510: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1890: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1934:// @TODO Fix inconsistency between last_module and getWhat()
+./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:1511: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1891: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1935:// @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
// Add points to user or begging rallye account
function addPointsBeg ($userid, $points) {
- // 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;
-
// Is begging rallye active?
if (getConfig('beg_rallye') == 'Y') {
// Add points to rallye account
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']);
} // END - if
// Prepare data for the row template
- $content = array(
- 'userid' => $content['userid'],
- 'rid' => $content['refid'],
- 'points' => $content['points'],
- 'timemark' => generateDateTime($content['timemark'], $DT_MODE),
- );
+ $content['timemark'] = generateDateTime($content['timemark'], $DT_MODE);
// Load template and switch color
$OUT .= loadTemplate($mode . '_doubler_list_rows', true, $content);
}
// "Getter" for userid array which will return only one entry
-function getArrayFromRefbackLevel ($rid, $level) {
+function getArrayFromRefbackLevel ($refid, $level) {
//* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
- //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},level={$level}<br />");
+ //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):refid={$refid},level={$level}<br />");
// Init userids
$userIds = array();
`refid`=%s AND `level`=%s
ORDER BY
`userid` ASC",
- array($rid, $level), __FUNCTION__, __LINE__);
+ array($refid, $level), __FUNCTION__, __LINE__);
// Entries found?
//* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
if (!SQL_HASZERONUMS($result)) {
// Add all
while ($content = SQL_FETCHARRAY($result)) {
- //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
+ //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):refid={$refid},level={$level},userid={$content['userid']}<br />");
$userIds[] = $content['userid'];
} // END - while
} // END - if
SQL_FREERESULT($result);
// Return array
- //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />");
+ //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):refid={$refid},count()=".count($userIds)."<br />");
//* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $userIds;
}
array(bigintval($userid), $GLOBALS['refback_level'], bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])), __FUNCTION__, __LINE__);
// Move to next referal level and count his counter one up!
- $GLOBALS['refback_level']++; updateRefbackTable($GLOBALS['refback_refid'][($GLOBALS['refback_level'] - 1)]);
+ $GLOBALS['refback_level']++;
+ updateRefbackTable($GLOBALS['refback_refid'][($GLOBALS['refback_level'] - 1)]);
} // END - if
// Do we have another level here?
} // END - if
// Write his welcome-points
- // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
// @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`=0 LIMIT 1",
- array($userid), __FUNCTION__, __LINE__);
- if (SQL_HASZERONUMS($result)) {
- // Add only when the line was not found (maybe some more secure?)
- $locked = 'points';
-
- // Pay him later. First he has to confirm some mails!
- if (getConfig('ref_payout') > 0) $locked = 'locked_points';
-
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `%s`) VALUES (%s,0,'{?points_register?}')",
- array($locked, $userid), __FUNCTION__, __LINE__);
-
- // Update mediadata as well
- if ((isExtensionInstalledAndNewer('mediadata', '0.0.4')) && ($locked == 'points')) {
- // Update database
- updateMediadataEntry(array('total_points'), 'add', getConfig('points_register'));
- } // END - if
- } // END - if
+ addPointsDirectly('register_welcome', $userid, getConfig('points_register'));
// Write catgories
if ((is_array(postRequestParameter('cat'))) && (count(postRequestParameter('cat')))) {
if ((getConfig('ref_payout') == '0') && (postRequestParameter('ref_payout') > 0)) {
// Update account's ref_payout for "must-confirm"
addSql(sprintf("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=(%s - `mails_confirmed`)
-WHERE `mails_confirmed` < %s", $REF, $REF));
+WHERE
+ `mails_confirmed` < %s", $REF, $REF));
} elseif ((getConfig('ref_payout') > 0) && (postRequestParameter('ref_payout') == '0')) {
// Update account's ref_payout for "not-must-confirm"
addSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0");
// Sponsor not found
loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestParameter('id'))));
}
-} elseif (isGetRequestParameterSet('rid')) {
+} elseif (isGetRequestParameterSet('refid')) {
// Search for sponsor
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`='%s' LIMIT 1",
- array(bigintval(getRequestParameter('rid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('refid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Free memory
SQL_FREERESULT($result);
`refid`='%s'
ORDER BY
`id` ASC",
- array(bigintval(getRequestParameter('rid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('refid'))), __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
// List refs now
SQL_FREERESULT($result);
} else {
// No refs made so far
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_REFS_404', '<a href="{%url=modules.php?module=admin&what=list_sponsor&id=' . bigintval(getRequestParameter('rid')) . '%}">' . bigintval(getRequestParameter('rid')) . '</a>'));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_REFS_404', '<a href="{%url=modules.php?module=admin&what=list_sponsor&id=' . bigintval(getRequestParameter('refid')) . '%}">' . bigintval(getRequestParameter('refid')) . '</a>'));
}
} else {
// Sponsor not found
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestParameter('rid'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestParameter('refid'))));
}
} else {
// List all sponsors
* userid = Referal id wich should receive...
* points = ... xxx points
* sendNotify = shall I send the referal an email or not?
- * rid = inc/modules/guest/what-confirm.php need this
+ * refid = inc/modules/guest/what-confirm.php need this
* locked = Shall I pay it to normal (false) or locked (true) points ammount?
* 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, $rid = '0', $locked = false, $add_mode = 'ref') {
+function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $locked = false, $add_mode = 'ref') {
//* DEBUG: */ debugOutput('----------------------- <font color="#00aa00">' . __FUNCTION__ . ' - ENTRY</font> ------------------------<ul><li>');
// Convert mode to lower-case
$add_mode = strtolower($add_mode);
'userid' => $userid,
'points' => $points,
'notify' => $sendNotify,
- 'rid' => $rid,
+ 'refid' => $refid,
'locked' => $locked,
'mode' => 'add',
'sub_mode' => $add_mode,
$GLOBALS['cache_array']['ref_level'][$userid]--;
// Handle refback here if extension is installed
+ // @TODO Rewrite this to a filter
if (isExtensionActive('refback')) {
updateRefbackTable($userid);
} // END - if
$content[userid]
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center" width="100">
- $content[rid]
+ $content[refid]
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center" width="160">
{%pipe,translateComma=$content[points]%}