} // END - if
// Add points again, but only directly
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refbackPoints=' . $refbackPoints . ',userid=' . $userid . ',ref=' . $ref . ',refid=' . convertNullToZero($refid) . ' - REFBACK-UPDATE! (' . SQL_AFFECTEDROWS() . ')');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refbackPoints=' . $refbackPoints . ',userid=' . $userid . ',ref=' . $ref . ',refid=' . convertNullToZero($refid) . ' - REFBACK-UPDATE! (' . sqlAffectedRows() . ')');
addPointsThroughReferralSystem(sprintf("refback:%s", $refid), $userid, $refbackPoints);
// Reduce points if refid is found
array($refid, $level), __FUNCTION__, __LINE__);
// Entries found?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'numRows=' . SQL_NUMROWS($result));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'numRows=' . sqlNumRows($result));
if (!ifSqlHasZeroNums($result)) {
// Add all
while ($content = sqlFetchArray($result)) {
if (!ifSqlHasZeroNums($result)) {
// Fetch all entries
while ($row = sqlFetchArray($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
+ // Calculate click rate
+ $row['click_rate'] = calculatePercentageRate($row['mails_confirmed'], $row['emails_received']);
// Add row
$refs[$row['id']] = $row;
$content = getArrayFromUserRefbackData($id);
// Is this valid?
- if (count($content) == 0) {
+ if (!isFilledArray($content)) {
// id does not belong to user!
$status['message'] = 'MEMBER_REFBACK_ERROR_ID_MISMATCH';
return $status;