]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/user_functions.php
Extension ext-beg improved, better EL code used:
[mailer.git] / inc / libs / user_functions.php
index 71b180ee8fccc6c64bfa791f0f6178a5b493ceca..1241a8748bd1f4264365ed40c29be449ec00512d 100644 (file)
@@ -777,5 +777,23 @@ function doTemplateAdminListUserTitle ($template, $clear = false) {
        return $code;
 }
 
+// Template call-back function for displaying "username"
+function doTemplateDisplayUsername ($template, $clear = false, $userid = NULL) {
+       // Is a userid set?
+       if (!isValidUserId($userid)) {
+               // Please don't call this without a valid userid
+               debug_report_bug(__FUNCTION__, __LINE__, 'template=' . $template . ',clear=' . intval($clear) . ',userid[' . gettype($userid) . ']=' . intval($userid) . ' - Invalid userid provided.');
+       } // END - if
+
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__][$userid])) {
+               // Generate code
+               $GLOBALS[__FUNCTION__][$userid] = $userid . ' ({%user,nickname,fixEmptyContentToDashes=' . $userid . '%})';
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__][$userid];
+}
+
 // [EOF]
 ?>