Surfbar URL status translation added, member template name fixed
authorRoland Häder <roland@mxchange.org>
Wed, 3 Sep 2008 15:44:25 +0000 (15:44 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 3 Sep 2008 15:44:25 +0000 (15:44 +0000)
inc/functions.php
inc/language/surfbar_de.php
inc/libs/surfbar_functions.php

index 2a9f001e7cf776493be8b6678a539f3d8013d2ea..3a379ebb58151775b6200cdeaedd3685f22a1863 100644 (file)
@@ -503,8 +503,7 @@ function MAKE_DATETIME($time, $mode="0")
 }
 
 // Translates the american decimal dot into a german comma
 }
 
 // Translates the american decimal dot into a german comma
-function TRANSLATE_COMMA($dotted, $cut=true)
-{
+function TRANSLATE_COMMA($dotted, $cut=true) {
        global $_CONFIG;
        // Default is 3 you can change this in admin area "Misc -> Misc Options"
        if (empty($_CONFIG['max_comma'])) $_CONFIG['max_comma'] = "3";
        global $_CONFIG;
        // Default is 3 you can change this in admin area "Misc -> Misc Options"
        if (empty($_CONFIG['max_comma'])) $_CONFIG['max_comma'] = "3";
index 39416c14223527ec1365c4144fbd428651ae87d1..4660d40f11d40d215a77194bd5cfbb5b434ff09f 100644 (file)
@@ -59,5 +59,10 @@ define('ADMIN_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Mitglied hat URL in Surfbar gebu
 define('MEMBER_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "Ihre URL wurde in die Surfbar aufgenommen");
 define('MEMBER_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Ihre URL in der Surfbar wartet auf Freischaltung");
 
 define('MEMBER_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "Ihre URL wurde in die Surfbar aufgenommen");
 define('MEMBER_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Ihre URL in der Surfbar wartet auf Freischaltung");
 
+// URL status
+define('SURFBAR_URL_STATUS_CONFIRMED', "Freigegeben");
+define('SURFBAR_URL_STATUS_LOCKED', "Gesperrt");
+define('SURFBAR_URL_STATUS_PENDING', "Wartend");
+
 //
 ?>
 //
 ?>
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,
                '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
        );
 
        // 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
 // 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;",
 
        // 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);
 }
        // 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;
+}
 //
 ?>
 //
 ?>