}
/**
*
- * Dynamic referral system, can also send mails!
+ * Dynamic referal system, can also send mails!
*
- * uid = Referral ID wich should receive...
+ * uid = Referal ID wich should receive...
* points = ... xxx points
- * send_notify = shall I send the referral an email or not?
+ * send_notify = shall I send the referal an email or not?
* rid = inc/modules/guest/what-confirm.php need this (DEPRECATED???)
* locked = Shall I pay it to normal (false) or locked (true) points ammount?
* add_mode = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct"
- * for default value will cause no referral will get points ever!!!)
+ * for default value will cause no referal will get points ever!!!)
*/
function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") {
//* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
return;
} // END - if
- // Count up referral depth
+ // Count up referal depth
if (!isset($DEPTH)) {
- // Initialialize referral system
+ // Initialialize referal system
$DEPTH = 0;
} else {
- // Increase referral level
+ // Increase referal level
$DEPTH++;
}
);
// Load email template
- $msg = LOAD_EMAIL_TEMPLATE("confirm-referral", $content, bigintval($uid));
+ $msg = LOAD_EMAIL_TEMPLATE("confirm-referal", $content, bigintval($uid));
SEND_EMAIL($email, THANX_REFERRAL_ONE, $msg);
} elseif (($send_notify) && ($ref == 0) && (!$locked) && ($add_mode == "direct") && (!defined('__POINTS_VALUE'))) {
function UPDATE_REF_COUNTER ($uid) {
global $cacheArray, $cacheInstance;
- // Make it sure referral level zero (member him-/herself) is at least selected
+ // Make it sure referal level zero (member him-/herself) is at least selected
if (empty($cacheArray['ref_level'][$uid])) $cacheArray['ref_level'][$uid] = 1;
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['ref_level'][$uid]}<br />\n";
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\n";
} // END - if
- // Check for his referral
+ // Check for his referal
$result = SQL_QUERY_ESC("SELECT refid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
array(bigintval($uid)), __FILE__, __LINE__);
SQL_FREERESULT($result);
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
- // When he has a referral...
+ // When he has a referal...
if (($ref > 0) && ($ref != $uid)) {
- // Move to next referral level and count his counter one up!
+ // Move to next referal level and count his counter one up!
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />\n";
$cacheArray['ref_level'][$uid]++; UPDATE_REF_COUNTER($ref);
} elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2")) {