mode = variable_get('subdomain_mode', 'user'); $this->source = variable_get('subdomain_source', 'default'); $this->home = variable_get('subdomain_home', 'default'); $this->view = variable_get('subdomain_view', ''); if ($this->source == 'default') { $this->form_field = $this->default_form_field(); } else { $this->form_field = 'subdomain'; } } function load($value, $field = 'sid') { if ($field == 'sid') { $sql = "SELECT * FROM {subdomain} WHERE sid = %d"; } else { $sql = "SELECT * FROM {subdomain} WHERE subdomain = '%s'"; } return db_fetch_object(db_query($sql, $value)); } function default_form_field() { return 'name'; } }