function server_load sid loadapi false include_once Net DNS php if is_

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function server_load($sid, $loadapi = false) {
include_once('Net/DNS.php');
if (is_numeric($sid)) {
$serverid = db_fetch_object(db_query('SELECT * FROM {servers} WHERE sid = %d', $sid));
} else {
$serverid = db_fetch_object(db_query('SELECT * FROM {servers} WHERE host = "%s"', $sid));
}
$server = new ControlServer();
$server->serverobject = $serverid;
if ($loadapi) {
$server->Load();
};
return $server;
}