if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) return "done";
// Check if cache is latest version
- $locked = 'Y'; $hidden = 'N'; $admin = 'N'; $mem = 'N'; $found = false;
+ $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheArray['modules']['module'])) && (is_array($cacheArray['modules']['module']))) {
// Is the module cached?
if (isset($cacheArray['modules']['locked'][$mod_chk])) {
// Check returned values against current access permissions
//
// Admin access ----- Guest access ----- --- Guest or member? ---
- if ((IS_ADMIN()) || (($locked == 'N') && ($admin == 'N') && (($mem == 'N') || (IS_LOGGED_IN())))) {
+ if ((IS_ADMIN()) || (($locked == "N") && ($admin == "N") && (($mem == "N") || (IS_LOGGED_IN())))) {
// If you are admin you are welcome for everything!
$ret = "done";
- } elseif ($locked == 'Y') {
+ } elseif ($locked == "Y") {
// Module is locked
$ret = "locked";
- } elseif (($mem == 'Y') && (!IS_LOGGED_IN())) {
+ } elseif (($mem == "Y") && (!IS_LOGGED_IN())) {
// You have to login first!
$ret = "mem_only";
- } elseif (($admin == 'Y') && (!IS_ADMIN())) {
+ } elseif (($admin == "Y") && (!IS_ADMIN())) {
// Only the Admin is allowed to enter this module!
$ret = "admin_only";
}
$MOD_CHECK = $GLOBALS['module'];
break;
}
- $AND = " AND what=''";
+ $AND = " AND (what='' OR what IS NULL)";
} elseif (ereg("what-", $file)) {
// This is an admin what file!
$type = "what";
if ($return) {
// Return title
return $ret;
- } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == 'Y')) || ((IS_ADMIN()) && ($MOD_CHECK == "admin"))) {
+ } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == "Y")) || ((IS_ADMIN()) && ($MOD_CHECK == "admin"))) {
// Output HTML code
$OUT = $prefix."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$MOD_CHECK."&".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
//* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*<br />\n";
}
// Load SQL data and add the menu to the output stream...
- $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE what='' ".$AND." ORDER BY sort",
+ $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE (what='' OR what IS NULL) ".$AND." ORDER BY sort",
array($MODE), __FILE__, __LINE__);
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
if (SQL_NUMROWS($result_main) > 0) {
} else {
// This is a menu block... ;-)
$BLOCK_MODE = true;
- $INC_BLOCK = sprintf(PATH."inc/modules/%s/action-%s.php", $MODE, $main_action);
+ $INC_BLOCK = sprintf("%sinc/modules/%s/action-%s.php", PATH, $MODE, $main_action);
if ((file_exists($INC_BLOCK)) && (is_readable($INC_BLOCK))) {
// Load include file
if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML("<TR>
{
global $cacheArray, $_CONFIG;
$ret = false; $passCookie = ""; $valPass = "";
- /* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
+ //* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
// If admin login is not given take current from cookies...
if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
$admin = SQL_ESCAPE(get_session('admin_login'));
$passCookie = SQL_ESCAPE(get_session('admin_md5'));
}
- /* DEBUG: */ echo __LINE__."ADMIN:".$admin."/".$passCookie."<br />";
+ //* DEBUG: */ echo __LINE__."ADMIN:".$admin."/".$passCookie."<br />";
// Search in array for entry
if ((!empty($passCookie)) && (isset($cacheArray['admins']['password'][$admin])) && (!empty($admin))) {
}
// Return result of comparision
- /* DEBUG: */ if (!$ret) echo __LINE__."OK!<br>";
+ //* DEBUG: */ if (!$ret) echo __LINE__."OK!<br>";
return $ret;
}
//
else
{
// Admin login overview
- $SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what=''".$ADD." ORDER BY action DESC LIMIT 1",
+ $SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND (what='' OR what IS NULL)".$ADD." ORDER BY action DESC LIMIT 1",
array($MODE, $act), __FILE__, __LINE__, false);
}
// Load template
$msg = LOAD_EMAIL_TEMPLATE("member_mydata_notify", $content, $GLOBALS['userid']);
- if ($_CONFIG['admin_notify'] == 'Y') {
+ if ($_CONFIG['admin_notify'] == "Y") {
// The admin needs to be notified about a profile change
$msg_admin = "admin_mydata_notify";
$sub_adm = ADMIN_CHANGED_DATA;
} else {
SEND_ADMIN_EMAILS($sub_adm, LOAD_EMAIL_TEMPLATE($msg_admin, $content, $GLOBALS['userid']));
}
- } elseif ($_CONFIG['admin_notify'] == 'Y') {
+ } elseif ($_CONFIG['admin_notify'] == "Y") {
// Cannot send mails to admin!
$content = CANNOT_SEND_ADMIN_MAILS;
} else {
* uid = Referral ID wich should receive...
* points = ... xxx points
* send_notify = shall I send the referral an email or not?
- * refid = inc/modules/guest/what-confirm.php need this
+ * rid = inc/modules/guest/what-confirm.php need this
* locked = Shall I pay it to normal (false) or locked (true) points ammount?
* add_mode = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct"
* will cause no referral will get points ever!!!)
if (!EXT_IS_ACTIVE("online", true)) return;
// Initialize variables
- $uid = "0"; $rid = "0"; $MEM = 'N'; $ADMIN = 'N';
+ $uid = "0"; $rid = "0"; $MEM = "N"; $ADMIN = "N";
if (!empty($GLOBALS['userid']))
{
// Update member status only when userid is valid
{
// Is valid user
$uid = $GLOBALS['userid'];
- $MEM = 'Y';
+ $MEM = "Y";
}
}
if (IS_ADMIN())
{
// Is administrator
- $ADMIN = 'Y';
+ $ADMIN = "Y";
}
if (isSessionVariableSet('refid')) {
// Check cookie
return $ret;
}
//
-function GET_ADMIN_LOGIN($aid)
-{
+function GET_ADMIN_LOGIN($aid) {
global $cacheArray;
$ret = "***";
- if (!empty($cacheArray['admins']['login']['aid']))
- {
+ if (!empty($cacheArray['admins']['login']['aid'])) {
// Check cache
if (!empty($cacheArray['admins']['login'][$aid])) $ret = $cacheArray['admins']['login'][$aid];
if (empty($ret)) $ret = "***";
- }
- else
- {
+ } else {
// Load from database
$result = SQL_QUERY_ESC("SELECT login FROM "._MYSQL_PREFIX."_admins WHERE id=%d LIMIT 1",
array(bigintval($aid)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ if (SQL_NUMROWS($result) == 1) {
// Fetch data
list($ret) = SQL_FETCHROW($result);
}
return $ret;
}
//
-function ADD_OPTION_LINES($table, $id, $name, $default="",$special="",$where="")
-{
+function ADD_OPTION_LINES($table, $id, $name, $default="",$special="",$where="") {
$ret = "";
- if ($table == "/ARRAY/")
- {
+ if ($table == "/ARRAY/") {
// Selection from array
- if (is_array($id) && is_array($name) && sizeof($id) == sizeof($name))
- {
+ if (is_array($id) && is_array($name) && sizeof($id) == sizeof($name)) {
// Both are arrays
- foreach ($id as $idx=>$value)
- {
+ foreach ($id as $idx=>$value) {
$ret .= "<OPTION value=\"".$value."\"";
if ($default == $value) $ret .= " selected checked";
$ret .= ">".$name[$idx]."</OPTION>\n";
}
}
- }
- else
- {
+ } else {
// Data from database
$SPEC = ", ".$id;
if (!empty($special)) $SPEC = ", ".$special;
if ($table == "country") $ORDER = $special;
$result = SQL_QUERY_ESC("SELECT %s, %s".$SPEC." FROM "._MYSQL_PREFIX."_%s ".$where." ORDER BY %s",
array($id, $ORDER, $table, $name), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0)
- {
+ if (SQL_NUMROWS($result) > 0) {
// Found data so add them as OPTION lines: $id is the value and $name is the "name" of the option
- while (list($value, $title, $add) = SQL_FETCHROW($result))
- {
+ while (list($value, $title, $add) = SQL_FETCHROW($result)) {
if (empty($special)) $add = "";
$ret .= "<OPTION value=\"".$value."\"";
if ($default == $value) $ret .= " selected checked";
// Free memory
SQL_FREERESULT($result);
- }
- else
- {
+ } else {
// No data found
$ret = "<OPTION value=\"x\">".SELECT_NONE."</OPTION>\n";
}
}
+
// Return - hopefully - the requested data
return $ret;
}
if (isset($cacheArray['modules']['has_menu'][$mod]))
{
// Check module cache and count hit
- if ($cacheArray['modules']['has_menu'][$mod] == 'Y') $ret = true;
+ if ($cacheArray['modules']['has_menu'][$mod] == "Y") $ret = true;
$_CONFIG['cache_hits']++;
}
elseif (isset($cacheArray['extensions']['ext_menu'][$mod]))
{
// Check cache and count hit
- if ($cacheArray['extensions']['ext_menu'][$mod] == 'Y') $ret = true;
+ if ($cacheArray['extensions']['ext_menu'][$mod] == "Y") $ret = true;
$_CONFIG['cache_hits']++;
}
}
if (SQL_NUMROWS($result) == 1)
{
list($has_menu) = SQL_FETCHROW($result);
- if ($has_menu == 'Y') $ret = true;
+ if ($has_menu == "Y") $ret = true;
}
// Free memory