예제 #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();
     }
 }
예제 #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();
     }
 }
예제 #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();
     }
 }