From 3ea8eee0f8525204eb0fac9ade0a2e4d0fdb7a3c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 12 Jul 2011 21:21:36 +0000 Subject: [PATCH] Introduced makeNullToZero() --- inc/functions.php | 14 +++++++++++++- inc/language/de.php | 2 +- templates/de/html/member/member_points_row.tpl | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 93c08ad2e5..eac1fc7359 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2151,7 +2151,7 @@ function handleFieldWithBraces ($field) { return $field; } -// Converts a userid so it can be used in SQL queries +// Converts a zero or NULL to word 'NULL' function makeZeroToNull ($number) { // Is it a valid username? if ((!is_null($number)) && ($number > 0)) { @@ -2166,6 +2166,18 @@ function makeZeroToNull ($number) { return $number; } +// Converts NULL into number zero +function makeNullToZero ($number) { + // Is this a NULL? + if ((is_null($number)) || (empty($number))) { + // Simply set it + $number = '0'; + } // END - if + + // Return it + return $number; +} + // Capitalizes a string with underscores, e.g.: some_foo_string will become SomeFooString // Note: This function is cached function capitalizeUnderscoreString ($str) { diff --git a/inc/language/de.php b/inc/language/de.php index d82729f717..34d638cffb 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -213,7 +213,7 @@ addMessages(array( 'ADMIN_EDIT_REFERAL_DEPTHS' => "Referal-Ebenen editieren / löschen / hinzufügen", 'ADMIN_ADD_NEW_REFERAL_DEPTH_TITLE' => "Neue Referal-Ebene hinzufügen", 'ADMIN_ADD_DEPTH' => "Referal-Ebene hinzufügen", - 'ADMIN_ENTER_REFERAL_LEVEL' => "Referal-Ebene", + 'ADMIN_ENTER_REFERAL_LEVEL' => "Referal-Ebene eingeben", 'ADMIN_ENTER_REFERAL_PERCENTS' => "Prozentuale Vergütung", 'ADMIN_EDIT_DELETE_REFERAL_DEPTH_TITLE' => "Referal-Ebenen editieren / löschen", 'REFERAL_LEVEL' => "Referal-Ebene", diff --git a/templates/de/html/member/member_points_row.tpl b/templates/de/html/member/member_points_row.tpl index 80c23bcc66..096294e8b8 100644 --- a/templates/de/html/member/member_points_row.tpl +++ b/templates/de/html/member/member_points_row.tpl @@ -1,5 +1,5 @@ - $content[level]. {--REFERAL_LEVEL--} ({%pipe,translateComma=$content[percents]%}%) + {%pipe,makeNullToZero=$content[level]%}. {--REFERAL_LEVEL--} ({%pipe,translateComma=$content[percents]%}%) {%pipe,translateComma=$content[points]%} {?POINTS?} {%pipe,translateComma=$content[order_points]%} {?POINTS?} {%pipe,translateComma=$content[counter]%} -- 2.39.5