Changeset 632


Ignore:
Timestamp:
Dec 9, 2013, 12:02:53 AM (10 years ago)
Author:
maron
Message:
  • Fixed: Get names only if sql query is ok
  • Added: tool for export dbc from client
  • Added: script to set dbc structure from dbc files converted to csv
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/index.php

    r624 r632  
    2525  '<small>Exportovat texty z PHP souborů pro překlad rozhraní</small><br/><br/>'.
    2626  '<a href="'.$System->Link('/admin/?action=uncomplete').'">Nastavit nekompletní texty</a><br/>'.
    27   '<small>Nastaví questy, které jsou v popisu nebo objektu stejné jako nedokončené</small><br/><br/>';   
     27  '<small>Nastaví questy, které jsou v popisu nebo objektu stejné jako nedokončené</small><br/><br/>'.   
     28  '<a href="'.$System->Link('/admin/?action=dbcstructure').'">Připravit dbc strukturu</a><br/>'.
     29  '<small>Otevře dbc soubory převedené do textové formy pro přípravu struktury pro import</small><br/><br/>';   
    2830  return($Output);
    2931}
     
    8890  $Output .= '<br / ><br / >Questy nastaveny jako nedokončené!';
    8991  return($Output);
    90 }           
     92}     
     93
     94function DbcStructure() {
     95  global $System,$TranslationTree;
     96  $Output = '';
     97  if (array_key_exists('GroupItem', $_GET)) {
     98    $DbResult = $System->Database->query('SELECT * FROM `ClientVersion` WHERE `Version` = "'.$System->Config['Web']['GameVersion'].'"');
     99    $Version = $DbResult->fetch_assoc(); 
     100    $System->Database->query('INSERT INTO  `GroupItemDBC` (`Id` ,`ClientVersion` ,`GroupItem` ,`ColumnIndex`)VALUES (NULL ,  \''.$Version['Id'].'\',  \''.$_GET['GroupItem'].'\',  \''.$_GET['ColumnIndex'].'\')');
     101    $Output .= 'vloženo <br />';
     102  }   
     103  if (array_key_exists('id', $_GET)) {
     104    $Group = $TranslationTree[$_GET['id']];
     105   //  $Output .= '<form action="?action=dbcstructure&amp;id='.$Group['Id'].'">';
     106   //  foreach($Group['Items'] as $GroupItem)
     107   //   {
     108   //     $Output .= $GroupItem['Column'].': <input name="'.$GroupItem['Id'].'"><br />';
     109   //   }
     110   //      $Output .= '<input type="submit" value="uložit"></form>';
     111 
     112         
     113          $File = new FileStream();
     114                                             
     115          $File->OpenFile(dirname(__FILE__).'/../source/'.$System->Config['Web']['GameVersion'].'/dbc/'.$Group['DBCFileName'].'.dbc.csv');
     116
     117          //while(!$File->EOF())
     118         
     119          $Output .= '<table class="BaseTable">';
     120          $Output .= '<tr><td>';
     121          $Line = $File->ReadLine();
     122         
     123          for ($i=0;$i<substr_count($Line,',');$i++) {
     124            $Output .= $i;
     125            $Output .= '</td><td>';
     126          }
     127          $Output .= '</td></tr><tr><td>';
     128          for ($i=0;$i<substr_count($Line,',');$i++) {
     129            foreach($Group['Items'] as $GroupItem)
     130              $Output .=   ' <a href="'.$System->Link('/admin/?action=dbcstructure&amp;id='.$Group['Id'].'&amp;GroupItem='.$GroupItem['Id'].'&amp;ColumnIndex='.$i).'">'.$GroupItem['Column'].'</a><br/>';
     131            $Output .= '</td><td>';
     132          }
     133   
     134          $Output .= '</td></tr><tr><td>';
     135
     136            $Output .= str_replace(',', '</td><td>', $Line);
     137            $Output .= '</td></tr><tr><td>';
     138          for ($i=0;$i<50;$i++) {
     139            $Line = $File->ReadLine();
     140            $Output .= str_replace(',', '</td><td>', $Line);
     141            $Output .= '</td></tr><tr><td>';
     142          }
     143
     144          $Output .= '</td></tr>';
     145          $Output .= '</table>';
     146  } else {
     147    foreach($TranslationTree as $Group) 
     148    {
     149      if ($Group['DBCFileName'] <> '')
     150        $Output .=   '<a href="'.$System->Link('/admin/?action=dbcstructure&amp;id='.$Group['Id']).'">'.$Group['DBCFileName'].'</a><br/>';
     151
     152    } 
     153  }
     154           
     155 
     156  return($Output);
     157}     
    91158
    92159function ShowLocale()
     
    117184    else if($_GET['action'] == 'locale') $Output .= ShowLocale();
    118185    else if($_GET['action'] == 'uncomplete') $Output .= Uncomplete();
     186    else if($_GET['action'] == 'dbcstructure') $Output .= DbcStructure();
    119187    else $Output .= ShowMenu();
    120188  } else $Output .= ShowMenu(); 
  • trunk/download.php

    r577 r632  
    3939  '<a href="http://zezula.net/download/mpqediten32.zip">Ladik\'s MPQ Editor</a> <a href="http://zezula.net/">Stránky autora</a><br />'.
    4040  '<a href="download/wowsig.exe">WoWsig.exe addon signature generator by wad (2005)</a><br />'.
    41   '<a href="download/DBCtoCSV.exe">DBCtoCSV</a> - nástroj pro převod souborů DBC na CSV<br />';
     41  '<a href="download/DBCtoCSV.exe">DBCtoCSV</a> - nástroj pro převod souborů DBC na CSV<br />'.
     42  '<a href="download/ClientDBExtractor.exe">ClientDBExtractor.exe</a> - nástroj pro exportování dbc z klienta (funguje i na verze větší než 3.3.5a)<br />';
    4243
    4344ShowPage($Output);     
  • trunk/includes/Version.php

    r630 r632  
    66// and system will need database update.
    77
    8 $Revision = 630; // Subversion revision
     8$Revision = 632; // Subversion revision
    99$DatabaseRevision = 610; // Database structure revision
    10 $ReleaseTime = '2013-12-04';
     10$ReleaseTime = '2013-12-08';
  • trunk/includes/global.php

    r628 r632  
    571571
    572572  }   
     573    if ($SqlOK) {
    573574        $DbResult = $System->Database->query($sqlall.$orderby);
    574575    //  echo ($sql.'|'.$where.'|'.$groupby);
     
    577578          $buff[] = array($Line['ID'], $Line['GoupId'], $Line['Orig'], $Line['Tran']);
    578579        }
    579    
     580    }
    580581    return $buff;
    581582}
Note: See TracChangeset for help on using the changeset viewer.