Example #1
0
 public function import()
 {
     $arr = fgHelper::loadIniFile(self::ini, false);
     $server_type_id = fgServerType::idFromKey($this->server_type);
     foreach ($arr as $location => $v) {
         $s = new fgServer(0);
         $s->nick = null;
         $s->server_type_id = $server_type_id;
         $s->host = $v['server'];
         $s->location = $location;
         $s->ip = isset($v['ip']) ? $v['ip'] : null;
         $s->save();
     }
 }
Example #2
0
 public function import()
 {
     global $Site;
     $ini = fgHelper::loadIniFile(self::ini, false);
     $server_type_id = fgServerType::idFromKey($this->server_type);
     foreach ($ini as $channel => $v) {
         $s = new fgServer(0);
         $s->nick = $v['title'];
         $s->server_type_id = $server_type_id;
         $s->host = $this->server;
         $s->location = $channel;
         $s->irc = null;
         $s->save();
     }
 }
Example #3
0
 public function import()
 {
     $arr = fgHelper::loadIniFile(self::ini, false);
     $server_type_id = fgServerType::idFromKey($this->server_type);
     foreach ($arr as $host => $v) {
         $parts = explode(".", $host);
         $s = new fgServer(0);
         $s->nick = $parts[0];
         $s->server_type_id = $server_type_id;
         $s->host = $host;
         $s->ip = isset($v['ip']) ? $v['ip'] : null;
         $s->contact = isset($v['contact']) ? $v['contact'] : null;
         $s->location = isset($v['location']) ? $v['location'] : null;
         $s->irc = isset($v['irc']) ? $v['irc'] : null;
         $s->tracked = $v['tracked'] == 1 ? true : null;
         $s->save();
     }
 }
Example #4
0
$LOAD_DB = true;
require_once '../config/config.inc.php';
//$db->debug=1;
$db->execute("delete from servers");
$db->execute("delete from server_types");
$types = array();
$types['mpmap'] = 'MP Map';
//$types['scenery'] = 'Map Server';
$types['mapserver'] = 'Map Server';
$types['mpserver'] = 'Map Server';
//$types['scenery'] = 'Scenery';
$types['mirror'] = 'FTP Mirrors';
$types['irc'] = 'Irc';
$ids = array();
foreach ($types as $t => $v) {
    $st = new fgServerType(0);
    $st->server_type_key = $t;
    $st->server_type = $v;
    $new_id = $st->save();
    $ids[$t] = $new_id;
}
//$db->debug=1;
$m = new fgIrc();
$m->import();
$m = new fgMirror();
$m->import();
$m = new fgMpServer();
$m->import();
$S = new fgServer(0);
$S->server_type = $ids['mpmap'];
$S->nick = 'mpmap01';