./inc/extensions/ext-yoomedia.php:121: // @TODO Can this be moved into a database table?
./inc/extensions/ext-yoomedia.php:54:// @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y');
./inc/extensions-functions.php:155: // @TODO Do we still need this? setExtensionUpdateNotes('');
-./inc/extensions-functions.php:1944:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
+./inc/extensions-functions.php:1945:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
./inc/extensions-functions.php:425:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
./inc/extensions-functions.php:562: // @TODO Extension is loaded, what next?
./inc/filter/bonus_filter.php:56: // @TODO This query isn't right, it will only update if the user was for a longer time away!
./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/user_functions.php:146: // @TODO These two constants are no longer used, maybe we reactivate this code?
-./inc/libs/user_functions.php:234:// @TODO Double-check configuration entry here
-./inc/libs/user_functions.php:329: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
-./inc/libs/user_functions.php:358: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
+./inc/libs/user_functions.php:159: // @TODO These two constants are no longer used, maybe we reactivate this code?
+./inc/libs/user_functions.php:250:// @TODO Double-check configuration entry here
+./inc/libs/user_functions.php:345: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
+./inc/libs/user_functions.php:374: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
./inc/libs/yoomedia_functions.php:114: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
./inc/load_config.php:75: // @TODO Rewrite them to avoid this else block
./inc/loader/load-extension.php:13: * @TODO Rewrite this whole file *
./inc/modules/member/what-payout.php:194: // @TODO Rewrite this to a filter
./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter?
./inc/modules/member/what-rallyes.php:89: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
-./inc/modules/member/what-refback.php:124: // @TODO UNUSED: $refRow['status'] = translateUserStatus($refRow['status']);
./inc/modules/member/what-reflinks.php:52:// @TODO Move this into a filter
./inc/modules/member/what-transfer.php:128: // @TODO Rewrite this to a filter
./inc/modules/member/what-unconfirmed.php:144: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/modules/member/what-unconfirmed.php:209: // @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:1267: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1529: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1617: // @TODO Rewrite these lines to a filter
-./inc/mysql-manager.php:1641: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2007: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2051:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1257: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1520: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1608: // @TODO Rewrite these lines to a filter
+./inc/mysql-manager.php:1632: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2001: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2045:// @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
* -------------------------------------------------------------------- *
* File : daily_100_bonus.php *
* -------------------------------------------------------------------- *
- * Short description : Check for 100% clickrate order *
+ * Short description : Check for 100% click rate order *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Nach Mailbestaetigungen mit 100% Klickrate s. *
* -------------------------------------------------------------------- *
// Add the filters
registerFilter('post_add_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun());
- registerFilter('sub_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun());
+ registerFilter('post_sub_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
// Remove the filters
unregisterFilter(__FUNCTION__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
- unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
+ unregisterFilter(__FUNCTION__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
// Add the filters
registerFilter('post_add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
- registerFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
+ registerFilter('post_sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
// Remove the filters
unregisterFilter(__FUNCTION__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
- unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
+ unregisterFilter(__FUNCTION__, __LINE__, 'post_sub_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
} // END - if
// Version number
-setThisExtensionVersion('0.4.2');
+setThisExtensionVersion('0.4.3');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2'));
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
case 'register': // Do stuff when installation is running
addDropTableSql('user_cats');
addCreateTableSql('user_cats', "
-`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
addDropTableSql('user_data');
addCreateTableSql('user_data', "
-`userid` BIGINT(22) NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) NOT NULL AUTO_INCREMENT,
`surname` VARCHAR(255) NOT NULL DEFAULT '',
`family` VARCHAR(255) NOT NULL DEFAULT '',
`street_nr` VARCHAR(255) NOT NULL DEFAULT '',
`password` VARCHAR(255) NOT NULL DEFAULT '',
`max_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`receive_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`refid` BIGINT(22) NOT NULL DEFAULT 0,
+`refid` BIGINT(20) NOT NULL DEFAULT 0,
`status` ENUM('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
`user_hash` VARCHAR(255) NULL DEFAULT NULL,
`REMOTE_ADDR` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
addDropTableSql('user_points');
addCreateTableSql('user_points', "
-`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(22) NOT NULL DEFAULT 0,
+`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) NOT NULL DEFAULT 0,
`ref_depth` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
`points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`locked_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
// Add special fix include to fix filters
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='chk_regs' LIMIT 1");
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Überflüssiges Menü <strong>chk_regs</strong> entfernt, dies kann mit <strong>list_user</strong> übernommen werden.");
+ break;
+
+ case '0.4.3': // SQL queries for v0.4.3
+ // Add special fix include to fix filters
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `refid` `refid` BIGINT(20) NULL DEFAULT NULL");
+
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Überflüssiges Menü <strong>chk_regs</strong> entfernt, dies kann mit <strong>list_user</strong> übernommen werden.");
break;
// Determines database column name from given subject and locked
function determinePointsColumnFromSubjectLocked ($subject, $locked) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',locked=' . intval($locked) . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',locked=' . intval($locked) . ' - ENTERED!');
// Default is 'normal' points
$pointsColumn = 'points';
$pointsColumn = $filterData['column'];
// Return it
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',locked=' . intval($locked) . ',pointsColumn=' . $pointsColumn . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',locked=' . intval($locked) . ',pointsColumn=' . $pointsColumn . ' - EXIT!');
return $pointsColumn;
}
'MEMBER_STATS_CONTENT' => "Statistiken versandter Mails",
'MEMBER_EMAIL_END_SEND' => "Vollständig versendet",
'MEMBER_EMAIL_CONFIRMED' => "Bestätigt",
- 'MEMBER_EMAIL_PERCENT' => "Klickrate",
+ 'MEMBER_CLICK_RATE' => "Klickrate",
'MEMBER_NO_MAILS_TO_CONFIRM' => "Keine Mails übrig zum Bestätigen.",
'MEMBER_SID' => "Mail-Id",
'CONFIRM_LINK' => "Bestätigungslink",
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Payback refback for refid and reduce it for current user
function addRefbackPoints ($userid, $ref, $points, $ref_points) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',points=' . $points . ',ref_points=' . $ref_points . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',points=' . $points . ',ref_points=' . $ref_points . ' - ENTERED!');
// Back ref depths
$GLOBALS['refback_depth'][$userid][$ref] = $GLOBALS['ref_level'];
initReferalSystem();
// "Walk" through all refids
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',level=' . $content['level'] . ',percents=' . $content['percents'] . ',points=' . $points . ' - LOOP START!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',level=' . $content['level'] . ',percents=' . $content['percents'] . ',points=' . $points . ' - LOOP START!');
foreach (getArrayFromRefbackLevel($userid, $content['level']) as $refid) {
// Skip level zero or if both are the same
if ($userid == $refid) {
// Get refback percents
$percents = getRefbackPercents($userid, $refid);
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',refid=' . $refid . ',points=' . $points . ',percents=' . $percents);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',refid=' . $refid . ',points=' . $points . ',percents=' . $percents);
// Some percents given?
if ($percents > 0) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'points=' . $points . ',[percents]=' . $content['percents'] . ',percents=' . $percents . ',level=' . $content['level']);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'points=' . $points . ',[percents]=' . $content['percents'] . ',percents=' . $percents . ',level=' . $content['level']);
// Calculate points for refback
$refback = $points * ($content['percents'] / 100) * ($percents / 100);
// Update refback table ('refid' and 'userid' must be exchanged!)
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_refs` SET `points`=`points`+%s WHERE `userid`=%s AND `refid`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_user_refs`
+SET
+ `points`=`points`+%s
+WHERE
+ `userid`=%s AND
+ `refid`=%s
+LIMIT 1",
array(
$refback,
$refid,
} // END - if
// Add points again, but only directly
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refback=' . $refback . ',userid=' . $userid . ',ref=' . $ref . ',refid=' . $refid . ' - UPDATE! (' . SQL_AFFECTEDROWS() . ')');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refback=' . $refback . ',userid=' . $userid . ',ref=' . $ref . ',refid=' . $refid . ' - UPDATE! (' . SQL_AFFECTEDROWS() . ')');
addPointsThroughReferalSystem(sprintf("refback:%s", $refid), $userid, $refback);
// Reduce points if refid is found
if ($refid == $ref) {
// Reduce points here!
$return = $points * ($content['percents'] / 100) - $refback;
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'return=' . $return . ' - REDUCED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'return=' . $return . ' - REDUCED!');
} // END - if
} // END - if
} // END foreach
$GLOBALS['ref_level'] = $GLOBALS['refback_depth'][$userid][$ref];
// Return them
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',points=' . $points . ',ref_points=' . $ref_points . ',return=' . $return . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',points=' . $points . ',ref_points=' . $ref_points . ',return=' . $return . ' - EXIT!');
return $return;
}
// "Getter" for refback percents
function getRefbackPercents ($userid, $ref) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ' - ENTERED!');
// Skip identical ids
if ($userid == $ref) {
return 0;
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]);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',percents=' . $GLOBALS['refback_percents'][$userid][$ref]);
} else {
// Debug log
logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ' - No entry found. :-(');
} // END - if
// Return percents
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',refback_percents=' . $GLOBALS['refback_percents'][$userid][$ref] . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ',refback_percents=' . $GLOBALS['refback_percents'][$userid][$ref] . ' - EXIT!');
return $GLOBALS['refback_percents'][$userid][$ref];
}
// "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=' . $refid . ',level=' . $level);
// Init userids
$userIds = array();
array($refid, $level), __FUNCTION__, __LINE__);
// Entries found?
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'numRows=' . SQL_NUMROWS($result));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'numRows=' . SQL_NUMROWS($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=' . $refid . ',level=' . $level . ',userid=' . $content['userid']);
$userIds[] = $content['userid'];
} // END - while
} // END - if
SQL_FREERESULT($result);
// Return array
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . $refid . ',userIds()=' . count($userIds) . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . $refid . ',userIds()=' . count($userIds) . ' - EXIT!');
return $userIds;
}
// Update "refback table"
function updateRefbackTable ($userid) {
- // Make it sure referal level zero (member him-/herself) is at least selected
- if (empty($GLOBALS['refback_level'])) {
- $GLOBALS['refback_level'] = NULL;
- } // END - if
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $GLOBALS['refback_level'] . ' - ENTERED!');
-
- // Init refid and variables
- $GLOBALS['refback_refid'][$GLOBALS['refback_level']] = '0';
- $old = '0';
- $minus = '0';
-
- // Check for his referal
- $result_refid = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=%s ORDER BY `userid` ASC",
- array(bigintval($userid)), __FUNCTION__, __LINE__);
-
- // When no entry was updated then we have to create it here
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SQL_NUMROWS()=' . SQL_NUMROWS($result_refid));
- if (!SQL_HASZERONUMS($result_refid)) {
- // Load all refids
- while (list($GLOBALS['refback_refid'][$GLOBALS['refback_level']]) = SQL_FETCHROW($result_refid)) {
- // Remmber userid
- $GLOBALS['refback_userid'][$GLOBALS['refback_refid'][$GLOBALS['refback_level']]] = $userid;
-
- // Refid set?
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $GLOBALS['refback_refid'][$GLOBALS['refback_level']]);
- if (($GLOBALS['refback_refid'][$GLOBALS['refback_level']] > 0) && ($GLOBALS['refback_refid'][$GLOBALS['refback_level']] != $userid) && (isset($GLOBALS['refback_refid'][$GLOBALS['refback_level']]))) {
- // New userid?
- if ((isset($GLOBALS['refback_refid'][$GLOBALS['refback_level']-1])) && (isset($GLOBALS['refback_userid'][$GLOBALS['refback_refid'][$GLOBALS['refback_level']-1]]))) {
- // New userid!
- $old = $userid;
- $userid = $GLOBALS['refback_userid'][$GLOBALS['refback_refid'][$GLOBALS['refback_level']-1]];
- $minus = 1;
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',old=' . $old . ',level=' . $GLOBALS['refback_level'] . ',ref=' . $GLOBALS['refback_refid'][$GLOBALS['refback_level']] . ' - NEW UID!');
- } // END - if
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
+ // Load all referals
+ loadRefbackTable($userid);
- // Check existence
- if (is_null($GLOBALS['refback_level'])) {
- // Level is NULL
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level` IS NULL AND `refid`=%s LIMIT 1",
- array(
- bigintval($userid),
- bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])
- ), __FUNCTION__, __LINE__);
- } else {
- // Level is > 0
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level`=%s AND `refid`=%s LIMIT 1",
- array(
- bigintval($userid),
- bigintval($GLOBALS['refback_level']),
- bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])
- ), __FUNCTION__, __LINE__);
- }
-
- // Do we have no entry?
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $GLOBALS['refback_level'] . ',ref=' . $GLOBALS['refback_refid'][$GLOBALS['refback_level']] . ',minus=' . $minus . ',numRows=' . SQL_NUMROWS($result) . ' - FOUND!');
- if (SQL_HASZERONUMS($result)) {
- // Insert this level
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $GLOBALS['refback_level'] . ',ref=' . $GLOBALS['refback_refid'][$GLOBALS['refback_level']] . ' - ADD!');
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`, `level`, `refid`) VALUES (%s,%s,%s)",
- 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)]);
- } // END - if
+ // Add missing level > 1
+ addMissingRefbackLevels($userid);
+
+ // The last step is to flush all userid's entries to the database
+ flushRefbackTableToDatabase($userid);
- // Do we have another level here?
- if ((($GLOBALS['refback_level']-$minus) > 0) && ($old > 0)) {
- // Restore old one
- $userid = $old;
-
- // Shall we add this as well?
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level`=%s AND `refid`=%s LIMIT 1",
- array(
- bigintval($userid),
- (bigintval($GLOBALS['refback_level']) - $minus),
- bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])
- ), __FUNCTION__, __LINE__);
-
- // Do we have no entry?
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . ($GLOBALS['refback_level'] - $minus) . ',minus=' . $minus . ',ref=' . $GLOBALS['refback_refid'][$GLOBALS['refback_level']] . ',numRows=' . SQL_NUMROWS($result) . ' - BACK!');
- if (SQL_HASZERONUMS($result)) {
- // Insert this level
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`, `level`, `refid`) VALUES (%s,%s,%s)",
- array(
- bigintval($userid),
- ($GLOBALS['refback_level'] - $minus),
- bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])
- ), __FUNCTION__, __LINE__);
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . ($GLOBALS['refback_level'] - $minus) . ',ref=' . $GLOBALS['refback_refid'][$GLOBALS['refback_level']] . ' - RETURNED!');
- } // END - if
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - EXIT!');
+}
+
+// Loads all referals for given userid
+function loadRefbackTable ($userid) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
+ // Init array
+ $GLOBALS['refback_refid'][$userid] = array();
+
+ // Get all level entries from the refsystem table
+ $result = SQL_QUERY_ESC('SELECT `level` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `userid`=%s ORDER BY `level` ASC',
+ array($userid), __FUNCTION__, __LINE__);
+
+ // Do we have entries?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',SQL_NUMROWS()=' . SQL_NUMROWS($result));
+ if (SQL_NUMROWS($result) > 0) {
+ // Then walk through all levels
+ while (list($level) = SQL_FETCHROW($result)) {
+ // Init array
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level);
+ $GLOBALS['refback_refid'][$userid][$level] = array();
+
+ // Level is = 1?
+ if ($level == 1) {
+ // Load all referals of this user
+ $result_refs = SQL_QUERY_ESC('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=%s ORDER BY `userid` ASC',
+ array($userid), __FUNCTION__, __LINE__);
+
+ // Do we have entries?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',SQL_NUMROWS()=' . SQL_NUMROWS($result_refs));
+ if (SQL_NUMROWS($result_refs) > 0) {
+ // Then again walk through all
+ while (list($refid) = SQL_FETCHROW($result_refs)) {
+ // Add this refid
+ $GLOBALS['refback_refid'][$userid][$level][] = $refid;
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid);
+ // Load the refid's array as well
+ loadRefbackTable($refid);
+ } // END - while
} // END - if
+
+ // Free result
+ SQL_FREERESULT($result_refs);
} // END - if
} // END - while
-
- // Free memory
- SQL_FREERESULT($result_refid);
} // END - if
- // When he has a referal...
- if ((($GLOBALS['refback_refid'][$GLOBALS['refback_level']] == $userid) || ($GLOBALS['refback_refid'][$GLOBALS['refback_level']] == '0')) && (isExtensionInstalledAndNewer('cache', '0.1.2')) && (!isset($GLOBALS['refback_cached']))) {
- // Remove cache here
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $GLOBALS['refback_refid'][$GLOBALS['refback_level']] . ' - CACHE!');
- if ($GLOBALS['cache_instance']->loadCacheFile('refback')) $GLOBALS['cache_instance']->removeCacheFile();
- $GLOBALS['refback_cached'] = 1;
+ // Free result
+ SQL_FREERESULT($result);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - EXIT!');
+}
+
+// Adds missing refback levels to the array
+function addMissingRefbackLevels ($userid) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
+ // If the array is gone, you have called this function without calling loadRefbackTable()
+ if (!isset($GLOBALS['refback_refid'][$userid])) {
+ // Please fix your code
+ debug_report_bug(__FUNCTION__, __LINE__, 'Called without calling loadRefbackTable() before! userid=' . $userid);
} // END - if
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',count()=' . count($GLOBALS['refback_refid'][$userid]));
+
+ // Now walk through the array, first levels
+ foreach ($GLOBALS['refback_refid'][$userid] as $level=>$levelArray) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',count()=' . count($levelArray));
+ // Next are the users
+ foreach ($levelArray as $refid) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid);
+ // Does the refid have an array?
+ if (isset($GLOBALS['refback_refid'][$refid])) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid . ',count()=' . count($GLOBALS['refback_refid'][$refid]));
+ // Okay, then walk through here, too
+ foreach ($GLOBALS['refback_refid'][$refid] as $refLevel=>$refArray) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid . ',refLevel=' . $refLevel . ',count()=' . count($refArray));
+ // 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);
+ // Is the refRefid not in?
+ if ((!isset($GLOBALS['refback_refid'][$userid][$newLevel])) || (!in_array($refRefid, $GLOBALS['refback_refid'][$userid][$newLevel]))) {
+ // Then we must add this ref's refid to the userid's next level
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',newLevel=' . $newLevel . ',refRefid=' . $refRefid . ' - ADDED!');
+ $GLOBALS['refback_refid'][$userid][$newLevel][] = $refRefid;
+ } // END - if
+ } // END - foreach
+ } // END - foreach
+ } // END - foreach
+ } // END - foreach
+ } // END - foreach
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - EXIT!');
+}
- // "Walk" back here
- $GLOBALS['refback_level']--;
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refback_level=' . $GLOBALS['refback_level'] .' - LEVEL!');
+// Flush all entries for given userid to database
+function flushRefbackTableToDatabase ($userid) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
+ // If the array is gone, you have called this function without calling loadRefbackTable()
+ if (!isset($GLOBALS['refback_refid'][$userid])) {
+ // Please fix your code
+ debug_report_bug(__FUNCTION__, __LINE__, 'Called without calling loadRefbackTable() before! userid=' . $userid);
+ } // END - if
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',count()=' . count($GLOBALS['refback_refid'][$userid]));
- // Fix empty refid
- if (!isset($GLOBALS['refback_refid'][$GLOBALS['refback_level']-1])) {
- $GLOBALS['refback_refid'][$GLOBALS['refback_level']-1] = '0';
+ // If no entries are there, skip this whole step
+ if (count($GLOBALS['refback_refid'][$userid]) == 0) {
+ // No entries found
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ABORTING...');
+ return;
} // END - if
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refback_level=' . $GLOBALS['refback_level'] . ',ref=' . $GLOBALS['refback_refid'][$GLOBALS['refback_level']-1] . ' - EXIT!');
+
+ // Prepare SQL
+ $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`,`level`,`refid`) VALUES ';
+
+ // Now walk through the array, first levels
+ foreach ($GLOBALS['refback_refid'][$userid] as $level=>$levelArray) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',count()=' . count($levelArray));
+ // Next are the users
+ foreach ($levelArray as $refid) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid);
+ // Query the user_refs table
+ list($count) = SQL_FETCHROW(SQL_QUERY_ESC('SELECT COUNT(`id`) AS `count` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level`=%s AND `refid`=%s LIMIT 1',
+ array(
+ $userid,
+ $level,
+ $refid
+ ), __FUNCTION__, __LINE__));
+
+ // Do we have no entry?
+ if ($count == 0) {
+ // Then add it to the SQL
+ $SQL .= '(' . $userid . ',' . $level . ',' . $refid . '),';
+ } // END - if
+ } // END - foreach
+ } // END - foreach
+
+ // Remove last comma from SQL
+ $SQL = substr($SQL, 0, -1);
+
+ // And run it
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',SQL=' . $SQL);
+ SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - EXIT!');
}
// "Getter" for array for user refs in given level
function getArrayFromRefbackUserRefs ($userid, $level) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ' - ENTERED!');
// Default is no refs and no nickname
$refs = array();
r.`points`,
d.`status`,
d.`joined`,
+ d.`mails_confirmed`,
+ d.`emails_received`,
d.`refid` AS `level_refid`
FROM
`{?_MYSQL_PREFIX?}_user_refs` AS r
if (!SQL_HASZERONUMS($result)) {
// Fetch all entries
while ($row = SQL_FETCHARRAY($result)) {
+ // Init click rate
+ $row['click_rate'] = '0';
+
+ // Does he have received some mails?
+ if ($row['emails_received'] > 0) {
+ // Calculate click rate
+ $row['click_rate'] = ($row['mails_confirmed'] / $row['emails_received'] * 100);
+ } // END - if
+
// Add row
$refs[$row['id']] = $row;
} // END - while
SQL_FREERESULT($result);
// Return result
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refs()=' . count($refs) . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refs()=' . count($refs) . ' - EXIT!');
return $refs;
}
// "Getter" for refback entry
function getArrayFromUserRefbackData ($id) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ' - ENTERED!');
// Default data is nothing
$data = array();
SQL_FREERESULT($result);
// Return entry
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ',data()=' . count($data) . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ',data()=' . count($data) . ' - EXIT!');
return $data;
}
// Update refback percents (but with some sanity-checks!
function updateMemberRefbackPercents ($id, $percents) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ',percents=' . $percents . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ',percents=' . $percents . ' - ENTERED!');
// Default status is failed
$status['message'] = '{--MEMBER_REFBACK_ERROR_GENERAL--}';
$status['ok'] = true;
// Return status array
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ',percents=' . $percents . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ',percents=' . $percents . ' - EXIT!');
return $status;
}
foreach (getArrayFromRefbackUserRefs(getMemberId(), $content['level']) as $refRow) {
// Not-deleted account is default
$deleted = false;
- if (is_null($refRow['status'])) $deleted = true;
+ if (is_null($refRow['status'])) {
+ $deleted = true;
+ } // END - if
// Add/"translate" more content
- // @TODO UNUSED: $refRow['status'] = translateUserStatus($refRow['status']);
+ $refRow['click_rate'] = translateComma($refRow['click_rate'], true, 1);
$refRow['joined'] = generateDateTime($refRow['joined'], '3');
// Load row template
// Check for users ref in this level
foreach (getUserReferalPoints(getMemberId(), $content['level']) as $refRow) {
// Add/"translate" more content
- $refRow['clickrate'] = translateComma($refRow['clickrate'], true, 1);
+ $refRow['click_rate'] = translateComma($refRow['click_rate'], true, 1);
// Load row template
$rows .= loadTemplate('member_ref_list_row', true, $refRow);
$OUT = $prefix . '<strong><a class="you_are_here" href="{%url=modules.php?module=' . $modCheck . '&' . $type . '=' . $search . $LINK_ADD . '%}">' . getTitleFromMenu($accessLevel, $search, $type, $ADD) . '</a></strong>';
// Can we close the you-are-here navigation?
- //* DEBUG: */ debugOutput(__LINE__.'*'.$type.'/'.getWhat().'*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type . 'getWhat()=' . getWhat());
if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
- //* DEBUG: */ debugOutput(__LINE__.'+'.$type.'+');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type);
// Add closing div and br-tag
$OUT .= '</div>';
$GLOBALS['nav_depth'] = '0';
`sort` ASC",
array($mode), __FUNCTION__, __LINE__);
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . ':' . getWhat() . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
if (!SQL_HASZERONUMS($result_main)) {
// There are menus available, so we simply display them... :)
$GLOBALS['rows'] = '';
while ($content = SQL_FETCHARRAY($result_main)) {
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . ':' . getWhat() . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
// Disable the block-mode
enableBlockMode(false);
$OUT = '';
// Full file name for checking menu
- //* DEBUG: */ debugOutput(__LINE__ . ':!!!!' . $content['sub_what'] . '!!!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sub_what=' . $content['sub_what']);
$inc = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']);
if (isIncludeReadable($inc)) {
// Mark currently selected menu - open
if (isFileReadable($INC)) {
// Load include file
if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_begin', true, $mode);
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . '/' . getWhat().'*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
loadInclude($INC);
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . '/' . getWhat() . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_end', true, $mode);
}
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . '/' . $content['sub_what'] . ':' . getWhat() . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
}
// Free result
// Count one up
$main_cnt++;
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . ':' . getWhat() . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
if (SQL_NUMROWS($result_main) > $main_cnt) {
// Add seperator
$GLOBALS['rows'] .= loadTemplate('menu_seperator', true, $mode);
);
// Load main template
- //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . '/' . $content['sub_what'] . ':' . getWhat() . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
loadTemplate('menu_table', false, $content);
} // END - if
}
$adminId = getCurrentAdminId();
$passCookie = getAdminMd5();
} // END - if
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminId.'/'.$passCookie);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'mainId=' . $adminId . 'passCookie=' . $passCookie);
// Abort if admin id is zero
if ($adminId == '0') {
$add = '';
if ((!isAdmin()) && ($mode != 'admin')) $add = " AND `locked`='N'";
- //* DEBUG: */ debugOutput(__LINE__ . ':' . $mode . '/' . $action . '/' . $what . '*');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'mode=' . $mode . ',action=' . $action . ',what=' . $what);
if (($mode != 'admin') && ($updateEntry === true)) {
// Update guest or member menu
$sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `counter`=`counter`+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
// Get action value from mode (admin/guest/member) and what-value
function getActionFromModuleWhat ($module, $what) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'module=' . $module . ',what=' . $what);
// Init status
$data['action'] = '';
- //* DEBUG: */ debugOutput(__LINE__ . '=' . $module . '/'.$what . '/' . getAction() . '=');
if (!isExtensionInstalledAndNewer('sql_patches', '0.0.5')) {
// sql_patches is missing so choose depending on mode
if (isWhatSet()) {
// Init count/sum
$data['res'] = '0';
- //* DEBUG: */ debugOutput($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',tableName=' . $tableName . ',lookFor=' . $lookFor . ',whereStatement=' . $whereStatement . ',add=' . $add);
if ((empty($search)) && ($search != '0')) {
// Count or sum whole table?
if ($countRows === true) {
}
} elseif (($countRows === true) || ($lookFor == 'userid')) {
// Count rows
- //* DEBUG: */ debugOutput('COUNT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'COUNT!');
$result = SQL_QUERY_ESC("SELECT COUNT(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`%s'%s'".$add,
array(
$lookFor,
), __FUNCTION__, __LINE__);
} else {
// Add all rows
- //* DEBUG: */ debugOutput('SUM!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SUM!');
$result = SQL_QUERY_ESC("SELECT SUM(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`%s'%s'".$add,
array(
$lookFor,
}
// Return value
- //* DEBUG: */ debugOutput('ret=' . $data['res']);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'res=' . $data['res']);
return $data['res'];
}
// Getter fro ref level percents
// Initializes the referal system
function initReferalSystem () {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' Referal system initialized!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' Referal system initialized!');
$GLOBALS['ref_level'] = NULL;
$GLOBALS['ref_system'] = true;
}
* 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?
- * paymentMethod = Deprecated parameter, the payment method
*/
-function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = '0', $paymentMethod = 'INVALID') {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',sendNotify=' . intval($sendNotify) . ',refid=' . $refid . ',paymentMethod=' . $paymentMethod . ' - ENTERED!');
+function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = '0') {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',refid=' . $refid . ' - ENTERED!');
// By default nothing has been added
$added = false;
- // Convert mode to upper-case
- $paymentMethod = strtoupper($paymentMethod);
-
- // Is it not invalid?
- if ($paymentMethod != 'INVALID') {
- // We are not using this anymore
- debug_report_bug(__FUNCTION__, __LINE__, 'subject=' . $subject . ',paymentMethod=' . $paymentMethod . ' - deprecated parameter used.');
- } // END - if
-
// Determine payment method and notification
- $paymentMethod = getPaymentMethodFromSubject($subject);
+ $paymentMethod = strtoupper(getPaymentMethodFromSubject($subject));
$sendNotify = isPaymentRecipientNotificationEnabled($subject);
// When $userid = '0' add points to jackpot
} // END - if
// Check user account
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',points=' . $points);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',points=' . $points);
if (fetchUserData($userid)) {
// Determine wether the user has some mails to click before he/she gets the points
$locked = ifUserPointsLocked($userid);
// 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='.$GLOBALS['ref_level'].',per='.$per.',mode='.$paymentMethod);
// 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);
+ //* 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
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!');
+ //* 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.',data='.$GLOBALS['cache_array']['add_userid'][$userid].',ref_points='.$ref_points.',depth='.$GLOBALS['ref_level'].' - AFTER!');
} // END - if
// Update points...
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='.$GLOBALS['ref_level'].',mode='.$paymentMethod.' - UPDATE! ('.SQL_AFFECTEDROWS().')');
// No entry updated?
if (SQL_HASZEROAFFECTED()) {
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='.$GLOBALS['ref_level'].',mode='.$paymentMethod.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
} // END - if
// Check affected rows
$added = SQL_AFFECTEDROWS();
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
// Prepare data for the filter
$filterData = array(
// Extract $added
$added = $filterData['added'];
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added));
// Points updated, maybe I shall send him an email?
if (($sendNotify === true) && (isValidUserId(getUserData('refid'))) && ($locked === false)) {
// Increase referal level
$GLOBALS['ref_level']++;
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' Referal level increased, ref_level=' . $GLOBALS['ref_level']);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' Referal level increased, ref_level=' . $GLOBALS['ref_level']);
// Maybe there's another ref?
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!');
+ //* 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')));
} // 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=' . $refid . ',paymentMethod=' . $paymentMethod . ' - EXIT!');
return $added;
}
// Updates the referal counter
function updateReferalCounter ($userid) {
- // Make it sure referal level zero (member him-/herself) is at least selected
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
+ // Init referal id
+ $ref = NULL;
+
+ // Check for his referal
+ if (fetchUserData($userid)) {
+ // Get it
+ $ref = getUserData('refid');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . makeZeroToNull($ref) . ' - FETCHED!');
+ } // END - if
+
+ // Init entries
if (empty($GLOBALS['cache_array']['ref_level'][$userid])) {
$GLOBALS['cache_array']['ref_level'][$userid] = NULL;
} // END - if
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid.',level='.$GLOBALS['cache_array']['ref_level'][$userid]);
+ if (empty($GLOBALS['cache_array']['ref_level'][$ref])) {
+ $GLOBALS['cache_array']['ref_level'][$ref] = NULL;
+ } // END - if
+
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . makeZeroToNull($ref));
- // Update counter
- if (!is_null($GLOBALS['cache_array']['ref_level'][$userid])) {
- // Level is > 0
+ // When he has a referal...
+ if (($ref > 0) && ($ref != $userid)) {
+ // Move to next referal level and count his counter one up
+ $GLOBALS['cache_array']['ref_level'][$ref] = $GLOBALS['cache_array']['ref_level'][$userid] + 1;
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref(' . $ref . ')=' . $GLOBALS['cache_array']['ref_level'][$ref] . ' - ADVANCED!');
+
+ // Update counter
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `counter`=`counter`+1 WHERE `userid`=%s AND `level`=%s LIMIT 1",
array(
- bigintval($userid),
- bigintval($GLOBALS['cache_array']['ref_level'][$userid])
+ bigintval($ref),
+ bigintval($GLOBALS['cache_array']['ref_level'][$ref])
), __FUNCTION__, __LINE__);
// When no entry was updated then we have to create it here
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'updated=' . SQL_AFFECTEDROWS());
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref=' . $ref . ',level=' . $GLOBALS['cache_array']['ref_level'][$ref] . ',updated=' . SQL_AFFECTEDROWS());
if (SQL_HASZEROAFFECTED()) {
// First count!
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)",
array(
- bigintval($userid),
- makeZeroToNull($GLOBALS['cache_array']['ref_level'][$userid])
+ bigintval($ref),
+ makeZeroToNull($GLOBALS['cache_array']['ref_level'][$ref])
), __FUNCTION__, __LINE__);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',SQL_AFFECTEDROWS()=' . SQL_AFFECTEDROWS());
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref=' . $ref . ',level=' . $GLOBALS['cache_array']['ref_level'][$ref] . ',SQL_AFFECTEDROWS()=' . SQL_AFFECTEDROWS());
} // END - if
- } // END - if
- // Init referal id
- $ref = '0';
-
- // Check for his referal
- if (fetchUserData($userid)) {
- // Get it
- $ref = getUserData('refid');
- } // END - if
-
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid.',ref='.$ref);
-
- // When he has a referal...
- if (($ref > 0) && ($ref != $userid)) {
- // Move to next referal level and count his counter one up!
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref='.$ref.' - ADVANCE!');
- $GLOBALS['cache_array']['ref_level'][$userid]++;
+ // Advance to next level
updateReferalCounter($ref);
} elseif ((($ref == $userid) || ($ref == '0')) && (isExtensionInstalledAndNewer('cache', '0.1.2'))) {
// Remove cache here
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref='.$ref.' - CACHE!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref=' . makeZeroToNull($ref) . ' - CACHE!');
rebuildCache('refsystem', 'refsystem');
}
- // "Walk" back here
- $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
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . makeZeroToNull($ref) . ',level=' . makeZeroToNull($GLOBALS['cache_array']['ref_level'][$ref]) . ' - EXIT!');
}
// Sends out mail to all administrators. This function is no longer obsolete
// Default is empty
$what = '';
- //* DEBUG: */ debugOutput(__LINE__.'!'.$modCheck.'!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'modCheck=' . $modCheck);
switch ($modCheck) {
case 'admin':
$what = 'overview';
function subtractPoints ($subject, $userid, $points) {
// Add points to used points
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `used_points`=`used_points`+%s WHERE `userid`=%s LIMIT 1",
- array($points, bigintval($userid)), __FUNCTION__, __LINE__);
+ array(
+ $points,
+ bigintval($userid)
+ ), __FUNCTION__, __LINE__);
// Prepare filter data
$filterData = array(
);
// Insert booking record
- $filterData = runFilterChain('sub_points', $filterData);
+ $filterData = runFilterChain('post_sub_points', $filterData);
// Return result
return $filterData['added'];
// Get unconfirmed mails
$row['unconfirmed'] = countSumTotalData($row['refid'], 'user_links', 'id', 'userid', true);
- // Init clickrate with zero
- $row['clickrate'] = '0';
+ // Init click rate with zero
+ $row['click_rate'] = '0';
// Is at least one mail received?
if ($row['emails_received'] > 0) {
- // Calculate clickrate
- $row['clickrate'] = ($row['mails_confirmed'] / $row['emails_received'] * 100);
+ // Calculate click rate
+ $row['click_rate'] = ($row['mails_confirmed'] / $row['emails_received'] * 100);
} // END - if
// Activity is 'active' by default because if autopurge is not installed
// Wrapper for fetchUserData() and getUserData() calls
function getFetchedUserData ($keyColumn, $userid, $valueColumn) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyColumn=' . $keyColumn . ',userid=' . $userid . ',valueColumn=' . $valueColumn . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyColumn=' . $keyColumn . ',userid=' . $userid . ',valueColumn=' . $valueColumn . ' - ENTERED!');
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$userid][$keyColumn][$valueColumn])) {
// Default is 'guest'
} // END - if
// Return it
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyColumn=' . $keyColumn . ',userid=' . $userid . ',valueColumn=' . $valueColumn . ',value=' . $GLOBALS[__FUNCTION__][$userid][$keyColumn][$valueColumn] . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyColumn=' . $keyColumn . ',userid=' . $userid . ',valueColumn=' . $valueColumn . ',value=' . $GLOBALS[__FUNCTION__][$userid][$keyColumn][$valueColumn] . ' - EXIT!');
return $GLOBALS[__FUNCTION__][$userid][$keyColumn][$valueColumn];
}
// Wrapper to check if user points are locked
function ifUserPointsLocked ($userid) {
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
} // END - if
// Return cache
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',locked=' . intval($GLOBALS[__FUNCTION__][$userid]) . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',locked=' . intval($GLOBALS[__FUNCTION__][$userid]) . ' - EXIT!');
return $GLOBALS[__FUNCTION__][$userid];
}
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admin_menu`;
CREATE TABLE `{?_MYSQL_PREFIX?}_admin_menu` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`action` VARCHAR(255) NOT NULL DEFAULT '',
`what` VARCHAR(255) NULL DEFAULT NULL,
`title` VARCHAR(50) NOT NULL DEFAULT '',
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_cats`;
CREATE TABLE `{?_MYSQL_PREFIX?}_cats` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`cat` VARCHAR(255) NOT NULL DEFAULT '',
`visible` ENUM('Y','N') NOT NULL DEFAULT 'Y',
`sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_guest_menu`;
CREATE TABLE `{?_MYSQL_PREFIX?}_guest_menu` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`action` VARCHAR(255) NOT NULL DEFAULT '',
`what` VARCHAR(255) NULL DEFAULT NULL,
`title` VARCHAR(50) NOT NULL DEFAULT '',
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_max_receive`;
CREATE TABLE `{?_MYSQL_PREFIX?}_max_receive` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`value` MEDIUMINT(9) NOT NULL DEFAULT 0,
`comment` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_member_menu`;
CREATE TABLE `{?_MYSQL_PREFIX?}_member_menu` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`action` VARCHAR(255) NOT NULL DEFAULT '',
`what` VARCHAR(255) NULL DEFAULT NULL,
`title` VARCHAR(50) NOT NULL DEFAULT '',
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_refbanner`;
CREATE TABLE `{?_MYSQL_PREFIX?}_refbanner` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`url` TEXT NOT NULL,
`alternate` TEXT NOT NULL,
`visible` ENUM('Y','N') NOT NULL DEFAULT 'Y',
- `counter` BIGINT(22) NOT NULL DEFAULT 0,
+ `counter` BIGINT(20) NOT NULL DEFAULT 0,
`clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_refsystem`;
CREATE TABLE `{?_MYSQL_PREFIX?}_refsystem` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`level` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
`counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
<strong>{--UNCONFIRMED_LINKS--}</strong>
</td>
<td align="center" class="header_column bottom right">
- <strong>{--MEMBER_EMAIL_PERCENT--}</strong>
+ <strong>{--MEMBER_CLICK_RATE--}</strong>
</td>
<td align="center" class="header_column bottom">
<strong>{--MEMBER_REFLIST_ACTIVITY--}</strong>
{%pipe,translateComma=$content[unconfirmed]%}
</td>
<td align="center" class="{%template,ColorSwitch%} bottom right">
- $content[clickrate]%
+ $content[click_rate]%
</td>
<td align="center" class="{%template,ColorSwitch%} bottom right">
$content[activity]
<div align="center" style="padding:0px;margin:0px">
<table border="0" cellspacing="0" cellpadding="0" class="table dashed" width="730">
<tr>
- <td align="center" class="header_column" colspan="6">
+ <td align="center" class="header_column" colspan="7">
<strong>{--MEMBER_REFBACK_LIST_TITLE_1--}$content[level]{--MEMBER_REFBACK_LIST_TITLE_2--}{%pipe,translateComma=$content[percents]%}{--MEMBER_REFBACK_LIST_TITLE_3--}</strong>
</td>
</tr>
<td align="center" class="header_column bottom right">
<strong>{--MEMBER_REFBACK_POINTS--}</strong>
</td>
+ <td align="center" class="header_column bottom right">
+ <strong>{--MEMBER_CLICK_RATE--}</strong>
+ </td>
<td align="center" class="header_column bottom right">
<strong>{--MEMBER_JOINED--}</strong>
</td>
</tr>
$content[rows]
<tr>
- <td align="center" class="table_footer" colspan="6">
+ <td align="center" class="table_footer" colspan="7">
<span class="notice">{%message,MEMBER_REFLIST_COUNTER=$content[counter]%}</span>
</td>
</tr>
<td align="center" class="{%template,ColorSwitch%} bottom right">
{%pipe,translateComma=$content[points]%} {?POINTS?}
</td>
+ <td align="center" class="{%template,ColorSwitch%} bottom right">
+ $content[click_rate]%
+ </td>
<td align="center" class="{%template,ColorSwitch%} bottom right">
$content[joined]
</td>
<td align="center" class="{%template,ColorSwitch%} bottom right">
{%pipe,translateComma=$content[points]%} {?POINTS?}
</td>
+ <td align="center" class="{%template,ColorSwitch%} bottom right">
+ $content[click_rate]%
+ </td>
<td align="center" class="{%template,ColorSwitch%} bottom right">
$content[joined]
</td>
<strong>{%pipe,translateComma=$content[clicks]%}</strong>
</td>
<td align="center" class="{%template,ColorSwitch%} top">
- {--MEMBER_EMAIL_PERCENT--}:<br />
+ {--MEMBER_CLICK_RATE--}:<br />
<strong>{%pipe,translateComma=$content[percents]%}%</strong>
</td>
</tr>