Rewrite of all mail templates with user data to new 'tag-like' functionality
[mailer.git] / inc / wrapper-functions.php
index 7e2856402937a850599a48ed7f7f3b9287be0fce..de2d8c0fdb9c613f1c536a6b6047d13474174ccf 100644 (file)
@@ -251,6 +251,12 @@ function detectReferer () {
        return $referer;
 }
 
+// "Getter" for request URI
+function detectRequestUri () {
+       // Return it
+       return (getenv('REQUEST_URI'));
+}
+
 // Check wether we are installing
 function isInstalling () {
        // Determine wether we are installing
@@ -761,5 +767,20 @@ function isDebuggingTemplateCache () {
        return (getConfig('DEBUG_TEMPLATE_CACHE') == 'Y');
 }
 
+// Wrapper for fetchUserData() and getUserData() calls
+function getFetchedUserData ($keyColumn, $userId, $valueColumn) {
+       // Default is 'guest'
+       $data = getMessage('USERNAME_GUEST');
+
+       // Can we fetch the user data?
+       if (($userId > 0) && (fetchUserData($userId, $keyColumn))) {
+               // Now get the data back
+               $data = getUserData($valueColumn);
+       } // END - if
+
+       // Return it
+       return $data;
+}
+
 // [EOF]
 ?>