\n";
// Return generated HTML code
}
@@ -1592,11 +1592,11 @@ function SEND_ADMIN_EMAILS_PRO($subj, $template, $content, $UID) {
} // END - if
// Check which admin shall receive this mail
- $result = SQL_QUERY_ESC("SELECT DISTINCT admin_id FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' ORDER BY admin_id",
+ $result = SQL_QUERY_ESC("SELECT DISTINCT admin_id FROM `{!MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' ORDER BY admin_id",
array($template), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// Create new entry (to all admins)
- SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins_mails (admin_id, mail_template) VALUES (0, '%s')",
+ SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_admins_mails` (admin_id, mail_template) VALUES (0, '%s')",
array($template), __FILE__, __LINE__);
} else {
// Load admin IDs...
@@ -1616,10 +1616,10 @@ function SEND_ADMIN_EMAILS_PRO($subj, $template, $content, $UID) {
return;
} elseif ($aid == "0") {
// Select all email adresses
- $result = SQL_QUERY("SELECT email FROM "._MYSQL_PREFIX."_admins ORDER BY id", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT email FROM `{!MYSQL_PREFIX!}_admins` ORDER BY id", __FILE__, __LINE__);
} else {
// If Admin-ID is not "to-all" select
- $result = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_admins WHERE id IN (%s) ORDER BY id", array($aid), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT email FROM `{!MYSQL_PREFIX!}_admins` WHERE id IN (%s) ORDER BY id", array($aid), __FILE__, __LINE__);
}
}
@@ -1662,7 +1662,7 @@ function ADD_EMAIL_NAV($PAGES, $offset, $show_form, $colspan, $return=false) {
$SEP = ""; $TOP = "";
if (!$show_form) {
$TOP = " top2";
- $SEP = "
";
+ $SEP = "
";
}
$NAV = "";
@@ -1963,7 +1963,7 @@ function MEMBER_ACTION_LINKS($uid, $status="") {
$eval = "\$OUT = \"[ ";
foreach ($TARGETS as $tar) {
- $eval .= "\n";
if (($tar == "lock_user") && ($status == "LOCKED")) {
// Locked accounts shall be unlocked
@@ -1972,7 +1972,7 @@ function MEMBER_ACTION_LINKS($uid, $status="") {
// All other status is fine
$eval .= strtoupper($tar);
}
- $eval .= "_TITLE.\"\\\">\".ADMIN_";
+ $eval .= "_TITLE!}\\\">{!ADMIN_";
if (($tar == "lock_user") && ($status == "LOCKED")) {
// Locked accounts shall be unlocked
$eval .= "UNLOCK_USER";
@@ -1980,7 +1980,7 @@ function MEMBER_ACTION_LINKS($uid, $status="") {
// All other status is fine
$eval .= strtoupper($tar);
}
- $eval .= ".\" | ";
+ $eval .= "!} | ";
}
// Finish navigation link
@@ -1991,9 +1991,9 @@ function MEMBER_ACTION_LINKS($uid, $status="") {
return $OUT;
}
// Function for backward-compatiblity
-function ADD_CATEGORY_TABLE ($MODE, $return=false) {
+function ADD_CATEGORY_table ($MODE, $return=false) {
// Load it from the register extension
- return REGISTER_ADD_CATEGORY_TABLE ($MODE, $return);
+ return REGISTER_ADD_CATEGORY_table ($MODE, $return);
}
// Generate an email link
function CREATE_EMAIL_LINK ($email, $table = "admins") {
@@ -2962,7 +2962,7 @@ function THEME_GET_ID ($name) {
incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION("cache") != "0.1.8") {
// Check if current theme is already imported or not
- $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1",
array($name), __FILE__, __LINE__);
// Entry found?
@@ -3013,6 +3013,23 @@ function READ_FILE ($FQFN, $sqlPrepare = false) {
return $content;
}
+// Writes content to a file
+function WRITE_FILE ($FQFN, $content) {
+ // Is the function there?
+ if (function_exists('file_put_contents')) {
+ // Write it directly
+ file_put_contents($FQFN, $content);
+ } else {
+ // Write it with fopen
+ $fp = fopen($FQFN, 'w') or mxchange_die("Cannot write file ".basename($FQFN)."!");
+ fwrite($fp, $content);
+ fclose($fp);
+
+ // Set CHMOD rights
+ chmod($FQFN, 0644);
+ }
+}
+
// Generates an error code from given account status
function GEN_ERROR_CODE_FROM_ACCOUNT_STATUS ($status) {
// Default error code if unknown account status
@@ -3043,6 +3060,48 @@ function clearOutputBuffer () {
} // END - if
}
+// "Getter" for revision/version data
+function getActualVersion ($type = 0) {
+ // By default nothing is new... ;-)
+ $new = false;
+
+ // FQFN of revision file
+ $FQFN = sprintf("%sinc/cache/.revision", PATH);
+
+ // Check for revision file
+ if (!FILE_READABLE($FQFN)) {
+ // Not found, so we need to create it
+ $new = true;
+ } else {
+ // Revision file found
+ $ins_vers = explode("\n", READ_FILE($FQFN));
+
+ // Is the content valid?
+ if ((!is_array($ins_vers)) || (count($ins_vers) <= 0) || (!isset($ins_vers[$type])) || ($ins_vers[0]) == "new") {
+ // File needs update!
+ $new = true;
+ } else {
+ // Revision-File has valid Data and isn't 'new' so return the Rev-Number
+ return trim($ins_vers[$type]);
+ }
+ }
+
+ if ($new) {
+ // no Revision-File or has no valid Data so read the Revision from the Server.
+ $version = GET_URL("check-updates3.php");
+
+ // Prepare content
+ $akt_vers[] = trim($version[10]);
+ $akt_vers[] = trim($version[9]);
+ $akt_vers[] = trim($version[8]);
+
+ // Write file
+ WRITE_FILE($FQFN, implode("\n", $akt_vers));
+
+ // Return requested content
+ return trim($akt_vers[$type]);
+ }
+}
//////////////////////////////////////////////////
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
//////////////////////////////////////////////////