From 6f89f62b93d13d53d21aba27793ed283e735f410 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 5 Nov 2009 16:06:08 +0000 Subject: [PATCH] Again fixes for rallye --- inc/libs/rallye_functions.php | 27 +++++++++---------- inc/libs/refback_functions.php | 2 +- .../de/emails/member/member_rallye_notify.tpl | 14 +++++----- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index a1038eb205..331687eb51 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -299,8 +299,7 @@ LIMIT 1", } // Run this function only when a new member has confirmed his email address! -function addUserToReferalRallye ($userid) { - global $DATA; +function addUserToReferalRallye ($userid, $content = array()) { $add = ''; // Updated extension? @@ -348,24 +347,24 @@ VALUES ('%s','%s',0)", SQL_FREERESULT($result); if ($notify == 'Y') { - // Transfer all neccessary data to the global $DATA array - $DATA['start'] = generateDateTime($start, 2); - $DATA['end'] = generateDateTime($end , 2); - $DATA['now_t'] = generateDateTime(time(), 2); - $DATA['title'] = $title; - $DATA['id'] = $id; // id for the rallye details link - $DATA['ref'] = '0'; - $DATA['refs'] = countSumTotalData($userid, 'user_data', 'userid', "refid", true); + // Transfer all neccessary data to the global $content array + $content['start'] = generateDateTime($start, 2); + $content['end'] = generateDateTime($end , 2); + $content['now_t'] = generateDateTime(time(), 2); + $content['title'] = $title; + $content['id'] = $id; // id for the rallye details link + $content['ref'] = '0'; + $content['refs'] = countSumTotalData($userid, 'user_data', 'userid', 'refid', true); // Load prices - $prices = addReferalRallyePrices($id); + $content['prices'] = addReferalRallyePrices($id); // Determine min_users/prices tring - $DATA['min_users'] = determineReferalRallyeMinimumUsers($min_users); - $DATA['min_prices'] = determineReferalRallyeMinimumPrices($min_prices); + $content['min_users'] = determineReferalRallyeMinimumUsers($min_users); + $content['min_prices'] = determineReferalRallyeMinimumPrices($min_prices); // Send notification to member - $message = loadEmailTemplate('member_rallye_notify', array('prices' => $prices), $userid); + $message = loadEmailTemplate('member_rallye_notify', $content, $userid); sendEmail($userid, sprintf(getMessage('RALLYE_MEMBER_NOTIFY'), $title), $message); } // END - if } // END - if diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 48ddd1a192..349decbc35 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -76,7 +76,7 @@ function addRefbackPoints ($userid, $ref, $points, $ref_points) { // Calculate points for refback $refback = $points * ($content['percents'] / 100) * ($percents / 100); - // Update refback table ("refid" and "userid" must be exchanged!) + // 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", array($refback, $refid, $userid), __FUNCTION__, __LINE__); //* DEBUG: */ print(__FUNCTION__."(".__LINE__."):refback={$refback},userid={$userid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")
"); diff --git a/templates/de/emails/member/member_rallye_notify.tpl b/templates/de/emails/member/member_rallye_notify.tpl index 3694abdbc5..751d598f2c 100644 --- a/templates/de/emails/member/member_rallye_notify.tpl +++ b/templates/de/emails/member/member_rallye_notify.tpl @@ -8,11 +8,11 @@ Soeben haben wir von {?MAIN_TITLE?} eine neue Referal-Rallye gestartet! Hier alle Infos zur Rallye: ------------------------------ -Titel: $DATA[title] +Titel: $content[title] ------------------------------ -Beginn der Rallye: $DATA[start] Uhr -Ende der Rallye: $DATA[end] Uhr -Server-Zeit: $DATA[now_t] Uhr +Beginn der Rallye: $content[start] Uhr +Ende der Rallye: $content[end] Uhr +Server-Zeit: $content[now_t] Uhr ------------------------------ $content[prices] Ihr Werbelink zum Werben neuer Mitglieder: @@ -21,15 +21,15 @@ Ihr Werbelink zum Werben neuer Mitglieder: Weitere Werbebanner, sowie alle weiteren nötigen Daten finden Sie im Mitgliedsbereich unter *Refs-Banner* ! -Ihre aktuellen $DATA[refs] Referals wurden dabei nicht beruecksichtig, da Sie diese Mitglieder vor der Rallye angeworben hatten. +Ihre aktuellen $content[refs] Referals wurden dabei nicht beruecksichtig, da Sie diese Mitglieder vor der Rallye angeworben hatten. Viel Spass beim Werben! Wichtig: ------------------------------ - Es werden nur aktive User gewertet. Der Rechtsweg ist ausgeschlossen. -- $DATA[min_users] -- $DATA[min_prices] +- $content[min_users] +- $content[min_prices] ------------------------------ Mit freundlichen Grüßen, -- 2.39.5