From: Roland Häder Date: Wed, 3 Sep 2008 15:44:25 +0000 (+0000) Subject: Surfbar URL status translation added, member template name fixed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=babd89cc0b73577b844274a36c3dd18e51ec679b;p=mailer.git Surfbar URL status translation added, member template name fixed --- diff --git a/inc/functions.php b/inc/functions.php index 2a9f001e7c..3a379ebb58 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -503,8 +503,7 @@ function MAKE_DATETIME($time, $mode="0") } // 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"; diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php index 39416c1422..4660d40f11 100644 --- a/inc/language/surfbar_de.php +++ b/inc/language/surfbar_de.php @@ -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"); +// URL status +define('SURFBAR_URL_STATUS_CONFIRMED', "Freigegeben"); +define('SURFBAR_URL_STATUS_LOCKED', "Gesperrt"); +define('SURFBAR_URL_STATUS_PENDING', "Wartend"); + // ?> diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index f00ee9abe9..64c65b5032 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -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; +} // ?>