Changeset 20 for trunk/www/index.php


Ignore:
Timestamp:
Jun 12, 2009, 11:18:23 AM (15 years ago)
Author:
george
Message:
  • Přidáno: Generování souboru realmlist.wtf.
  • Upraveno: Uchování portu realmd a worldd v databází namísto výpočtu z Id serveru.
  • Opraveno: Zobrazení hodnot dle skriptů typů v obecné tabulce.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/index.php

    r17 r20  
    1010  function ShowServerListOnRow($Row)
    1111  {
    12     $Row['NetworkPortRealmd'] = $this->System->Config['Web']['Host'].':'.$Row['NetworkPortRealmd'];
     12    $Row['NetworkPortRealmd'] = '<a href="realmlist.php?Id='.$Row['Id'].'">'.$this->System->Config['Web']['Host'].':'.$Row['NetworkPortRealmd'].'</a>';
    1313    $Row['Name'] = '<a href="?Action=ServerShow&amp;Id='.$Row['Id'].'">'.$Row['Name'].'</a>';
    1414    return($Row);
     
    230230          else
    231231          {
     232            $DbResult = $this->Database->query('SELECT MAX(NetworkPortRealmd), MAX(NetworkPortWorldd) FROM Server');
     233            $DbRow = $DbResult->fetch_row();
     234            $NewPortRealmd = $DbRow[0] + 1;
     235            if($NewPortRealmd < $Config['BaseNetworkPortRealmd']) $NewPortRealmd = $Config['BaseNetworkPortRealmd'];
     236            $NewPortWorldd = $DbRow[1] + 1;
     237            if($NewPortWorldd < $Config['BaseNetworkPortWorldd']) $NewPortWorldd = $Config['BaseNetworkPortWorldd'];
     238           
    232239            $Form = new Form('NewServer', array());
    233240            $Form->LoadValuesFromForm();
    234             $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => 1));
     241            $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => 1, 'NetworkPortWorldd' => $NewPortWorldd, 'NetworkPortRealmd' => $NewPortRealmd));
    235242            $LastInsertId = $this->Database->insert_id;
    236243            $Server = new Server($this->Database, $LastInsertId);
Note: See TracChangeset for help on using the changeset viewer.