QUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin'; elseif ($context['current_action'] == 'register2') $current_action = 'register'; elseif ($context['current_action'] == 'login2' || ($user_info['is_guest'] && $context['current_action'] == 'reminder')) $current_action = 'login'; elseif ($context['current_action'] == 'groups' && $context['allow_moderation_center']) $current_action = 'moderate'; $context['menu_buttons'][$current_action]['active_button'] = true; if (!$user_info['is_guest'] && $context['user']['unread_messages'] > 0 && isset($context['menu_buttons']['pm'])) { $context['menu_buttons']['pm']['alttitle'] = $context['menu_buttons']['pm']['title'] . ' [' . $context['user']['unread_messages'] . ']'; $context['menu_buttons']['pm']['title'] .= ' [' . $context['user']['unread_messages'] . ']'; } } // Generate a random seed and ensure it's stored in settings. function smf_seed_generator() { global $modSettings; // Never existed? if (empty($modSettings['rand_seed'])) { $modSettings['rand_seed'] = microtime() * 1000000; updateSettings(array('rand_seed' => $modSettings['rand_seed'])); } if (@version_compare(PHP_VERSION, '4.2.0') == -1) { $seed = ($modSettings['rand_seed'] + ((double) microtime() * 1000003)) & 0x7fffffff; mt_srand($seed); } // Change the seed. updateSettings(array('rand_seed' => mt_rand())); } // Process functions of an integration hook. function call_integration_hook($hook, $parameters = array()) { global $modSettings; $results = array(); if (empty($modSettings[$hook])) return $results; $functions = explode(',', $modSettings[$hook]); // Loop through each function. foreach ($functions as $function) { $function = trim($function); $call = strpos($function, '::') !== false ? explode('::', $function) : $function; // Is it valid? if (is_callable($call)) $results[$function] = call_user_func_array($call, $parameters); } return $results; } // Add a function for integration hook. function add_integration_function($hook, $function, $permanent = true) { global $smcFunc, $modSettings; // Is it going to be permanent? if ($permanent) { $request = $smcFunc['db_query']('', ' SELECT value FROM {db_prefix}settings WHERE variable = {string:variable}', array( 'variable' => $hook, ) ); list($current_functions) = $smcFunc['db_fetch_row']($request); $smcFunc['db_free_result']($request); if (!empty($current_functions)) { $current_functions = explode(',', $current_functions); if (in_array($function, $current_functions)) return; $permanent_functions = array_merge($current_functions, array($function)); } else $permanent_functions = array($function); updateSettings(array($hook => implode(',', $permanent_functions))); } // Make current function list usable. $functions = empty($modSettings[$hook]) ? array() : explode(',', $modSettings[$hook]); // Do nothing, if it's already there. if (in_array($function, $functions)) return; $functions[] = $function; $modSettings[$hook] = implode(',', $functions); } // Remove an integration hook function. function remove_integration_function($hook, $function) { global $smcFunc, $modSettings; // Get the permanent functions. $request = $smcFunc['db_query']('', ' SELECT value FROM {db_prefix}settings WHERE variable = {string:variable}', array( 'variable' => $hook, ) ); list($current_functions) = $smcFunc['db_fetch_row']($request); $smcFunc['db_free_result']($request); if (!empty($current_functions)) { $current_functions = explode(',', $current_functions); if (in_array($function, $current_functions)) updateSettings(array($hook => implode(',', array_diff($current_functions, array($function))))); } // Turn the function list into something usable. $functions = empty($modSettings[$hook]) ? array() : explode(',', $modSettings[$hook]); // You can only remove it if it's available. if (!in_array($function, $functions)) return; $functions = array_diff($functions, array($function)); $modSettings[$hook] = implode(',', $functions); } ?>Table 'ducati_db.smf_settings' doesn't exist