]> git.mxchange.org Git - mailer.git/commitdiff
Email support added to refback extension
authorRoland Häder <roland@mxchange.org>
Mon, 29 Sep 2008 23:00:19 +0000 (23:00 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 29 Sep 2008 23:00:19 +0000 (23:00 +0000)
.gitattributes
inc/databases.php
inc/language/refback_de.php
inc/libs/refback_functions.php
templates/de/emails/admin/admin_refback.tpl [new file with mode: 0644]
templates/de/emails/member/member_refback.tpl [new file with mode: 0644]

index 51a12c4cc3183822228b212a9044ec0097a9566e..8c37b468b2c5303631d2f2f552c746255ae64129 100644 (file)
@@ -619,6 +619,7 @@ templates/de/emails/admin/admin_rallye_expired_no.tpl -text
 templates/de/emails/admin/admin_rallye_no_notify.tpl -text
 templates/de/emails/admin/admin_rallye_notify.tpl -text
 templates/de/emails/admin/admin_rallye_purged.tpl -text
+templates/de/emails/admin/admin_refback.tpl -text
 templates/de/emails/admin/admin_reset_password.tpl -text
 templates/de/emails/admin/admin_sponsor_change_data.tpl -text
 templates/de/emails/admin/admin_sponsor_change_email.tpl -text
@@ -697,6 +698,7 @@ templates/de/emails/member/member_rallye_expired_bronce.tpl -text
 templates/de/emails/member/member_rallye_expired_gold.tpl -text
 templates/de/emails/member/member_rallye_expired_silver.tpl -text
 templates/de/emails/member/member_rallye_notify.tpl -text
+templates/de/emails/member/member_refback.tpl -text
 templates/de/emails/member/member_stats_bonus.tpl -text
 templates/de/emails/member/member_support-order.tpl -text
 templates/de/emails/member/member_support-ordr.tpl -text
index f588661844da1cb90f046d6670b2d315a60dfd94..94369d9c6210de7aab73e67df4e1f3e42d49f1d1 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "413");
+define('CURR_SVN_REVISION', "415");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index f85bb270e182039bcf8ec5aee3e663359af4cd2a..6b98f619e79684a6286cb65049bcd2c3c0543331 100644 (file)
@@ -66,5 +66,9 @@ define('MEMBER_REFBACK_ERROR_ID_MISMATCH', "Die ausgew&auml;hlte Ref-Back ID geh
 define('MEMBER_REFBACK_ERROR_NOT_UPDATED', "Ref-Back nicht aktualisiert.");
 define('MEMBER_REFBACK_DONE', "Ref-Back eingestellt. Dieser ist ab jetzt g&uuml;ltig.");
 
+// Subject lines
+define('ADMIN_REFBACK_SUBJECT', "Es wurde Ref-Back eingestellt");
+define('MEMBER_REFBACK_SUBJECT', "F&uuml;r Sie wurde Ref-Back eingestellt");
+
 //
 ?>
index 1009819e4f4f326662dc5f73ac4fcfacf31fd863..6e5c9112ba2130e48541d207817a57214236657a 100644 (file)
@@ -307,7 +307,7 @@ function GET_USER_REF_ENTRY ($id) {
        $id = bigintval($id);
 
        // Get entry from database
-       $result = SQL_QUERY_ESC("SELECT id, refid, refback FROM "._MYSQL_PREFIX."_user_refs WHERE id=%s AND userid=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT id, refid, refback, level FROM "._MYSQL_PREFIX."_user_refs WHERE id=%s AND userid=%s LIMIT 1",
                array($id, $GLOBALS['userid']), __FILE__, __LINE__);
 
        // Is there an entry?
@@ -336,11 +336,11 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
                return $status;
        } elseif ("".$id."" != "".bigintval($id)."") {
                // No number!
-               $status['message'] = MEMBER_REFBACK_INVALID_ID_NUMBER;
+               $status['message'] = MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER;
                return $status;
        } elseif (($percents < 0) || ($percents > 100)) {
                // Percentage is not valid!
-               $status['message'] = MEMBER_REFBACK_INVALID_PERCENTAGE;
+               $status['message'] = MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE;
                return $status;
        }
 
@@ -350,7 +350,7 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        // Is this valid?
        if (count($dummy) == 0) {
                // ID does not belong to user!
-               $status['message'] = MEMBER_REFBACK_ID_MISMATCH;
+               $status['message'] = MEMBER_REFBACK_ERROR_ID_MISMATCH;
                return $status;
        } // END - if
 
@@ -364,10 +364,26 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        // Entry updated?
        if (SQL_AFFECTEDROWS() < 1) {
                // Entry not updated!
-               $status['message'] = MEMBER_REFBACK_NOT_UPDATED;;
+               $status['message'] = MEMBER_REFBACK_ERROR_NOT_UPDATED;;
                return $status;
        } // END - if
 
+       // Prepare email content
+       $content = array(
+               'percents' => TRANSLATE_COMMA($percents),
+               'refid'    => $dummy['refid'],
+               'level'    => $dummy['level']
+       );
+
+       // Load member email template
+       $mail = LOAD_EMAIL_TEMPLATE("member_refback", $content, $GLOBALS['userid']);
+
+       // Send email to user
+       SEND_EMAIL($dummy['refid'], MEMBER_REFBACK_SUBJECT, $mail);
+
+       // Send admin notification
+       SEND_ADMIN_NOTIFICATION(ADMIN_REFBACK_SUBJECT, "admin_refback", $content, $GLOBALS['userid']);
+
        // All fine!
        $status['ok'] = true;
 
diff --git a/templates/de/emails/admin/admin_refback.tpl b/templates/de/emails/admin/admin_refback.tpl
new file mode 100644 (file)
index 0000000..1d4bea7
--- /dev/null
@@ -0,0 +1,14 @@
+Hallo Administrator,
+
+Das Mitglied $UID hat soeben Ref-Back f&uuml;r ein anderes Mitglied eingestellt.
+
+------------------------------
+Mitglied-ID: $content[refid] (der den Ref-Back bekommt)
+------------------------------
+Ref-Back: $content[percents]%
+------------------------------
+
+Mit freundlichem Gruss,
+  Ihr {!MAIN_TITLE!} Team
+
+{!URL!}/login.php ({!WEBMASTER!})
diff --git a/templates/de/emails/member/member_refback.tpl b/templates/de/emails/member/member_refback.tpl
new file mode 100644 (file)
index 0000000..ffc6432
--- /dev/null
@@ -0,0 +1,14 @@
+Hallo $content[gender] $content[surname] $content[family],
+
+Das Mitglied $UID hat Ihnen soeben Ref-Back eingestellt. Sie erhalten also anteilig {!POINTS!} von seinen Referal-Gutschriften die Sie ihm/ihr bringen ebenfalls gutgeschrieben.
+
+------------------------------
+Ihr Mitglieder-ID ist: $content[refid]
+------------------------------
+Ref-Back: $content[percents]%
+------------------------------
+
+Mit freundlichem Gruss,
+  Ihr {!MAIN_TITLE!} Team
+
+{!URL!}/login.php ({!WEBMASTER!})
\ No newline at end of file