$fp = @fopen($fqfn, 'a');
if ($inc == "dummy") {
// Remove dummy file
- @fclose($fp);
- return @unlink($fqfn);
+ fclose($fp);
+ return unlink($fqfn);
} else {
// Close all other files
- return @fclose($fp);
+ return fclose($fp);
}
}
// Open a table (you may want to add some header stuff here)
-function OPEN_TABLE($PERCENT = "", $CLASS = "", $ALIGN="left", $VALIGN="", $td_only=false) {
+// @DEPRECATED
+function OPEN_TABLE ($PERCENT = "", $CLASS = "", $ALIGN="left", $VALIGN="", $td_only=false) {
global $table_cnt;
// Count tables so we can generate CSS classes for every table... :-)
}
// Close a table (you may want to add some footer stuff here)
-function CLOSE_TABLE($ADD="") {
+// @DEPRECATED
+function CLOSE_TABLE( $ADD="") {
OUTPUT_HTML(" </TD>\n</TR>");
if (!empty($ADD)) OUTPUT_HTML($ADD);
OUTPUT_HTML("</TABLE>");
}
// Output HTML code directly or "render" it. You addionally switch the new-line character off
-function OUTPUT_HTML($HTML, $NEW_LINE = true) {
+function OUTPUT_HTML ($HTML, $NEW_LINE = true) {
// Some global variables
global $OUTPUT, $footer, $CSS;
// Don't de-refer our own links!
if (substr($URL, 0, strlen(URL)) != URL) {
// De-refer this link
- $URL = URL."/modules.php?module=loader&url=".urlencode(base64_encode(gzcompress($URL)));
+ $URL = "modules.php?module=loader&url=".urlencode(base64_encode(gzcompress($URL)));
} // END - if
// Return link
return $ret;
}
//
-function SET_LANGUAGE($lang) {
+function SET_LANGUAGE ($lang) {
// Accept only first 2 chars!
$lang = substr(SQL_ESCAPE(strip_tags($lang)), 0, 2);
// Set cookie
- set_session("mx_lang", $lang);
+ set_session('mx_lang', $lang);
}
//
function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") {
// Check if http(s):// is there
if ((substr($URL, 0, 7) != "http://") && (substr($URL, 0, 8) != "https://")) {
// Make all URLs full-qualified
- $URL = URL."/".$URL;
+ $URL = "".$URL;
}
// Get output buffer
// Add more additional data
if (isSessionVariableSet('u_hash')) $data .= ":".get_session('u_hash');
if (isset($GLOBALS['userid'])) $data .= ":".$GLOBALS['userid'];
- if (isSessionVariableSet('lifetime')) $data .= ":".get_session('lifetime');
if (isSessionVariableSet('mxchange_theme')) $data .= ":".get_session('mxchange_theme');
if (isSessionVariableSet('mx_lang')) $data .= ":".GET_LANGUAGE();
if (isset($GLOBALS['refid'])) $data .= ":".$GLOBALS['refid'];
// Return the value
return $value;
}
+
// Send notification to admin
function SEND_ADMIN_NOTIFICATION($subject, $templateName, $content=array(), $uid="0") {
if (GET_EXT_VERSION("admins") >= "0.4.1") {
SEND_ADMIN_EMAILS($subject, $msg);
}
}
+
// Destroy user session
function destroy_user_session () {
+ // Reset userid
+ $GLOBALS['userid'] = 0;
+
// Remove all user data from session
- return ((set_session("userid", "")) && (set_session("u_hash", "")) && (set_session("lifetime", "")));
+ return ((set_session('userid', "")) && (set_session('u_hash', "")));
}
+
// Merges an array together but only if both are arrays
function merge_array ($array1, $array2) {
// Are both an array?
debug_print_backtrace();
die("</pre>");
}
+
// Debug message logger
function DEBUG_LOG ($file, $line, $message, $force=true) {
// Is debug mode enabled?
fclose($fp);
} // END - if
}
+
// Reads a directory with PHP files in and gets only files back
function GET_DIR_AS_ARRAY ($baseDir, $prefix) {
$INCs = array();
if (!isSessionVariableSet('mxchange_theme')) {
// Set default theme
- set_session("mxchange_theme", $ret);
+ set_session('mxchange_theme', $ret);
} elseif ((isSessionVariableSet('mxchange_theme')) && (GET_EXT_VERSION("sql_patches") >= "0.1.4")) {
//die("<pre>".print_r($cacheArray['themes'], true)."</pre>");
// Get theme from cookie
// Installation mode active
if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) {
// Set cookie from URL data
- set_session("mxchange_theme", SQL_ESCAPE($_GET['theme']));
+ set_session('mxchange_theme', SQL_ESCAPE($_GET['theme']));
} elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) {
// Set cookie from posted data
- set_session("mxchange_theme", SQL_ESCAPE($_POST['theme']));
+ set_session('mxchange_theme', SQL_ESCAPE($_POST['theme']));
}
// Set return value
$ret = get_session('mxchange_theme');
} else {
// Invalid design, reset cookie
- set_session("mxchange_theme", $ret);
+ set_session('mxchange_theme', $ret);
}
// Add (maybe) found theme.php file to inclusion list
return $content;
}
+// Generates an error code from given account status
+function GEN_ERROR_CODE_FROM_ACCOUNT_STATUS ($status) {
+ // Default error code if unknown account status
+ $ERROR = CODE_UNKNOWN_STATUS;
+
+ // Generate constant name
+ $constantName = sprintf("CODE_ID_%s", $status);
+
+ // Is the constant there?
+ if (defined($constantName)) {
+ // Then get it!
+ $ERROR = constant($constantName);
+ } else {
+ // Unknown status
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown error status %s detected.", $status));
+ }
+
+ // Return error code
+ return $ERROR;
+}
+
//////////////////////////////////////////////////
-// //
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
-// //
//////////////////////////////////////////////////
//
if (!function_exists('html_entity_decode')) {
}
} // END - if
-//
+// [EOF]
?>