0) { if (is_null($domain)) { // We lower case this, since EXAMPLE.com == example.com. $_subdomain = strtolower(rtrim($_SERVER['HTTP_HOST'])); // Lookup the active domain against our allowed hosts record. $domain = db_fetch_array(db_query("SELECT domain_id FROM {domain} WHERE subdomain = '%s'", $_subdomain)); } // If nothing was found, use the default domain. if (!isset($domain['domain_id'])) { $domain['domain_id'] = 0; } $data = array(); $data = db_fetch_array(db_query("SELECT settings FROM {domain_conf} WHERE domain_id = %d", $domain['domain_id'])); if (!empty($data)) { global $conf; $settings = unserialize($data['settings']); // Overwrite the $conf variables. foreach ($settings as $key => $value) { $conf[$key] = $value; } } } }