$ADD = "";
if ((!IS_ADMIN()) && ($MODE != "admin")) $ADD = " AND locked='N'";
//* DEBUG: */ echo __LINE__.":".$MODE."/".$act."/".$wht."*<br />\n";
- if (($MODE != "admin") && ($UPDATE))
- {
+ if (($MODE != "admin") && ($UPDATE)) {
// Update guest or member menu
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_%s_menu SET counter=counter+1 WHERE action='%s' AND what='%s'".$ADD." LIMIT 1",
+ $SQL = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_%s_menu SET counter=counter+1 WHERE action='%s' AND what='%s'".$ADD." LIMIT 1",
array($MODE, $act, $wht), __FILE__, __LINE__, false);
- }
- elseif ($wht != "overview")
- {
+ } elseif ($wht != "overview") {
// Other actions
$SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s'".$ADD." ORDER BY action DESC LIMIT 1",
array($MODE, $act), __FILE__, __LINE__, false);
- }
- else
- {
+ } else {
// Admin login overview
$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);
// Run SQL command
$result = SQL_QUERY($SQL, __FILE__, __LINE__);
- if ($UPDATE)
- {
+ if ($UPDATE) {
if (SQL_AFFECTEDROWS() == 1) $ret = true;
//* DEBUG: */ debug_print_backtrace();
- }
- else
- {
+ } else {
if (SQL_NUMROWS($result) == 1) {
- list($id, $wht2) = SQL_FETCHROW($result);
//* DEBUG: */ echo __LINE__."+".$SQL."+<br />\n";
//* DEBUG: */ echo __LINE__."*".$id."/".$wht."/".$wht2."*<br />\n";
$ret = true;
}
// Activate exchange (DEPERECATED???)
function activateExchange() {
- global $_CONFIG;
- $result = SQL_QUERY("SELECT userid FROM `"._MYSQL_PREFIX."_user_data` WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) >= getConfig('activate_xchange'))
- {
- // Free memory
- SQL_FREERESULT($result);
+ // Check total amount of users
+ $totalUsers = GET_TOTAL_DATA("CONFIRMED", "use_data", "userid", "status", true, " AND max_mails > 0");
+ if ($totalUsers >= getConfig('activate_xchange')) {
// Activate System
$SQLs = array(
"UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', mem_only='Y' WHERE module='order' LIMIT 1",
);
// Run SQLs
- foreach ($SQLs as $sql) {
- $result = SQL_QUERY($sql, __FILE__, __LINE__);
- }
+ RUN_FILTER('run_sqls', array('dry_run' => false, 'sqls' => $SQLs));
- // @TODO Destroy cache
- }
+ // Rebuild cache
+ REBUILD_CACHE("config", "config");
+ } // END - if
}
//
function DELETE_USER_ACCOUNT($uid, $reason)