From: quix0r Date: Wed, 6 Jul 2011 08:16:31 +0000 (+0000) Subject: getUserData() does now tollerate missing table columns. This makes it very flexible... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=be792af21f87c11ddb59dce0036837aeced0dee7;p=mailer.git getUserData() does now tollerate missing table columns. This makes it very flexible to e.g. absent extensions --- diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 1e5778ee41..0911ea9b45 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -290,7 +290,7 @@ function getArrayFromRefbackUserRefs ($userid, $level) { // Do we have nickname extension installed? if (isExtensionActive('nickname')) { - $add = ", d.nickname"; + $add = ", d.`nickname`"; } // END - if // Get refs from database diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index db62ffb5d1..0084453795 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -951,8 +951,16 @@ function getUserData ($column) { debug_report_bug(__FUNCTION__, __LINE__, 'Current user id is invalid: ' . getCurrentUserId()); } // END - if - // Return the value - return $GLOBALS['user_data'][getCurrentUserId()][$column]; + // Default is empty + $data = null; + + if (isset($GLOBALS['user_data'][getCurrentUserId()][$column])) { + // Return the value + $data = $GLOBALS['user_data'][getCurrentUserId()][$column]; + } // END - if + + // Return it + return $data; } // Checks wether given user data is set to 'Y' diff --git a/templates/de/html/member/member_refback_list_row.tpl b/templates/de/html/member/member_refback_list_row.tpl index 490526eb1e..78963e44b3 100644 --- a/templates/de/html/member/member_refback_list_row.tpl +++ b/templates/de/html/member/member_refback_list_row.tpl @@ -1,6 +1,6 @@ - $content[refid] ({%pipe,fixEmptyContentToDashes=$content[nickname]%}) + $content[refid] ({%user,nickname,fixEmptyContentToDashes=$content[refid]%}) $content[level_refid]