sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); // Grab global variables, re-cache if necessary if ($config = $cache->get('config')) { $sql = 'SELECT * FROM ' . CONFIG_TABLE . ' WHERE is_dynamic = 1'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $config[$row['config_name']] = $row['config_value']; } } else { $config = $cached_config = array(); $sql = 'SELECT * FROM ' . CONFIG_TABLE; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { if (!$row['is_dynamic']) { $cached_config[$row['config_name']] = $row['config_value']; } $config[$row['config_name']] = $row['config_value']; } $db->sql_freeresult($result); $cache->put('config', $cached_config); unset($cached_config); } /* if (time() - $config['cache_interval'] >= $config['cache_last_gc']) { $cache->tidy($config['cache_gc']); } */ // Handle email/cron queue. if (time() - $config['queue_interval'] >= $config['last_queue_run'] && !defined('IN_ADMIN')) { if (file_exists($phpbb_root_path . 'cache/queue.' . $phpEx)) { include($phpbb_root_path . 'includes/emailer.'.$phpEx); $queue = new queue(); $queue->process(); } } // Warn about install/ directory if (file_exists('install')) { // trigger_error('REMOVE_INSTALL'); } // Show 'Board is disabled' message if ($config['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN')) { $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; trigger_error($message); } // addslashes to vars if magic_quotes_gpc is off function slash_input_data(&$data) { if (is_array($data)) { foreach ($data as $k => $v) { $data[$k] = (is_array($v)) ? slash_input_data($v) : addslashes($v); } } return $data; } ?>