<?php
/************************************************************************
- * MXChange v0.2.1 Start: 04/04/2009 *
- * =============== Last change: 04/04/2009 *
+ * Mailer v0.2.1-FINAL Start: 04/04/2009 *
+ * =================== Last change: 04/04/2009 *
* *
* -------------------------------------------------------------------- *
* File : wrapper-functions.php *
}
// Decode entities in a nicer way
-function decodeEntities ($str) {
+function decodeEntities ($str, $quote = ENT_NOQUOTES) {
// Decode the entities to UTF-8 now
- $decodedString = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8');
+ $decodedString = html_entity_decode($str, $quote, 'UTF-8');
// Return decoded string
return $decodedString;
}
// "Getter" for user agent
-function detectUserAgent () {
+function detectUserAgent ($alwaysReal = false) {
// Get remote ip from environment
$userAgent = getenv('HTTP_USER_AGENT');
// Is removeip installed?
- if (isExtensionActive('removeip')) {
+ if ((isExtensionActive('removeip')) && ($alwaysReal === false)) {
// Then anonymize it
$userAgent = getAnonymousUserAgent($userAgent);
} // END - if
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
$isUsed = $GLOBALS['is_nickname_used'][$userid];
} else {
// Determine it
- $isUsed = ((isExtensionActive('nickname')) && (('' . round($userid) . '') != $userid));
+ $isUsed = (('' . round($userid) . '') != $userid);
// And write it to the cache
$GLOBALS['is_nickname_used'][$userid] = $isUsed;
// Should we abort here?
if (($strict === true) && ($isset === false)) {
// Output backtrace
- print 'Module not set!<pre>';
- debug_print_backtrace();
- die('</pre');
debug_report_bug('module is empty.');
} // END - if
// Return it
- return $isset;
+ return (($isset === true) && ($GLOBALS['module'] != 'unknown')) ;
}
// Getter for 'output_mode' value
return isset($GLOBALS['current_userid']);
}
+// Checks wether we are debugging template cache
+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]
?>