Surfbar URL status translation added, member template name fixed
[mailer.git] / inc / libs / surfbar_functions.php
index f00ee9abe9ee37e1a11d3d6483ec498dfc808e8f..64c65b50326081f9fe68a43fc768baad44aafbf0 100644 (file)
@@ -115,8 +115,8 @@ function SURFBAR_REGISTER_URL ($url, $uid, $reward, $status="PENDING", $addMode=
                'url'         => $url,
                'frametester' => FRAMETESTER($url),
                'uid'         => $uid,
-               'reward'      => $reward,
-               'status'      => $status
+               'reward'      => TRANSLATE_COMMA($reward),
+               'status'      => SURFBAR_TRANSLATE_STATUS($status)
        );
 
        // Insert the URL into database
@@ -168,7 +168,7 @@ function SURFBAR_NOTIFY_ADMIN ($messageType, $content) {
 // Notify the user about the performed action
 function SURFBAR_NOTIFY_USER ($messageType, $content) {
        // Prepare template name
-       $templateName = sprintf("admin_surfbar_%s", $messageType);
+       $templateName = sprintf("member_surfbar_%s", $messageType);
 
        // Prepare subject
        $eval = sprintf("\$subject = MEMBER_SURFBAR_NOTIFY_%s_SUBJECT;",
@@ -182,5 +182,22 @@ function SURFBAR_NOTIFY_USER ($messageType, $content) {
        // Send the email
        SEND_EMAIL($content['uid'], $subject, $mailText);
 }
+// Translate the URL status
+function SURFBAR_TRANSLATE_STATUS ($status) {
+       // Create constant name
+       $constantName = sprintf("SURFBAR_URL_STATUS_%s", strtoupper($status));
+
+       // Set default translated status
+       $statusTranslated = "!".$constantName."!";
+
+       // Generate eval() command
+       if (defined($constantName)) {
+               $eval = "\$statusTranslated = ".$constantName.";";
+               eval($eval);
+       } // END - if
+
+       // Return result
+       return $statusTranslated;
+}
 //
 ?>