Changeset 302


Ignore:
Timestamp:
Dec 29, 2009, 12:58:13 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Tabulka týmů doplněna o položy URL web stránek, identifikaci vůdce týmu a času vytvoření týmu.
  • Opraveno: Vstupování do týmů ze stránky nastavení překladatele.
Location:
trunk
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Options.php

    r191 r302  
    1919   // $Line = mysql_fetch_assoc($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID']));
    2020    if(($_SESSION['Pass'] == $OldPass) and ($NewPass == $NewPass2))
    21         {
     21    {
    2222      $Database->SQLCommand('UPDATE user SET pass = sha1("'.$NewPass.'") WHERE ID = '.$_SESSION['UserID']);
    2323      echo('Heslo změněno!<br />');
    2424    } else echo('<br />Hesla se neshodují!<br />');
    25     $Database->SQLCommand("UPDATE user SET Email = '$Email', Language = '$Language', redirecting = '$redirecting' WHERE ID = ".$_SESSION['UserID']);
    26       echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User.'</b><br />');
    27       WriteLog('Úprava nastavení!', 3);
     25    $Database->SQLCommand('UPDATE user SET Email = "'.$Email.'", Language = "'.$Language.'", redirecting = "'.$redirecting.'" WHERE ID = '.$_SESSION['UserID']);
     26    echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User.'</b><br />');
     27    WriteLog('Úprava nastavení!', 3);
    2828  } else
    2929  {
    30     $Line = mysql_fetch_assoc($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID']));   
     30    $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM user WHERE ID = '.$_SESSION['UserID']));   
    3131    echo('<form action="Options.php" method="post">
    32         <fieldset><legend>Nastavení uživatele</legend>
     32  <fieldset><legend>Nastavení uživatele</legend>
    3333  <table>
    3434    <tr>
     
    5151      <td>Normálně budu překládat do: </td>
    5252      <td>');
    53           WriteLanguages($Line['Language']);
    54           echo('</td>
     53    WriteLanguages($Line['Language']);
     54    echo('</td>
    5555    </tr>
    5656    <tr>
    5757      <td>Po uložení překladu přesměrovat: </td>
    5858      <td>');
    59          
     59   
    6060   echo('<select name="redirecting">');
    6161   echo('<option value="0">Nikam</option>');
     
    6363   echo('<option value="2"'); if ($Line['redirecting'] == '2') echo(' selected="selected"'); echo('>Na další překlad</option>');
    6464   echo('<option value="3"'); if ($Line['redirecting'] == '3') echo(' selected="selected"'); echo('>Na předchozí překlad</option>');
    65    echo('</select>');   
    66          
    67           echo('</td>
     65   echo('</select>');   
     66   
     67    echo('</td>
    6868    </tr>
    6969    <tr>
     
    7373</form>');
    7474
    75         echo (' <fieldset><legend>Překladatelský tým</legend>');
    76         $ID = $Database->SQLCommand("SELECT * FROM team");
    77                 echo('<a href="team.php?create">Vytvořit překladatelský tým</a><br /><br />
    78                 <form action="team.php" method="get"><select name="gointeam">');
    79     While($LineTeam = mysql_fetch_assoc($ID)) {
    80                 echo('<option value="'.$LineTeam['ID'].'"');
    81                         if ($LineTeam['ID'] == $Line['team']) echo(' selected="selected"');
    82                          echo('>'.$LineTeam['name'].'</option>');
    83         }   
    84                 echo('</select> <input type="submit" value="Vstoupit" />
    85                 </form>');     
    86         echo ('</fieldset>      ');
     75    echo('  <fieldset><legend>Překladatelský tým</legend>');
     76    $ID = $Database->SQLCommand('SELECT * FROM `Team`');
     77    echo('<a href="team.php?create">Vytvořit překladatelský tým</a><br /><br />
     78      <form action="team.php" method="get">'.
     79      '<input type="hidden" name="action" value="gointeam"/>'.
     80      '<select name="id">');
     81    while($LineTeam = mysql_fetch_assoc($ID))
     82    {
     83      echo('<option value="'.$LineTeam['Id'].'"');
     84      if ($LineTeam['Id'] == $Line['team']) echo(' selected="selected"');
     85        echo('>'.$LineTeam['Name'].'</option>');
     86    }   
     87    echo('</select> <input type="submit" value="Vstoupit" />
     88    </form>');   
     89    echo('</fieldset>');
     90  }
     91} else echo('Nejste přihlášený!');
     92ShowFooter(); 
    8793
    88   }
    89 } else echo 'Nejste přihlášený!';
    90   ShowFooter(); 
    9194?>
    9295   
  • trunk/action.php

    r300 r302  
    2929    $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `user` WHERE `user` LIKE "%'.$Search.'%"'));
    3030  echo('<tr><td><a href="userlist.php?search='.$Search.'">Uživatelé</a></td><td>'.$Line[0].'</td></tr>');
    31     $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `team` WHERE `name` LIKE "%'.$Search.'%" OR `description` LIKE "%'.$Search.'%"'));
     31    $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"'));
    3232  echo('<tr><td><a href="team.php?search='.$Search.'">Týmy</a></td><td>'.$Line[0].'</td></tr>');
    3333    $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `verseclient` WHERE `text` LIKE "%'.$Search.'%"'));
  • trunk/img_level.php

    r292 r302  
    118118
    119119// Hlavní kod pro překladatelské týmy
    120 if($nothide) $ID = $Database->SQLCommand('SELECT ID,name,(SELECT avg(XP) FROM user WHERE team = team.ID) as average FROM team');
    121   else $ID = $Database->SQLCommand('SELECT ID,name,(SELECT avg(XP) FROM user WHERE team = team.ID) as average  FROM team WHERE ID IN (SELECT Team FROM user WHERE NeedUpdate = 1)');
     120if($nothide) $ID = $Database->SQLCommand('SELECT ID,name,(SELECT avg(XP) FROM user WHERE team = Team.Id) as average FROM Team');
     121  else $ID = $Database->SQLCommand('SELECT ID,name,(SELECT avg(XP) FROM user WHERE team = Team.Id) as average FROM Team WHERE ID IN (SELECT Team FROM user WHERE NeedUpdate = 1)');
    122122while($LineTeam = mysql_fetch_array($ID))
    123123{
  • trunk/import/generatecodeXML.php

    r195 r302  
    55function startElement($parser, $name, $attrs)
    66{
    7     global $depth,$xml_buffer;
    8     for ($i = 0; $i < $depth[$parser]; $i++) {
    9         echo "  ";
    10     }
     7  global $depth, $xml_buffer;
     8 
     9  for ($i = 0; $i < $depth[$parser]; $i++)
     10  {
     11    echo "  ";
     12  }
    1113   // echo "<BR />$name\n";
    1214//    print_r( $attrs);
     
    2022function endElement($parser, $name)
    2123{
    22     global $depth;
    23     $depth[$parser]--;
     24  global $depth;
     25 
     26  $depth[$parser]--;
    2427}
    2528//TODO '.$Config['Web']['GameVersion'].'
     
    2730
    2831$files = scandir($verze);
    29 foreach($files as $file) {
    30 $end = substr($file,strlen($file)-3);
    31 if ($end == 'xml'){
    32         echo '<br />--'.$file.'<br /><br />';
    33         $file = $verze.'/'.$file;       
    34         $xml_buffer = array(); //mazání
    35        
     32foreach($files as $file)
     33{
     34  $end = substr($file, strlen($file) - 3);
     35  if($end == 'xml')
     36  {
     37    echo('<br />--'.$file.'<br /><br />');
     38    $file = $verze.'/'.$file;
     39    $xml_buffer = array(); //mazání
     40 
     41    $xml_parser = xml_parser_create();
     42    xml_set_element_handler($xml_parser, 'startElement', 'endElement');
     43    if (!($fp = fopen($file, 'r')))
     44    {
     45      die('could not open XML input');
     46    }
    3647
    37         $xml_parser = xml_parser_create();
    38         xml_set_element_handler($xml_parser, "startElement", "endElement");
    39         if (!($fp = fopen($file, "r"))) {
    40         die("could not open XML input");
    41         }
    42 
    43         while ($data = fread($fp, 4096)) {
    44         if (!xml_parse($xml_parser, $data, feof($fp))) {
    45                 die(sprintf("XML error: %s at line %d",
     48    while ($data = fread($fp, 4096))
     49    {
     50      if (!xml_parse($xml_parser, $data, feof($fp)))
     51      {
     52        die(sprintf("XML error: %s at line %d",
    4653                    xml_error_string(xml_get_error_code($xml_parser)),
    4754                    xml_get_current_line_number($xml_parser)));
    48         }
    49         }
    50         xml_parser_free($xml_parser);
    51        
    52    for ($i = 0; $i < count($xml_buffer); $i++) {
    53           $line = $xml_buffer[$i];
    54           if (isset($line[1]['TEXT'])) {
    55                 $name = $line[1]['NAME'];
     55      }
     56    }
     57    xml_parser_free($xml_parser);
     58 
     59    for ($i = 0; $i < count($xml_buffer); $i++)
     60    {
     61      $line = $xml_buffer[$i];
     62       if (isset($line[1]['TEXT']))
     63      {
     64        $name = $line[1]['NAME'];
    5665
    57                         if ($name == '') { //u FontString
    58                         $j = 1;
    59                                 while (substr($name,0,1) == '') {
    60                                         if (isset($xml_buffer[$i-$j][1]['NAME'])) {
    61                                                 $name = $xml_buffer[$i-$j][1]['NAME'].$name;
    62                                         }
    63                                         $j++;                           
    64                                 }
    65                         }
     66        if ($name == '')
     67        { //u FontString
     68          $j = 1;
     69          while (substr($name,0,1) == '')
     70          {
     71            if (isset($xml_buffer[$i-$j][1]['NAME']))
     72            {
     73              $name = $xml_buffer[$i-$j][1]['NAME'].$name;
     74            }
     75            $j++;         
     76          }
     77        }
    6678
    67           if (substr($name,0,1) == '$') { //zjišťování potomků
    68                         $j = 1;
    69                                 while (substr($name,0,1) == '$') {
    70                                         if (($xml_buffer[$i-$j][0] < $line[0]) and (isset($xml_buffer[$i-$j][1]['NAME']))) {
    71                                         $name = substr($name,strlen('$parent'));
    72                                                 $name = $xml_buffer[$i-$j][1]['NAME'].$name;
    73                                         }
    74                                         $j++;                           
    75                                 }
    76                         }
    77                         if ((' - ' <> $line[1]['TEXT']) and ('' <> $line[1]['TEXT']))
    78                                 echo $name.':SetText(i["'.$line[1]['TEXT'].'"]);<br />';
    79                 }
     79        if (substr($name,0,1) == '$')
     80        { //zjišťování potomků
     81          $j = 1;
     82          while (substr($name,0,1) == '$')
     83          {
     84            if (($xml_buffer[$i-$j][0] < $line[0]) and (isset($xml_buffer[$i-$j][1]['NAME'])))
     85            {
     86              $name = substr($name,strlen('$parent'));
     87              $name = $xml_buffer[$i-$j][1]['NAME'].$name;
     88            }
     89            $j++;         
     90          }
     91        }
     92        if ((' - ' <> $line[1]['TEXT']) and ('' <> $line[1]['TEXT']))
     93          echo $name.':SetText(i["'.$line[1]['TEXT'].'"]);<br />';
     94      }
     95    }
     96  }
     97}
    8098
    81     }
    82 }
    83 }
    8499?>
  • trunk/import/import_sql_mangos.php

    r250 r302  
    11<?php
    22
    3 function ImportSQLMangos($import_version,$GroupId)
     3function ImportSQLMangos($import_version, $GroupId)
    44{
    55  global $Database, $TranslationTree, $PatchVersion, $Config;
     6 
    67  $BuildNumber = GetBuildNumber($import_version);
    78 
    89  $Group = $TranslationTree[$GroupId];
    910
    10       $files = scandir('../source/'.$import_version.'/sql/', 1);
    11       unset($files[count($files) - 1]);
    12       unset($files[count($files) - 1]);
     11  $files = scandir('../source/'.$import_version.'/sql/', 1);
     12  unset($files[count($files) - 1]);
     13  unset($files[count($files) - 1]);
    1314     
    14           $File = new FileStream();
    15       $File->OpenFile('../source/'.$import_version.'/sql/'.$files[0]);
    16       $NewCount = 0;
    17       $Count = 0;
    18           $folow_structure = False;
    19           $i = 0;
    20       while((!$File->EOF()))
     15  $File = new FileStream();
     16  $File->OpenFile('../source/'.$import_version.'/sql/'.$files[0]);
     17  $NewCount = 0;
     18  $Count = 0;
     19  $folow_structure = False;
     20  $i = 0;
     21  while((!$File->EOF()))
     22  {
     23    $Line = $File->ReadLine();
     24    //Struktura
     25    if(strpos($Line, 'CREATE TABLE `'.$Group['MangosTable'].'`') !== false)
     26    {
     27      $Line = '';
     28      $folow_structure = True;
     29      $i = 0;
     30    }
     31    if((strpos($Line, ';') !== false) and ($folow_structure == true))
     32    {
     33      $folow_structure = False;
     34      //  echo ('Struktura: <br />');
     35      //  print_r($structure);
     36      //  echo ('<br /><br />');
     37    }
     38    if(($folow_structure == true) and ($Line != ''))
     39    {
     40      $str = substr($Line, 0, strpos($Line, '`'));
     41      $Line = substr($Line, strpos($Line, '`') + 1);
     42      $Line = substr($Line, 0, strpos($Line, '`'));
     43      if(strlen($str) < 3) $structure[$i] = $Line;
     44      $i++;
     45    }
     46   
     47    //data
     48    if((strpos($Line, 'INSERT INTO `'.$Group['MangosTable'].'`') !== false) and (isset($structure)))
     49    {
     50      $Line = substr($Line, strpos($Line, '(') + 1);
     51      $Line = substr($Line, 0, strpos($Line, ');'));
     52      $LineParts = explode('),(', $Line);
     53      unset($Line);
     54     
     55      foreach($LineParts as $LinePart)
    2156      {
    22         $Line = $File->ReadLine();
    23                 //Struktura
    24         if(strpos($Line, 'CREATE TABLE `'.$Group['MangosTable'].'`') !== false)
    25                 {
    26               $Line = '';
    27                   $folow_structure = True;
    28           $i = 0;
    29                 }
    30         if((strpos($Line, ';') !== false) and ($folow_structure == true))
    31                 {
    32                   $folow_structure = False;
    33                 //  echo ('Struktura: <br />');
    34                 //  print_r($structure);
    35                 //  echo ('<br /><br />');
    36                 }
    37                 if (($folow_structure == True) and  ($Line != ''))
    38                 {
    39                   $str = substr($Line,0, strpos($Line,'`'));
    40                   $Line = substr($Line, strpos($Line,'`')+1);
    41                   $Line = substr($Line,0, strpos($Line,'`'));
    42                   if (strlen($str) < 3)
    43                    $structure[$i] = $Line;
    44                   $i++;
    45             }
    46                
    47         //data
    48         if ((strpos($Line, 'INSERT INTO `'.$Group['MangosTable'].'`') !== false) and (isset($structure)))
    49         {
    50           $Line = substr($Line, strpos($Line,'(')+1);
    51           $Line = substr($Line,0, strpos($Line,');'));
    52           $LineParts = explode('),(', $Line);
    53                   unset($Line);
    54                  
    55           foreach($LineParts as $LinePart)
    56                   {
    57                         unset($Value,$value_buff);
    58             foreach($structure as $i => $column)
     57        unset($Value, $value_buff);
     58        foreach($structure as $i => $column)
     59        {
     60          if (substr($LinePart, 0, 1) != "'")
     61          {
     62            $value_buff = substr($LinePart, 0, strpos($LinePart, ','));
     63            $LinePart = substr($LinePart, strlen($value_buff) + 1);
     64          } else
     65          {
     66            $LinePart = substr($LinePart, 1);
     67            $value_buff = substr($LinePart, 0, strpos($LinePart, "'"));
     68            while(substr($value_buff, strlen($value_buff) - 1, 1) == "\\")
    5969            {
    60                           if (substr($LinePart,0, 1) != "'")
    61                           {
    62                             $value_buff = substr($LinePart,0, strpos($LinePart,','));
    63                             $LinePart = substr($LinePart,strlen($value_buff)+1);
    64                       } else {
    65                             $LinePart = substr($LinePart,1);
    66                 $value_buff = substr($LinePart,0, strpos($LinePart,"'"));
    67                             while(substr($value_buff,strlen($value_buff)-1,1) == "\\")
    68                             {
    69                               $str = substr($LinePart,strlen($value_buff));
    70                                   $str2 = substr($str,0, strpos($str,"'",1));
    71                                   $value_buff = $value_buff.$str2;
    72                               $str = substr($str,strlen($str2));
    73                 } 
    74                             $LinePart = substr($LinePart,strlen($value_buff)+2);
    75                           }
    76                             if (($value_buff != 'null') and ($value_buff != 'NULL'))
    77                                 {
    78                                   $str = '';
    79                                   while(substr($value_buff,strlen($value_buff)-1,1) == " ")
    80                                   {
    81                                     $value_buff = substr($value_buff,0,strlen($value_buff)-1);
    82                                         $str .= ' ';
    83                               }
    84                                   $str2 = '';
    85                                   while(substr($value_buff,0,1) == " ")
    86                                   {
    87                                     $value_buff = substr($value_buff,1,strlen($value_buff)-1);
    88                                         $str2 .= ' ';
    89                               }
    90                               $Value[$column] = $str2.trim($value_buff).$str;
    91                                 } else {
    92                                   $Value[$column] = '';
    93                                 }
    94                             //  echo ($column.'-"'.$Value[$column].'"<br>');
    95                 }
     70              $str = substr($LinePart, strlen($value_buff));
     71              $str2 = substr($str, 0, strpos($str, "'", 1));
     72              $value_buff = $value_buff.$str2;
     73              $str = substr($str, strlen($str2));
     74            } 
     75            $LinePart = substr($LinePart, strlen($value_buff) + 2);
     76          }
     77          if (($value_buff != 'null') and ($value_buff != 'NULL'))
     78          {
     79            $str = '';
     80            while(substr($value_buff, strlen($value_buff) - 1,1) == " ")
     81            {
     82              $value_buff = substr($value_buff, 0, strlen($value_buff) - 1);
     83              $str .= ' ';
     84            }
     85            $str2 = '';
     86            while(substr($value_buff, 0, 1) == ' ')
     87            {
     88              $value_buff = substr($value_buff, 1, strlen($value_buff) - 1);
     89              $str2 .= ' ';
     90            }
     91            $Value[$column] = $str2.trim($value_buff).$str;
     92          } else
     93          {
     94            $Value[$column] = '';
     95          }
     96          //  echo ($column.'-"'.$Value[$column].'"<br>');
     97        }
     98     
     99        $Columns = '';
     100        foreach($Group['Items'] as $GroupItem)
     101        {
     102          $Columns .= ', '.$GroupItem['Column'].' ';
     103        }
     104        $Columns = substr($Columns, 1);
    96105
    97                         //************************************************
    98                        
    99             $Columns = '';
    100             foreach($Group['Items'] as $GroupItem)
     106        if($Group['Id'] == 8)$DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE Name="'.$Value['name'].'" AND (Language=0) ORDER BY VersionStart DESC LIMIT 1');
     107        else $DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE entry='.$Value[$Group['MangosTableIndex']].' AND (Language=0) ORDER BY VersionStart DESC LIMIT 1');
     108        if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0))
     109        {
     110          // Update existed text
     111          $DbRow2 = mysql_fetch_assoc($DbResult2);
     112          if(HaveSameText($Group, $DbRow2, $Value))
     113          {
     114            if ($DbRow2['VersionEnd'] <> $BuildNumber)
    101115            {
    102               $Columns .= ', '.$GroupItem['Column'].' ';
     116              $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET VersionEnd = "'.$BuildNumber.'" WHERE ID='.$DbRow2['ID']);
     117              echo(', ');
     118            } else echo('. ');
     119          } else
     120          {       
     121            $Columns = 'entry, language, VersionStart, VersionEnd';
     122            $Values = $DbRow2['entry'].', 0, '.$BuildNumber.', '.$BuildNumber;
     123            foreach($Group['Items'] as $GroupItem)
     124            {
     125              $Columns .= ', `'.$GroupItem['Column'].'`';
     126              $Values .= ', "'.$Value[$GroupItem['MangosColumn']].'"';
    103127            }
    104             $Columns = substr($Columns, 1);
    105128
    106             if ($Group['Id'] == 8)
    107               $DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE Name="'.$Value['name'].'" AND (Language=0) ORDER BY VersionStart DESC LIMIT 1');
    108                         else
    109               $DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE entry='.$Value[$Group['MangosTableIndex']].' AND (Language=0) ORDER BY VersionStart DESC LIMIT 1');
    110             if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0))
     129            if ($DbRow2['VersionEnd'] <> $BuildNumber)
    111130            {
    112             // Update existed text
    113               $DbRow2 = mysql_fetch_assoc($DbResult2);
    114               if(HaveSameText($Group, $DbRow2, $Value))
    115               {
    116                             if ($DbRow2['VersionEnd'] <> $BuildNumber) {
    117                   $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET VersionEnd = "'.$BuildNumber.'" WHERE ID='.$DbRow2['ID']);
    118                               echo(', ');
    119                             } else
    120                               echo('. ');
    121               } else
    122               {       
    123                 $Columns = 'entry, language, VersionStart, VersionEnd';
    124                 $Values = $DbRow2['entry'].', 0, '.$BuildNumber.', '.$BuildNumber;
    125                 foreach($Group['Items'] as $GroupItem)
    126                 {
    127                   $Columns .= ', `'.$GroupItem['Column'].'`';
    128                   $Values .= ', "'.$Value[$GroupItem['MangosColumn']].'"';
    129                 }
     131              $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')');
     132              echo('# ');
     133              WriteLog('Text <a href="form.php?group='.$Group['Id'].'&amp;ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2['entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', 11);
     134            } else echo('. ');       
     135          }       
     136        } else
     137        {
     138          // Insert new text
    130139
    131                             if ($DbRow2['VersionEnd'] <> $BuildNumber) {
    132                   $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')');
    133                               echo('# ');
    134                   WriteLog('Text <a href="form.php?group='.$Group['Id'].'&amp;ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2['entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', 11);
    135                             } else echo('. ');                         
    136               }       
    137             } else
     140          if($Group['Id'] == 8)
     141          {
     142            $Entry = 1;
     143            $DbResult = $Database->SQLCommand('SELECT MAX(`entry`) FROM `'.$Group['TablePrefix'].'`');
     144            if(mysql_num_rows($DbResult) > 0)
    138145            {
    139               // Insert new text
     146              $DbRow = mysql_fetch_row($DbResult);
     147              $Entry += $DbRow[0];
     148            }           
     149          } else {
     150            $Entry = $Value[$Group['MangosTableIndex']];
     151          }
    140152
    141               if ($Group['Id'] == 8)
    142                           {
    143                 $Entry = 1;
    144                 $DbResult = $Database->SQLCommand('SELECT MAX(`entry`) FROM `'.$Group['TablePrefix'].'`');
    145                 if(mysql_num_rows($DbResult) > 0)
    146                 {
    147                   $DbRow = mysql_fetch_row($DbResult);
    148                   $Entry += $DbRow[0];
    149                 }           
    150               } else {
    151                                 $Entry = $Value[$Group['MangosTableIndex']];
    152                           }
     153          $Columns = 'entry, language, VersionStart, VersionEnd';
     154          $Values = $Entry.', 0, '.$BuildNumber.', '.$BuildNumber;
     155          foreach($Group['Items'] as $GroupItem)
     156          {
     157            $Columns .= ', `'.$GroupItem['Column'].'`';
     158            $Values .= ', "'.$Value[$GroupItem['MangosColumn']].'"';
     159          }
     160          $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')');
     161          echo('+ ');
     162          $NewCount++;
     163          WriteLog('Text <a href="form.php?group='.$Group['Id'].'&amp;ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$Entry.') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' přidán.', 11);
     164        }         
     165        $Count++;
     166      }
     167    }
     168  }
     169  echo('<br />Celkem: '.$Count.'  Nových: '.$NewCount.'<br />');
     170  $Database->SQLCommand('UPDATE `group` SET LastVersion = "'.$BuildNumber.'", LastImport = NOW() WHERE Id='.$GroupId);
     171}
    153172
    154               $Columns = 'entry, language, VersionStart, VersionEnd';
    155               $Values = $Entry.', 0, '.$BuildNumber.', '.$BuildNumber;
    156               foreach($Group['Items'] as $GroupItem)
    157               {
    158                 $Columns .= ', `'.$GroupItem['Column'].'`';
    159                 $Values .= ', "'.$Value[$GroupItem['MangosColumn']].'"';
    160               }
    161               $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')');
    162               echo('+ ');
    163               $NewCount++;
    164               WriteLog('Text <a href="form.php?group='.$Group['Id'].'&amp;ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$Entry.') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' přidán.', 11);
    165             }                   
    166                        
    167                  //********************************************
    168             $Count++;
    169                   }
    170                 }
    171       }
    172       echo('<br />Celkem: '.$Count.'  Nových: '.$NewCount.'<br />');
    173       $Database->SQLCommand('UPDATE `group` SET LastVersion = "'.$BuildNumber.'", LastImport = NOW() WHERE Id='.$GroupId);
    174 }
    175173?>
  • trunk/import/index.php

    r226 r302  
    11<?php
    22
    3 include('../includes/global.php');
    4 include('../includes/dbc.php');
    5 include('import_lua.php');
    6 include('import_sql_mangos.php');
    7 include('import_dbc.php');
    8 include('update_version.php');
     3include_once('../includes/global.php');
     4include_once('../includes/dbc.php');
     5include_once('import_lua.php');
     6include_once('import_sql_mangos.php');
     7include_once('import_dbc.php');
     8include_once('update_version.php');
    99
    1010ShowPage();
     
    1414  echo('Nemáte oprávnění');
    1515  ShowFooter();
     16  die();
    1617}
    1718
     
    4142        foreach($tables as $table)
    4243        {
    43                   echo('<a href="?source=sql_mangos&amp;group='.$table.'">'.$TranslationTree[$table]['Name'].'</a>');   
    44                   if ($table == $tables[0]) echo(' <strong>Pracuje</strong>');
    45                   echo ('<br />');
    46                 }
    47                 echo ('<br />'); echo ('<br />');
     44      echo('<a href="?source=sql_mangos&amp;group='.$table.'">'.$TranslationTree[$table]['Name'].'</a>');
     45      if ($table == $tables[0]) echo(' <strong>Pracuje</strong>');
     46      echo ('<br />');
     47    }
     48    echo ('<br />'); echo ('<br />');
    4849        ImportSQLMangos($Config['Web']['GameVersion'], $tables[0]);
    49                 if (isset($tables[1]))
    50                 {
     50    if (isset($tables[1]))
     51    {
    5152          echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    5253          'setTimeout("parent.location.href=\''.htmlspecialchars_decode('?source=sql_mangos&amp;group='.$tables[1]).'\'", 3000)</script>');
    53                 } else {
     54    } else {
    5455          echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    5556          'setTimeout("parent.location.href=\''.htmlspecialchars_decode('?source=update_version').'\'", 3000)</script>');
    56             }
    57           } else {
     57      }
     58    } else {
    5859        foreach($tables as $table)
    5960        {
    60                   echo('<a href="?source=sql_mangos&amp;group='.$table.'">'.$TranslationTree[$table]['Name'].'</a>');   
    61                   if ($table < $_GET['group']) echo (' <strong>Hotovo</strong>');
    62                   if ($table == $_GET['group']) echo (' <strong>Pracuje</strong>');
    63                   echo ('<br />');
    64                 }
    65                 echo ('<br />'); echo ('<br />');
     61      echo('<a href="?source=sql_mangos&amp;group='.$table.'">'.$TranslationTree[$table]['Name'].'</a>');
     62      if ($table < $_GET['group']) echo (' <strong>Hotovo</strong>');
     63      if ($table == $_GET['group']) echo (' <strong>Pracuje</strong>');
     64      echo ('<br />');
     65    }
     66    echo ('<br />'); echo ('<br />');
    6667        ImportSQLMangos($Config['Web']['GameVersion'], $_GET['group']);
    67                 if (isset($tables[array_search($_GET['group'],$tables)+1]))
    68                 {
     68    if (isset($tables[array_search($_GET['group'],$tables)+1]))
     69    {
    6970          echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    7071          'setTimeout("parent.location.href=\''.htmlspecialchars_decode('?source=sql_mangos&amp;group='.$tables[array_search($_GET['group'],$tables)+1]).'\'", 3000)</script>');
    71                 } else {
     72    } else {
    7273          echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    7374          'setTimeout("parent.location.href=\''.htmlspecialchars_decode('?source=update_version').'\'", 3000)</script>');
    74             }
    75           }
     75      }
     76    }
    7677      break;
    7778    case 'dbc':
     
    8788        foreach($tables as $table)
    8889        {
    89                   echo('<a href="?source=dbc&amp;group='.$table.'">'.$TranslationTree[$table]['Name'].'</a>'); 
    90                   if ($table == $tables[0]) echo(' <strong>Pracuje</strong>');
    91                   echo ('<br />');
    92                 }
    93                 echo ('<br />'); echo ('<br />');
     90      echo('<a href="?source=dbc&amp;group='.$table.'">'.$TranslationTree[$table]['Name'].'</a>'); 
     91      if ($table == $tables[0]) echo(' <strong>Pracuje</strong>');
     92      echo ('<br />');
     93    }
     94    echo ('<br />'); echo ('<br />');
    9495        ImportDBC($Config['Web']['GameVersion'], $tables[0]);
    95                 if (isset($tables[1]))
    96                 {
     96    if (isset($tables[1]))
     97    {
    9798          echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    9899          'setTimeout("parent.location.href=\''.htmlspecialchars_decode('?source=dbc&amp;group='.$tables[1]).'\'", 3000)</script>');
    99                 } else {
     100    } else {
    100101          echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    101102          'setTimeout("parent.location.href=\''.htmlspecialchars_decode('?source=update_version').'\'", 3000)</script>');
    102             }
    103           } else {
     103      }
     104    } else {
    104105        foreach($tables as $table)
    105106        {
    106                   echo('<a href="?source=dbc&amp;group='.$table.'">'.$TranslationTree[$table]['Name'].'</a>'); 
    107                   if ($table < $_GET['group']) echo (' <strong>Hotovo</strong>');
    108                   if ($table == $_GET['group']) echo (' <strong>Pracuje</strong>');
    109                   echo ('<br />');
    110                 }
    111                 echo ('<br />'); echo ('<br />');
     107      echo('<a href="?source=dbc&amp;group='.$table.'">'.$TranslationTree[$table]['Name'].'</a>'); 
     108      if ($table < $_GET['group']) echo (' <strong>Hotovo</strong>');
     109      if ($table == $_GET['group']) echo (' <strong>Pracuje</strong>');
     110      echo ('<br />');
     111    }
     112    echo ('<br />'); echo ('<br />');
    112113        ImportDBC($Config['Web']['GameVersion'], $_GET['group']);
    113                 if (isset($tables[array_search($_GET['group'],$tables)+1]))
    114                 {
     114    if (isset($tables[array_search($_GET['group'],$tables)+1]))
     115    {
    115116          echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    116117          'setTimeout("parent.location.href=\''.htmlspecialchars_decode('?source=dbc&amp;group='.$tables[array_search($_GET['group'],$tables)+1]).'\'", 3000)</script>');
    117                 } else {
     118    } else {
    118119          echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    119120          'setTimeout("parent.location.href=\''.htmlspecialchars_decode('?source=update_version').'\'", 3000)</script>');
    120             }
    121           }
     121      }
     122    }
    122123      break;
    123124    case 'update_version':
  • trunk/includes/global.php

    r297 r302  
    5858  if(Licence(LICENCE_USER))
    5959  {
    60     $DbResult = $Database->SQLCommand('SELECT team, user FROM `user` WHERE ID='.$_SESSION['UserID']);
     60    $DbResult = $Database->SQLCommand('SELECT `team`, `user` FROM `user` WHERE ID='.$_SESSION['UserID']);
    6161    $User = mysql_fetch_assoc($DbResult);
    62     $DbResult = $Database->SQLCommand('SELECT ID, name FROM `team` WHERE ID='.$User['team']);
     62    $DbResult = $Database->SQLCommand('SELECT `Id`, `Name` FROM `Team` WHERE Id='.$User['team']);
    6363    $Team = mysql_fetch_assoc($DbResult);
    6464
  • trunk/registrace.php

    r300 r302  
    6868      <td><select name="Team"><option value="0">Žádného</option>
    6969      ');
    70     $ID = $Database->SQLCommand('SELECT name,ID FROM team');
     70    $ID = $Database->SQLCommand('SELECT `name`, `Id` FROM `Team`');
    7171    while($Line = mysql_fetch_assoc($ID))
    7272    {
    73       echo('<option value="0'.$Line['ID'].'">'.$Line['name'].'</option>');
     73      echo('<option value="0'.$Line['Id'].'">'.$Line['Name'].'</option>');
    7474      }
    7575      echo('</select></td>
  • trunk/sql/structure.sql

    r284 r302  
    44--
    55-- Počítač: localhost
    6 -- Vygenerováno: Pátek 11. prosince 2009, 11:26
    7 -- Verze MySQL: 5.0.84
    8 -- Verze PHP: 5.2.9
     6-- Vygenerováno: Pondělí 28. prosince 2009, 19:41
     7-- Verze MySQL: 5.1.41
     8-- Verze PHP: 5.3.1
    99
    1010SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
     
    2121
    2222CREATE TABLE IF NOT EXISTS `achievement` (
    23   `ID` int(11) unsigned NOT NULL auto_increment,
    24   `entry` int(11) NOT NULL,
    25   `Language` int(11) NOT NULL default '0',
     23  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     24  `entry` int(11) NOT NULL,
     25  `Language` int(11) NOT NULL DEFAULT '0',
    2626  `User` int(11) NOT NULL,
    2727  `Complete` int(11) NOT NULL,
     
    3030  `Description` text NOT NULL,
    3131  `Reward` text NOT NULL,
    32   `VersionStart` int(11) NOT NULL default '8606',
    33   `VersionEnd` int(11) NOT NULL default '8606',
    34   PRIMARY KEY  (`ID`),
    35   KEY `entry` (`entry`),
    36   KEY `User` (`User`),
    37   KEY `Take` (`Take`),
    38   KEY `Language` (`Language`),
    39   KEY `Complete` (`Complete`),
    40   KEY `VersionStart` (`VersionStart`),
    41   KEY `VersionEnd` (`VersionEnd`)
    42 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     32  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     33  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     34  PRIMARY KEY (`ID`),
     35  KEY `entry` (`entry`),
     36  KEY `User` (`User`),
     37  KEY `Take` (`Take`),
     38  KEY `Language` (`Language`),
     39  KEY `Complete` (`Complete`),
     40  KEY `VersionStart` (`VersionStart`),
     41  KEY `VersionEnd` (`VersionEnd`)
     42) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2452 ;
    4343
    4444-- --------------------------------------------------------
     
    4949
    5050CREATE TABLE IF NOT EXISTS `achievement_category` (
    51   `ID` int(11) unsigned NOT NULL auto_increment,
    52   `entry` int(11) NOT NULL,
    53   `Language` int(11) NOT NULL default '0',
     51  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     52  `entry` int(11) NOT NULL,
     53  `Language` int(11) NOT NULL DEFAULT '0',
    5454  `User` int(11) NOT NULL,
    5555  `Complete` int(11) NOT NULL,
    5656  `Take` int(11) NOT NULL,
    5757  `Name` text NOT NULL,
    58   `VersionStart` int(11) NOT NULL default '8606',
    59   `VersionEnd` int(11) NOT NULL default '8606',
    60   PRIMARY KEY  (`ID`),
    61   KEY `entry` (`entry`),
    62   KEY `User` (`User`),
    63   KEY `Take` (`Take`),
    64   KEY `Language` (`Language`),
    65   KEY `Complete` (`Complete`),
    66   KEY `VersionStart` (`VersionStart`),
    67   KEY `VersionEnd` (`VersionEnd`)
    68 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     58  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     59  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     60  PRIMARY KEY (`ID`),
     61  KEY `entry` (`entry`),
     62  KEY `User` (`User`),
     63  KEY `Take` (`Take`),
     64  KEY `Language` (`Language`),
     65  KEY `Complete` (`Complete`),
     66  KEY `VersionStart` (`VersionStart`),
     67  KEY `VersionEnd` (`VersionEnd`)
     68) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=192 ;
    6969
    7070-- --------------------------------------------------------
     
    7575
    7676CREATE TABLE IF NOT EXISTS `achievement_criteria` (
    77   `ID` int(11) unsigned NOT NULL auto_increment,
    78   `entry` int(11) NOT NULL,
    79   `Language` int(11) NOT NULL default '0',
     77  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     78  `entry` int(11) NOT NULL,
     79  `Language` int(11) NOT NULL DEFAULT '0',
    8080  `User` int(11) NOT NULL,
    8181  `Complete` int(11) NOT NULL,
    8282  `Take` int(11) NOT NULL,
    8383  `Text` text NOT NULL,
    84   `VersionStart` int(11) NOT NULL default '8606',
    85   `VersionEnd` int(11) NOT NULL default '8606',
    86   PRIMARY KEY  (`ID`),
    87   KEY `entry` (`entry`),
    88   KEY `User` (`User`),
    89   KEY `Take` (`Take`),
    90   KEY `Language` (`Language`),
    91   KEY `Complete` (`Complete`),
    92   KEY `VersionStart` (`VersionStart`),
    93   KEY `VersionEnd` (`VersionEnd`)
    94 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     84  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     85  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     86  PRIMARY KEY (`ID`),
     87  KEY `entry` (`entry`),
     88  KEY `User` (`User`),
     89  KEY `Take` (`Take`),
     90  KEY `Language` (`Language`),
     91  KEY `Complete` (`Complete`),
     92  KEY `VersionStart` (`VersionStart`),
     93  KEY `VersionEnd` (`VersionEnd`)
     94) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10075 ;
    9595
    9696-- --------------------------------------------------------
     
    101101
    102102CREATE TABLE IF NOT EXISTS `areatrigger_tavern` (
    103   `ID` int(11) unsigned NOT NULL auto_increment,
    104   `entry` int(11) NOT NULL,
    105   `Language` int(11) NOT NULL default '0',
     103  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     104  `entry` int(11) NOT NULL,
     105  `Language` int(11) NOT NULL DEFAULT '0',
    106106  `User` int(11) NOT NULL,
    107107  `Complete` int(11) NOT NULL,
    108108  `Take` int(11) NOT NULL,
    109109  `Name` text NOT NULL,
    110   `VersionStart` int(11) NOT NULL default '8606',
    111   `VersionEnd` int(11) NOT NULL default '8606',
    112   PRIMARY KEY  (`ID`),
    113   KEY `entry` (`entry`),
    114   KEY `User` (`User`),
    115   KEY `Take` (`Take`),
    116   KEY `Language` (`Language`),
    117   KEY `Complete` (`Complete`),
    118   KEY `VersionStart` (`VersionStart`),
    119   KEY `VersionEnd` (`VersionEnd`)
    120 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=72 ;
     110  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     111  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     112  PRIMARY KEY (`ID`),
     113  KEY `entry` (`entry`),
     114  KEY `User` (`User`),
     115  KEY `Take` (`Take`),
     116  KEY `Language` (`Language`),
     117  KEY `Complete` (`Complete`),
     118  KEY `VersionStart` (`VersionStart`),
     119  KEY `VersionEnd` (`VersionEnd`)
     120) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=210 ;
    121121
    122122-- --------------------------------------------------------
     
    127127
    128128CREATE TABLE IF NOT EXISTS `areatrigger_teleport` (
    129   `ID` int(11) unsigned NOT NULL auto_increment,
    130   `entry` int(11) NOT NULL,
    131   `Language` int(11) NOT NULL default '0',
     129  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     130  `entry` int(11) NOT NULL,
     131  `Language` int(11) NOT NULL DEFAULT '0',
    132132  `User` int(11) NOT NULL,
    133133  `Complete` int(11) NOT NULL,
    134134  `Take` int(11) NOT NULL,
    135135  `Name` text NOT NULL,
    136   `VersionStart` int(11) NOT NULL default '8606',
    137   `VersionEnd` int(11) NOT NULL default '8606',
    138   PRIMARY KEY  (`ID`),
    139   KEY `entry` (`entry`),
    140   KEY `User` (`User`),
    141   KEY `Take` (`Take`),
    142   KEY `Language` (`Language`),
    143   KEY `Complete` (`Complete`),
    144   KEY `VersionStart` (`VersionStart`),
    145   KEY `VersionEnd` (`VersionEnd`)
    146 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=162 ;
     136  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     137  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     138  PRIMARY KEY (`ID`),
     139  KEY `entry` (`entry`),
     140  KEY `User` (`User`),
     141  KEY `Take` (`Take`),
     142  KEY `Language` (`Language`),
     143  KEY `Complete` (`Complete`),
     144  KEY `VersionStart` (`VersionStart`),
     145  KEY `VersionEnd` (`VersionEnd`)
     146) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=442 ;
    147147
    148148-- --------------------------------------------------------
     
    155155  `DateFirst` datetime NOT NULL,
    156156  `DateLast` datetime NOT NULL,
    157   `Web` varchar(255) collate utf8_czech_ci NOT NULL,
    158   `Show` int(11) NOT NULL default '1',
    159   `Description` text collate utf8_czech_ci NOT NULL,
    160   `LastURL` varchar(255) collate utf8_czech_ci NOT NULL,
     157  `Web` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
     158  `Show` int(11) NOT NULL DEFAULT '1',
     159  `Description` text NOT NULL,
     160  `LastURL` varchar(255) NOT NULL,
    161161  UNIQUE KEY `Web` (`Web`),
    162162  KEY `Show` (`Show`)
    163 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     163) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    164164
    165165-- --------------------------------------------------------
     
    170170
    171171CREATE TABLE IF NOT EXISTS `connexion` (
    172   `Id` int(11) NOT NULL auto_increment,
     172  `Id` int(11) NOT NULL AUTO_INCREMENT,
    173173  `Name` text NOT NULL,
    174174  `Group` int(11) NOT NULL,
    175   PRIMARY KEY  (`Id`),
     175  PRIMARY KEY (`Id`),
    176176  KEY `Group` (`Group`)
    177 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     177) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1502 ;
    178178
    179179-- --------------------------------------------------------
     
    184184
    185185CREATE TABLE IF NOT EXISTS `connexion_item` (
    186   `Id` int(11) NOT NULL auto_increment,
     186  `Id` int(11) NOT NULL AUTO_INCREMENT,
    187187  `connexion` int(11) NOT NULL,
    188188  `entry` int(11) NOT NULL,
    189   PRIMARY KEY  (`Id`),
     189  PRIMARY KEY (`Id`),
    190190  KEY `connexion` (`connexion`,`entry`)
    191 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     191) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7029 ;
    192192
    193193-- --------------------------------------------------------
     
    198198
    199199CREATE TABLE IF NOT EXISTS `creature` (
    200   `ID` int(11) unsigned NOT NULL auto_increment,
     200  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    201201  `entry` int(11) NOT NULL,
    202202  `name` text NOT NULL,
    203203  `subname` text NOT NULL,
    204   `Language` int(11) NOT NULL default '0',
    205   `User` int(11) NOT NULL,
    206   `Complete` int(11) NOT NULL,
    207   `Take` int(11) NOT NULL,
    208   `VersionStart` int(11) NOT NULL default '8606',
    209   `VersionEnd` int(11) NOT NULL default '8606',
    210   PRIMARY KEY  (`ID`),
    211   KEY `entry` (`entry`),
    212   KEY `User` (`User`),
    213   KEY `Take` (`Take`),
    214   KEY `Complete` (`Complete`),
    215   KEY `Language` (`Language`),
    216   KEY `VersionStart` (`VersionStart`),
    217   KEY `VersionEnd` (`VersionEnd`)
    218 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=52811 ;
     204  `Language` int(11) NOT NULL DEFAULT '0',
     205  `User` int(11) NOT NULL,
     206  `Complete` int(11) NOT NULL,
     207  `Take` int(11) NOT NULL,
     208  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     209  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     210  PRIMARY KEY (`ID`),
     211  KEY `entry` (`entry`),
     212  KEY `User` (`User`),
     213  KEY `Take` (`Take`),
     214  KEY `Complete` (`Complete`),
     215  KEY `Language` (`Language`),
     216  KEY `VersionStart` (`VersionStart`),
     217  KEY `VersionEnd` (`VersionEnd`)
     218) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=57187 ;
    219219
    220220-- --------------------------------------------------------
     
    225225
    226226CREATE TABLE IF NOT EXISTS `dictionary` (
    227   `ID` int(11) NOT NULL auto_increment,
     227  `ID` int(11) NOT NULL AUTO_INCREMENT,
    228228  `Entry` int(11) NOT NULL,
    229229  `Text` varchar(255) NOT NULL,
     
    231231  `Description` text NOT NULL,
    232232  `User` int(11) NOT NULL,
    233   PRIMARY KEY  (`ID`),
    234   KEY `Entry` (`Entry`),
    235   KEY `Language` (`Language`)
    236 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=157 ;
     233  PRIMARY KEY (`ID`),
     234  KEY `Language` (`Language`),
     235  KEY `Entry` (`Entry`)
     236) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=411 ;
     237
     238-- --------------------------------------------------------
     239
     240--
     241-- Struktura tabulky `Export`
     242--
     243
     244CREATE TABLE IF NOT EXISTS `Export` (
     245  `Id` int(11) NOT NULL AUTO_INCREMENT,
     246  `User` int(11) NOT NULL,
     247  `TimeCreate` datetime NOT NULL,
     248  `Title` varchar(255) NOT NULL,
     249  `WithDiacritic` tinyint(1) NOT NULL,
     250  `UsedCount` int(11) NOT NULL,
     251  `ClientVersion` int(11) NOT NULL,
     252  `OutputType` int(11) NOT NULL,
     253  `Description` text NOT NULL,
     254  PRIMARY KEY (`Id`),
     255  KEY `User` (`User`),
     256  KEY `TimeCreate` (`TimeCreate`)
     257) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=24 ;
     258
     259-- --------------------------------------------------------
     260
     261--
     262-- Struktura tabulky `ExportGroup`
     263--
     264
     265CREATE TABLE IF NOT EXISTS `ExportGroup` (
     266  `Id` int(11) NOT NULL AUTO_INCREMENT,
     267  `Export` int(11) NOT NULL,
     268  `Group` int(11) NOT NULL,
     269  PRIMARY KEY (`Id`),
     270  KEY `Export` (`Export`)
     271) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=69 ;
     272
     273-- --------------------------------------------------------
     274
     275--
     276-- Struktura tabulky `ExportLanguage`
     277--
     278
     279CREATE TABLE IF NOT EXISTS `ExportLanguage` (
     280  `Id` int(11) NOT NULL AUTO_INCREMENT,
     281  `Export` int(11) NOT NULL,
     282  `Language` int(11) NOT NULL,
     283  `Sequence` int(11) NOT NULL,
     284  PRIMARY KEY (`Id`)
     285) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
     286
     287-- --------------------------------------------------------
     288
     289--
     290-- Struktura tabulky `ExportOutputType`
     291--
     292
     293CREATE TABLE IF NOT EXISTS `ExportOutputType` (
     294  `Id` int(11) NOT NULL AUTO_INCREMENT,
     295  `Name` varchar(255) NOT NULL,
     296  PRIMARY KEY (`Id`)
     297) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
     298
     299-- --------------------------------------------------------
     300
     301--
     302-- Struktura tabulky `ExportTask`
     303--
     304
     305CREATE TABLE IF NOT EXISTS `ExportTask` (
     306  `Id` int(11) NOT NULL AUTO_INCREMENT,
     307  `TimeStart` datetime NOT NULL,
     308  `TimeFinish` datetime DEFAULT NULL,
     309  `Export` int(11) NOT NULL,
     310  PRIMARY KEY (`Id`),
     311  KEY `Export` (`Export`)
     312) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
     313
     314-- --------------------------------------------------------
     315
     316--
     317-- Struktura tabulky `ExportUser`
     318--
     319
     320CREATE TABLE IF NOT EXISTS `ExportUser` (
     321  `Id` int(11) NOT NULL AUTO_INCREMENT,
     322  `Export` int(11) NOT NULL,
     323  `User` int(11) NOT NULL,
     324  `Sequence` int(11) NOT NULL,
     325  PRIMARY KEY (`Id`),
     326  KEY `Export` (`Export`),
     327  KEY `User` (`User`)
     328) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=77 ;
     329
     330-- --------------------------------------------------------
     331
     332--
     333-- Struktura tabulky `ExportVersion`
     334--
     335
     336CREATE TABLE IF NOT EXISTS `ExportVersion` (
     337  `Id` int(11) NOT NULL AUTO_INCREMENT,
     338  `ExportType` int(11) NOT NULL,
     339  `ClientVersion` int(11) NOT NULL,
     340  PRIMARY KEY (`Id`),
     341  KEY `ExportType` (`ExportType`),
     342  KEY `ClientVersion` (`ClientVersion`)
     343) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=41 ;
    237344
    238345-- --------------------------------------------------------
     
    243350
    244351CREATE TABLE IF NOT EXISTS `gameobject` (
    245   `ID` int(11) unsigned NOT NULL auto_increment,
     352  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    246353  `entry` int(11) NOT NULL,
    247354  `Name` text NOT NULL,
    248355  `castbarcaption` text NOT NULL,
    249   `Language` int(11) NOT NULL default '0',
    250   `User` int(11) NOT NULL,
    251   `Complete` int(11) NOT NULL,
    252   `Take` int(11) NOT NULL,
    253   `VersionStart` int(11) NOT NULL default '8606',
    254   `VersionEnd` int(11) NOT NULL default '8606',
    255   PRIMARY KEY  (`ID`),
    256   KEY `entry` (`entry`),
    257   KEY `User` (`User`),
    258   KEY `Take` (`Take`),
    259   KEY `Complete` (`Complete`),
    260   KEY `Language` (`Language`),
    261   KEY `VersionStart` (`VersionStart`),
    262   KEY `VersionEnd` (`VersionEnd`)
    263 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=58959 ;
     356  `Language` int(11) NOT NULL DEFAULT '0',
     357  `User` int(11) NOT NULL,
     358  `Complete` int(11) NOT NULL,
     359  `Take` int(11) NOT NULL,
     360  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     361  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     362  PRIMARY KEY (`ID`),
     363  KEY `entry` (`entry`),
     364  KEY `User` (`User`),
     365  KEY `Take` (`Take`),
     366  KEY `Complete` (`Complete`),
     367  KEY `Language` (`Language`),
     368  KEY `VersionStart` (`VersionStart`),
     369  KEY `VersionEnd` (`VersionEnd`)
     370) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=91956 ;
    264371
    265372-- --------------------------------------------------------
     
    270377
    271378CREATE TABLE IF NOT EXISTS `gametips` (
    272   `ID` int(11) unsigned NOT NULL auto_increment,
     379  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    273380  `entry` int(11) NOT NULL,
    274381  `Text` text NOT NULL,
    275   `Language` int(11) NOT NULL default '0',
    276   `User` int(11) NOT NULL,
    277   `Complete` int(11) NOT NULL,
    278   `Take` int(11) NOT NULL,
    279   `VersionStart` int(11) NOT NULL default '8606',
    280   `VersionEnd` int(11) NOT NULL default '8606',
    281   PRIMARY KEY  (`ID`),
    282   KEY `entry` (`entry`),
    283   KEY `User` (`User`),
    284   KEY `Take` (`Take`),
    285   KEY `Language` (`Language`),
    286   KEY `Complete` (`Complete`),
    287   KEY `VersionStart` (`VersionStart`),
    288   KEY `VersionEnd` (`VersionEnd`)
    289 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=262 ;
     382  `Language` int(11) NOT NULL DEFAULT '0',
     383  `User` int(11) NOT NULL,
     384  `Complete` int(11) NOT NULL,
     385  `Take` int(11) NOT NULL,
     386  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     387  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     388  PRIMARY KEY (`ID`),
     389  KEY `entry` (`entry`),
     390  KEY `User` (`User`),
     391  KEY `Take` (`Take`),
     392  KEY `Language` (`Language`),
     393  KEY `Complete` (`Complete`),
     394  KEY `VersionStart` (`VersionStart`),
     395  KEY `VersionEnd` (`VersionEnd`)
     396) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=343 ;
    290397
    291398-- --------------------------------------------------------
     
    296403
    297404CREATE TABLE IF NOT EXISTS `global_strings` (
    298   `ID` int(11) unsigned NOT NULL auto_increment,
    299   `entry` int(11) NOT NULL,
    300   `Language` int(11) NOT NULL default '0',
     405  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     406  `entry` int(11) NOT NULL,
     407  `Language` int(11) NOT NULL DEFAULT '0',
    301408  `User` int(11) NOT NULL,
    302409  `Complete` int(11) NOT NULL,
     
    305412  `Text` text NOT NULL,
    306413  `Comment` text NOT NULL,
    307   `VersionStart` int(11) NOT NULL default '8606',
    308   `VersionEnd` int(11) NOT NULL default '8606',
    309   PRIMARY KEY  (`ID`),
     414  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     415  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     416  PRIMARY KEY (`ID`),
    310417  KEY `entry` (`entry`),
    311418  KEY `User` (`User`),
     
    316423  KEY `VersionStart` (`VersionStart`),
    317424  KEY `VersionEnd` (`VersionEnd`)
    318 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8126 ;
     425) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=25831 ;
    319426
    320427-- --------------------------------------------------------
     
    325432
    326433CREATE TABLE IF NOT EXISTS `glue_strings` (
    327   `ID` int(11) unsigned NOT NULL auto_increment,
    328   `entry` int(11) NOT NULL,
    329   `Language` int(11) NOT NULL default '0',
     434  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     435  `entry` int(11) NOT NULL,
     436  `Language` int(11) NOT NULL DEFAULT '0',
    330437  `User` int(11) NOT NULL,
    331438  `Complete` int(11) NOT NULL,
     
    334441  `Text` text NOT NULL,
    335442  `Comment` text NOT NULL,
    336   `VersionStart` int(11) NOT NULL default '8606',
    337   `VersionEnd` int(11) NOT NULL default '8606',
    338   PRIMARY KEY  (`ID`),
     443  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     444  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     445  PRIMARY KEY (`ID`),
    339446  KEY `entry` (`entry`),
    340447  KEY `User` (`User`),
     
    345452  KEY `VersionStart` (`VersionStart`),
    346453  KEY `VersionEnd` (`VersionEnd`)
    347 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=773 ;
     454) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1843 ;
    348455
    349456-- --------------------------------------------------------
     
    354461
    355462CREATE TABLE IF NOT EXISTS `group` (
    356   `Id` int(11) NOT NULL auto_increment,
    357   `Name` varchar(255) collate utf8_czech_ci NOT NULL,
    358   `TablePrefix` varchar(255) collate utf8_czech_ci NOT NULL,
    359   `MangosDatabase` varchar(255) collate utf8_czech_ci NOT NULL,
    360   `MangosTable` varchar(255) collate utf8_czech_ci NOT NULL,
    361   `MangosTableIndex` varchar(255) collate utf8_czech_ci NOT NULL,
    362   `DBCFileName` varchar(255) collate utf8_czech_ci NOT NULL,
    363   `WowheadName` varchar(255) collate utf8_czech_ci NOT NULL,
    364   `LuaFileName` varchar(255) collate utf8_czech_ci NOT NULL,
    365   `LuaMPQFolder` varchar(255) collate utf8_czech_ci NOT NULL,
     463  `Id` int(11) NOT NULL AUTO_INCREMENT,
     464  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     465  `TablePrefix` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     466  `MangosDatabase` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     467  `MangosTable` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     468  `MangosTableIndex` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     469  `DBCFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     470  `DBCColumns` text COLLATE utf8_czech_ci NOT NULL,
     471  `WowheadName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     472  `LuaFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     473  `LuaMPQFolder` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    366474  `LastImport` datetime NOT NULL,
    367475  `LastVersion` int(11) NOT NULL,
    368   PRIMARY KEY  (`Id`)
     476  PRIMARY KEY (`Id`)
    369477) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=23 ;
    370478
     
    376484
    377485CREATE TABLE IF NOT EXISTS `group_item` (
    378   `Id` int(11) NOT NULL auto_increment,
     486  `Id` int(11) NOT NULL AUTO_INCREMENT,
    379487  `Group` int(11) NOT NULL,
    380   `Name` varchar(255) collate utf8_czech_ci NOT NULL,
    381   `Column` varchar(255) collate utf8_czech_ci NOT NULL,
    382   `Visible` tinyint(1) NOT NULL default '1',
    383   `MangosColumn` varchar(255) collate utf8_czech_ci NOT NULL,
    384   `AddonFileName` varchar(255) collate utf8_czech_ci NOT NULL,
    385   PRIMARY KEY  (`Id`)
     488  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     489  `Column` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     490  `Visible` tinyint(1) NOT NULL DEFAULT '1',
     491  `MangosColumn` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     492  `AddonFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     493  `DBCColumnIndex` int(11) NOT NULL DEFAULT '0',
     494  PRIMARY KEY (`Id`)
    386495) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=63 ;
    387496
     
    393502
    394503CREATE TABLE IF NOT EXISTS `item` (
    395   `ID` int(11) unsigned NOT NULL auto_increment,
     504  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    396505  `entry` int(11) NOT NULL,
    397506  `Name` text NOT NULL,
    398507  `Description` text NOT NULL,
    399   `Language` int(11) NOT NULL default '0',
    400   `User` int(11) NOT NULL,
    401   `Complete` int(11) NOT NULL,
    402   `Take` int(11) NOT NULL,
    403   `VersionStart` int(11) NOT NULL default '8606',
    404   `VersionEnd` int(11) NOT NULL default '8606',
    405   PRIMARY KEY  (`ID`),
    406   KEY `entry` (`entry`),
    407   KEY `User` (`User`),
    408   KEY `Take` (`Take`),
    409   KEY `Complete` (`Complete`),
    410   KEY `Language` (`Language`),
    411   KEY `VersionStart` (`VersionStart`),
    412   KEY `VersionEnd` (`VersionEnd`)
    413 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=63050 ;
     508  `Language` int(11) NOT NULL DEFAULT '0',
     509  `User` int(11) NOT NULL,
     510  `Complete` int(11) NOT NULL,
     511  `Take` int(11) NOT NULL,
     512  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     513  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     514  PRIMARY KEY (`ID`),
     515  KEY `entry` (`entry`),
     516  KEY `User` (`User`),
     517  KEY `Take` (`Take`),
     518  KEY `Complete` (`Complete`),
     519  KEY `Language` (`Language`),
     520  KEY `VersionStart` (`VersionStart`),
     521  KEY `VersionEnd` (`VersionEnd`)
     522) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=67080 ;
    414523
    415524-- --------------------------------------------------------
     
    420529
    421530CREATE TABLE IF NOT EXISTS `language` (
    422   `Id` int(11) NOT NULL auto_increment,
    423   `Name` varchar(255) collate utf8_czech_ci NOT NULL,
    424   `Enabled` tinyint(1) NOT NULL default '1',
    425   PRIMARY KEY  (`Id`)
     531  `Id` int(11) NOT NULL AUTO_INCREMENT,
     532  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     533  `Enabled` tinyint(1) NOT NULL DEFAULT '1',
     534  PRIMARY KEY (`Id`)
    426535) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
    427536
     
    433542
    434543CREATE TABLE IF NOT EXISTS `log` (
    435   `ID` int(11) NOT NULL auto_increment,
     544  `ID` int(11) NOT NULL AUTO_INCREMENT,
    436545  `user` int(11) NOT NULL,
    437546  `type` int(11) NOT NULL,
    438   `text` text character set latin2 collate latin2_czech_cs NOT NULL,
     547  `text` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    439548  `date` datetime NOT NULL,
    440   `IP` text character set latin2 collate latin2_czech_cs NOT NULL,
    441   PRIMARY KEY  (`ID`),
     549  `IP` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     550  PRIMARY KEY (`ID`),
    442551  KEY `user` (`user`),
    443552  KEY `type` (`type`),
    444553  KEY `date` (`date`)
    445 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=45181 ;
     554) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=429858 ;
    446555
    447556-- --------------------------------------------------------
     
    452561
    453562CREATE TABLE IF NOT EXISTS `mangos_command` (
    454   `ID` int(11) unsigned NOT NULL auto_increment,
     563  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    455564  `entry` int(11) NOT NULL,
    456565  `help` text NOT NULL,
    457   `Language` int(11) NOT NULL default '0',
     566  `Language` int(11) NOT NULL DEFAULT '0',
    458567  `User` int(11) NOT NULL,
    459568  `Complete` int(11) NOT NULL,
    460569  `Take` int(11) NOT NULL,
    461570  `Name` varchar(255) NOT NULL,
    462   `VersionStart` int(11) NOT NULL default '8606',
    463   `VersionEnd` int(11) NOT NULL default '8606',
    464   PRIMARY KEY  (`ID`),
     571  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     572  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     573  PRIMARY KEY (`ID`),
    465574  KEY `entry` (`entry`),
    466575  KEY `User` (`User`),
     
    471580  KEY `VersionStart` (`VersionStart`),
    472581  KEY `VersionEnd` (`VersionEnd`)
    473 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=297 ;
     582) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=759 ;
    474583
    475584-- --------------------------------------------------------
     
    480589
    481590CREATE TABLE IF NOT EXISTS `mangos_string` (
    482   `ID` int(11) unsigned NOT NULL auto_increment,
     591  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    483592  `entry` int(11) NOT NULL,
    484593  `content_default` text NOT NULL,
    485   `Language` int(11) NOT NULL default '0',
    486   `User` int(11) NOT NULL,
    487   `Complete` int(11) NOT NULL,
    488   `Take` int(11) NOT NULL,
    489   `VersionStart` int(11) NOT NULL default '8606',
    490   `VersionEnd` int(11) NOT NULL default '8606',
    491   PRIMARY KEY  (`ID`),
    492   KEY `entry` (`entry`),
    493   KEY `User` (`User`),
    494   KEY `Take` (`Take`),
    495   KEY `Complete` (`Complete`),
    496   KEY `Language` (`Language`),
    497   KEY `VersionStart` (`VersionStart`),
    498   KEY `VersionEnd` (`VersionEnd`)
    499 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2045 ;
     594  `Language` int(11) NOT NULL DEFAULT '0',
     595  `User` int(11) NOT NULL,
     596  `Complete` int(11) NOT NULL,
     597  `Take` int(11) NOT NULL,
     598  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     599  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     600  PRIMARY KEY (`ID`),
     601  KEY `entry` (`entry`),
     602  KEY `User` (`User`),
     603  KEY `Take` (`Take`),
     604  KEY `Complete` (`Complete`),
     605  KEY `Language` (`Language`),
     606  KEY `VersionStart` (`VersionStart`),
     607  KEY `VersionEnd` (`VersionEnd`)
     608) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2285 ;
    500609
    501610-- --------------------------------------------------------
     
    506615
    507616CREATE TABLE IF NOT EXISTS `news` (
    508   `Id` int(11) NOT NULL auto_increment,
     617  `Id` int(11) NOT NULL AUTO_INCREMENT,
    509618  `Time` datetime NOT NULL,
    510619  `User` int(11) NOT NULL,
    511620  `Text` text NOT NULL,
    512   PRIMARY KEY  (`Id`)
    513 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;
     621  PRIMARY KEY (`Id`)
     622) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;
    514623
    515624-- --------------------------------------------------------
     
    520629
    521630CREATE TABLE IF NOT EXISTS `npc` (
    522   `ID` int(11) unsigned NOT NULL auto_increment,
    523   `entry` int(11) NOT NULL,
    524   `Text0_0` text character set latin2 collate latin2_czech_cs,
    525   `Text0_1` text character set latin2 collate latin2_czech_cs,
    526   `Text1_0` text character set latin2 collate latin2_czech_cs,
    527   `Text1_1` text character set latin2 collate latin2_czech_cs,
    528   `Text2_0` text character set latin2 collate latin2_czech_cs,
    529   `Text2_1` text character set latin2 collate latin2_czech_cs,
    530   `Text3_0` text character set latin2 collate latin2_czech_cs,
    531   `Text3_1` text character set latin2 collate latin2_czech_cs,
    532   `Text4_0` text character set latin2 collate latin2_czech_cs,
    533   `Text4_1` text character set latin2 collate latin2_czech_cs,
    534   `Text5_0` text character set latin2 collate latin2_czech_cs,
    535   `Text5_1` text character set latin2 collate latin2_czech_cs,
    536   `Text6_0` text character set latin2 collate latin2_czech_cs,
    537   `Text6_1` text character set latin2 collate latin2_czech_cs,
    538   `Text7_0` text character set latin2 collate latin2_czech_cs,
    539   `Text7_1` text character set latin2 collate latin2_czech_cs,
    540   `Language` int(11) NOT NULL default '0',
    541   `User` int(11) NOT NULL,
    542   `Complete` int(11) NOT NULL,
    543   `Take` int(11) NOT NULL,
    544   `VersionStart` int(11) NOT NULL default '8606',
    545   `VersionEnd` int(11) NOT NULL default '8606',
    546   PRIMARY KEY  (`ID`),
    547   KEY `entry` (`entry`),
    548   KEY `User` (`User`),
    549   KEY `Take` (`Take`),
    550   KEY `Complete` (`Complete`),
    551   KEY `Language` (`Language`),
    552   KEY `VersionStart` (`VersionStart`),
    553   KEY `VersionEnd` (`VersionEnd`)
    554 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16779127 ;
     631  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     632  `entry` int(11) NOT NULL,
     633  `Text0_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     634  `Text0_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     635  `Text1_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     636  `Text1_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     637  `Text2_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     638  `Text2_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     639  `Text3_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     640  `Text3_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     641  `Text4_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     642  `Text4_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     643  `Text5_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     644  `Text5_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     645  `Text6_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     646  `Text6_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     647  `Text7_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     648  `Text7_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     649  `Language` int(11) NOT NULL DEFAULT '0',
     650  `User` int(11) NOT NULL,
     651  `Complete` int(11) NOT NULL,
     652  `Take` int(11) NOT NULL,
     653  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     654  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     655  PRIMARY KEY (`ID`),
     656  KEY `entry` (`entry`),
     657  KEY `User` (`User`),
     658  KEY `Take` (`Take`),
     659  KEY `Complete` (`Complete`),
     660  KEY `Language` (`Language`),
     661  KEY `VersionStart` (`VersionStart`),
     662  KEY `VersionEnd` (`VersionEnd`)
     663) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16780693 ;
    555664
    556665-- --------------------------------------------------------
     
    561670
    562671CREATE TABLE IF NOT EXISTS `npc_option` (
    563   `ID` int(11) unsigned NOT NULL auto_increment,
    564   `entry` int(11) NOT NULL,
    565   `Language` int(11) NOT NULL default '0',
     672  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     673  `entry` int(11) NOT NULL,
     674  `Language` int(11) NOT NULL DEFAULT '0',
    566675  `User` int(11) NOT NULL,
    567676  `Complete` int(11) NOT NULL,
    568677  `Take` int(11) NOT NULL,
    569678  `OptionText` text NOT NULL,
    570   `VersionStart` int(11) NOT NULL default '8606',
    571   `VersionEnd` int(11) NOT NULL default '8606',
    572   PRIMARY KEY  (`ID`),
    573   KEY `entry` (`entry`),
    574   KEY `User` (`User`),
    575   KEY `Take` (`Take`),
    576   KEY `Language` (`Language`),
    577   KEY `Complete` (`Complete`),
    578   KEY `VersionStart` (`VersionStart`),
    579   KEY `VersionEnd` (`VersionEnd`)
    580 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=50 ;
     679  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     680  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     681  PRIMARY KEY (`ID`),
     682  KEY `entry` (`entry`),
     683  KEY `User` (`User`),
     684  KEY `Take` (`Take`),
     685  KEY `Language` (`Language`),
     686  KEY `Complete` (`Complete`),
     687  KEY `VersionStart` (`VersionStart`),
     688  KEY `VersionEnd` (`VersionEnd`)
     689) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=123 ;
    581690
    582691-- --------------------------------------------------------
     
    587696
    588697CREATE TABLE IF NOT EXISTS `page` (
    589   `ID` int(11) NOT NULL auto_increment,
    590   `entry` int(11) unsigned NOT NULL default '0',
    591   `Text` text character set latin2 collate latin2_czech_cs,
     698  `ID` int(11) NOT NULL AUTO_INCREMENT,
     699  `entry` int(11) unsigned NOT NULL DEFAULT '0',
     700  `Text` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    592701  `Language` int(11) NOT NULL,
    593702  `User` int(11) NOT NULL,
    594703  `Complete` int(11) NOT NULL,
    595704  `Take` int(11) NOT NULL,
    596   `VersionStart` int(11) NOT NULL default '8606',
    597   `VersionEnd` int(11) NOT NULL default '8606',
    598   PRIMARY KEY  (`ID`),
    599   KEY `entry` (`entry`),
    600   KEY `User` (`User`),
    601   KEY `Take` (`Take`),
    602   KEY `Complete` (`Complete`),
    603   KEY `Language` (`Language`),
    604   KEY `VersionStart` (`VersionStart`),
    605   KEY `VersionEnd` (`VersionEnd`)
    606 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='Item System' AUTO_INCREMENT=1783 ;
     705  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     706  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     707  PRIMARY KEY (`ID`),
     708  KEY `entry` (`entry`),
     709  KEY `User` (`User`),
     710  KEY `Take` (`Take`),
     711  KEY `Complete` (`Complete`),
     712  KEY `Language` (`Language`),
     713  KEY `VersionStart` (`VersionStart`),
     714  KEY `VersionEnd` (`VersionEnd`)
     715) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='Item System' AUTO_INCREMENT=2400 ;
    607716
    608717-- --------------------------------------------------------
     
    613722
    614723CREATE TABLE IF NOT EXISTS `quests` (
    615   `ID` int(11) NOT NULL auto_increment,
    616   `entry` int(11) NOT NULL default '0',
    617   `Title` text character set latin2 collate latin2_czech_cs NOT NULL,
    618   `Details` text character set latin2 collate latin2_czech_cs NOT NULL,
    619   `Objectives` text character set latin2 collate latin2_czech_cs NOT NULL,
    620   `OfferRewardText` text character set latin2 collate latin2_czech_cs NOT NULL,
    621   `RequestItemsText` text character set latin2 collate latin2_czech_cs NOT NULL,
    622   `EndText` text character set latin2 collate latin2_czech_cs NOT NULL,
    623   `ObjectiveText1` text character set latin2 collate latin2_czech_cs NOT NULL,
    624   `ObjectiveText2` text character set latin2 collate latin2_czech_cs NOT NULL,
    625   `ObjectiveText3` text character set latin2 collate latin2_czech_cs NOT NULL,
    626   `ObjectiveText4` text character set latin2 collate latin2_czech_cs NOT NULL,
    627   `Language` int(11) NOT NULL default '1',
    628   `User` int(11) NOT NULL,
    629   `Complete` int(11) NOT NULL default '1',
    630   `Take` int(11) NOT NULL,
    631   `VersionStart` int(11) NOT NULL default '8606',
    632   `VersionEnd` int(11) NOT NULL default '8606',
    633   PRIMARY KEY  (`ID`),
     724  `ID` int(11) NOT NULL AUTO_INCREMENT,
     725  `entry` int(11) NOT NULL DEFAULT '0',
     726  `Title` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     727  `Details` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     728  `Objectives` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     729  `OfferRewardText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     730  `RequestItemsText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     731  `EndText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     732  `ObjectiveText1` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     733  `ObjectiveText2` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     734  `ObjectiveText3` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     735  `ObjectiveText4` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     736  `Language` int(11) NOT NULL DEFAULT '1',
     737  `User` int(11) NOT NULL,
     738  `Complete` int(11) NOT NULL DEFAULT '1',
     739  `Take` int(11) NOT NULL,
     740  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     741  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     742  PRIMARY KEY (`ID`),
    634743  KEY `entry` (`entry`),
    635744  KEY `User` (`User`),
     
    638747  KEY `VersionStart` (`VersionStart`),
    639748  KEY `VersionEnd` (`VersionEnd`)
    640 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10862 ;
     749) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=13648 ;
    641750
    642751-- --------------------------------------------------------
     
    647756
    648757CREATE TABLE IF NOT EXISTS `sd2_eventai_texts` (
    649   `ID` int(11) unsigned NOT NULL auto_increment,
     758  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    650759  `entry` int(11) NOT NULL,
    651760  `content_default` text NOT NULL,
    652761  `comment` text NOT NULL,
    653   `Language` int(11) NOT NULL default '0',
    654   `User` int(11) NOT NULL,
    655   `Complete` int(11) NOT NULL,
    656   `Take` int(11) NOT NULL,
    657   `VersionStart` int(11) NOT NULL default '8606',
    658   `VersionEnd` int(11) NOT NULL default '8606',
    659   PRIMARY KEY  (`ID`),
    660   KEY `entry` (`entry`),
    661   KEY `User` (`User`),
    662   KEY `Take` (`Take`),
    663   KEY `Complete` (`Complete`),
    664   KEY `Language` (`Language`),
    665   KEY `VersionStart` (`VersionStart`),
    666   KEY `VersionEnd` (`VersionEnd`)
    667 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=413 ;
     762  `Language` int(11) NOT NULL DEFAULT '0',
     763  `User` int(11) NOT NULL,
     764  `Complete` int(11) NOT NULL,
     765  `Take` int(11) NOT NULL,
     766  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     767  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     768  PRIMARY KEY (`ID`),
     769  KEY `entry` (`entry`),
     770  KEY `User` (`User`),
     771  KEY `Take` (`Take`),
     772  KEY `Complete` (`Complete`),
     773  KEY `Language` (`Language`),
     774  KEY `VersionStart` (`VersionStart`),
     775  KEY `VersionEnd` (`VersionEnd`)
     776) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=767 ;
    668777
    669778-- --------------------------------------------------------
     
    674783
    675784CREATE TABLE IF NOT EXISTS `sd2_script_texts` (
    676   `ID` int(11) unsigned NOT NULL auto_increment,
     785  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    677786  `entry` int(11) NOT NULL,
    678787  `content_default` text NOT NULL,
    679788  `comment` text NOT NULL,
    680   `Language` int(11) NOT NULL default '0',
    681   `User` int(11) NOT NULL,
    682   `Complete` int(11) NOT NULL,
    683   `Take` int(11) NOT NULL,
    684   `VersionStart` int(11) NOT NULL default '8606',
    685   `VersionEnd` int(11) NOT NULL default '8606',
    686   PRIMARY KEY  (`ID`),
    687   KEY `entry` (`entry`),
    688   KEY `User` (`User`),
    689   KEY `Take` (`Take`),
    690   KEY `Complete` (`Complete`),
    691   KEY `Language` (`Language`),
    692   KEY `VersionStart` (`VersionStart`),
    693   KEY `VersionEnd` (`VersionEnd`)
    694 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1149 ;
     789  `Language` int(11) NOT NULL DEFAULT '0',
     790  `User` int(11) NOT NULL,
     791  `Complete` int(11) NOT NULL,
     792  `Take` int(11) NOT NULL,
     793  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     794  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     795  PRIMARY KEY (`ID`),
     796  KEY `entry` (`entry`),
     797  KEY `User` (`User`),
     798  KEY `Take` (`Take`),
     799  KEY `Complete` (`Complete`),
     800  KEY `Language` (`Language`),
     801  KEY `VersionStart` (`VersionStart`),
     802  KEY `VersionEnd` (`VersionEnd`)
     803) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1965 ;
    695804
    696805-- --------------------------------------------------------
     
    701810
    702811CREATE TABLE IF NOT EXISTS `shoutbox` (
    703   `ID` int(11) NOT NULL auto_increment,
    704   `user` text character set latin2 collate latin2_czech_cs NOT NULL,
    705   `text` text character set latin2 collate latin2_czech_cs NOT NULL,
     812  `ID` int(11) NOT NULL AUTO_INCREMENT,
     813  `user` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     814  `text` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    706815  `date` datetime NOT NULL,
    707   `IP` text character set latin2 collate latin2_czech_cs NOT NULL,
    708   PRIMARY KEY  (`ID`)
    709 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=460 ;
     816  `IP` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     817  PRIMARY KEY (`ID`)
     818) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1059 ;
    710819
    711820-- --------------------------------------------------------
     
    716825
    717826CREATE TABLE IF NOT EXISTS `spell` (
    718   `ID` int(11) unsigned NOT NULL auto_increment,
     827  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    719828  `entry` int(11) NOT NULL,
    720829  `Name` text NOT NULL,
     
    722831  `ToolTip` text NOT NULL,
    723832  `Rank` text NOT NULL,
    724   `Language` int(11) NOT NULL default '0',
    725   `User` int(11) NOT NULL,
    726   `Complete` int(11) NOT NULL,
    727   `Take` int(11) NOT NULL,
    728   `VersionStart` int(11) NOT NULL default '8606',
    729   `VersionEnd` int(11) NOT NULL default '8606',
    730   PRIMARY KEY  (`ID`),
    731   KEY `entry` (`entry`),
    732   KEY `User` (`User`),
    733   KEY `Take` (`Take`),
    734   KEY `Language` (`Language`),
    735   KEY `Complete` (`Complete`),
    736   KEY `VersionStart` (`VersionStart`),
    737   KEY `VersionEnd` (`VersionEnd`)
    738 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=42268 ;
    739 
    740 -- --------------------------------------------------------
    741 
    742 --
    743 -- Struktura tabulky `tasks`
    744 --
    745 
    746 CREATE TABLE IF NOT EXISTS `tasks` (
    747   `id` int(11) NOT NULL auto_increment,
    748   `User` int(11) NOT NULL,
    749   `ExportSetting` text NOT NULL,
    750   `Active` int(11) NOT NULL default '1',
    751   `Downloaded` int(11) NOT NULL default '0',
    752   `Date` datetime NOT NULL,
    753   PRIMARY KEY  (`id`),
    754   KEY `User` (`User`)
    755 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
     833  `Language` int(11) NOT NULL DEFAULT '0',
     834  `User` int(11) NOT NULL,
     835  `Complete` int(11) NOT NULL,
     836  `Take` int(11) NOT NULL,
     837  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     838  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     839  PRIMARY KEY (`ID`),
     840  KEY `entry` (`entry`),
     841  KEY `User` (`User`),
     842  KEY `Take` (`Take`),
     843  KEY `Language` (`Language`),
     844  KEY `Complete` (`Complete`),
     845  KEY `VersionStart` (`VersionStart`),
     846  KEY `VersionEnd` (`VersionEnd`)
     847) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=63528 ;
    756848
    757849-- --------------------------------------------------------
     
    762854
    763855CREATE TABLE IF NOT EXISTS `team` (
    764   `ID` int(11) NOT NULL auto_increment,
    765   `name` text character set utf8 collate utf8_czech_ci NOT NULL,
    766   `description` text character set utf8 collate utf8_czech_ci NOT NULL,
    767   PRIMARY KEY  (`ID`)
    768 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
     856  `ID` int(11) NOT NULL AUTO_INCREMENT,
     857  `name` text CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
     858  `description` text CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
     859  PRIMARY KEY (`ID`)
     860) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=33 ;
    769861
    770862-- --------------------------------------------------------
     
    775867
    776868CREATE TABLE IF NOT EXISTS `transports` (
    777   `ID` int(11) unsigned NOT NULL auto_increment,
    778   `entry` int(11) NOT NULL,
    779   `Language` int(11) NOT NULL default '0',
     869  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     870  `entry` int(11) NOT NULL,
     871  `Language` int(11) NOT NULL DEFAULT '0',
    780872  `User` int(11) NOT NULL,
    781873  `Complete` int(11) NOT NULL,
    782874  `Take` int(11) NOT NULL,
    783875  `Name` text NOT NULL,
    784   `VersionStart` int(11) NOT NULL default '8606',
    785   `VersionEnd` int(11) NOT NULL default '8606',
    786   PRIMARY KEY  (`ID`),
    787   KEY `entry` (`entry`),
    788   KEY `User` (`User`),
    789   KEY `Take` (`Take`),
    790   KEY `Language` (`Language`),
    791   KEY `Complete` (`Complete`),
    792   KEY `VersionStart` (`VersionStart`),
    793   KEY `VersionEnd` (`VersionEnd`)
    794 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
     876  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     877  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     878  PRIMARY KEY (`ID`),
     879  KEY `entry` (`entry`),
     880  KEY `User` (`User`),
     881  KEY `Take` (`Take`),
     882  KEY `Language` (`Language`),
     883  KEY `Complete` (`Complete`),
     884  KEY `VersionStart` (`VersionStart`),
     885  KEY `VersionEnd` (`VersionEnd`)
     886) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=41 ;
    795887
    796888-- --------------------------------------------------------
     
    801893
    802894CREATE TABLE IF NOT EXISTS `user` (
    803   `ID` int(11) NOT NULL auto_increment,
    804   `user` varchar(64) character set latin2 collate latin2_czech_cs NOT NULL,
    805   `pass` text character set latin2 collate latin2_czech_cs NOT NULL,
    806   `gm` int(11) NOT NULL default '0',
    807   `LastIP` text character set latin2 collate latin2_czech_cs NOT NULL,
    808   `LastLogin` datetime NOT NULL default '0000-00-00 00:00:00',
    809   `LastLogout` datetime default NULL,
    810   `Email` text character set latin2 collate latin2_czech_cs NOT NULL,
    811   `Language` int(11) NOT NULL default '1',
    812   `ExportSetting` text collate utf8_czech_ci NOT NULL,
     895  `ID` int(11) NOT NULL AUTO_INCREMENT,
     896  `user` varchar(64) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     897  `pass` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     898  `gm` int(11) NOT NULL DEFAULT '0',
     899  `LastIP` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     900  `LastLogin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     901  `LastLogout` datetime DEFAULT NULL,
     902  `Email` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     903  `Language` int(11) NOT NULL DEFAULT '1',
    813904  `XP` int(11) NOT NULL,
    814905  `NeedUpdate` int(11) NOT NULL,
    815906  `team` int(11) NOT NULL,
    816907  `redirecting` int(11) NOT NULL,
    817   PRIMARY KEY  (`ID`),
     908  PRIMARY KEY (`ID`),
    818909  KEY `team` (`team`),
    819910  KEY `user` (`user`)
    820 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=564 ;
     911) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=827 ;
    821912
    822913-- --------------------------------------------------------
     
    827918
    828919CREATE TABLE IF NOT EXISTS `verseclient` (
    829   `ID` int(11) NOT NULL auto_increment,
    830   `verse` text collate utf8_czech_ci NOT NULL,
     920  `ID` int(11) NOT NULL AUTO_INCREMENT,
     921  `verse` text COLLATE utf8_czech_ci NOT NULL,
    831922  `date` datetime NOT NULL,
    832   `text` text collate utf8_czech_ci NOT NULL,
     923  `text` text COLLATE utf8_czech_ci NOT NULL,
    833924  `user` int(11) NOT NULL,
    834   PRIMARY KEY  (`ID`),
     925  PRIMARY KEY (`ID`),
    835926  KEY `user` (`user`)
    836 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=2 ;
     927) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
    837928
    838929-- --------------------------------------------------------
     
    843934
    844935CREATE TABLE IF NOT EXISTS `wow_client_version` (
    845   `Id` int(11) NOT NULL auto_increment,
     936  `Id` int(11) NOT NULL AUTO_INCREMENT,
    846937  `Version` varchar(16) NOT NULL,
    847938  `BuildNumber` int(11) NOT NULL,
     
    863954  `Achievement_Category_Name` int(11) NOT NULL,
    864955  `Achievement_Criteria_Text` int(11) NOT NULL,
    865   PRIMARY KEY  (`Id`)
    866 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=75 ;
     956  PRIMARY KEY (`Id`),
     957  KEY `BuildNumber` (`BuildNumber`),
     958  KEY `Version` (`Version`),
     959  KEY `ReleaseDate` (`ReleaseDate`)
     960) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=79 ;
  • trunk/team.php

    r292 r302  
    1010 
    1111  echo('<h3>Seznam překladatelských týmů</h3>');
    12 
    13   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `team`');
     12  echo('Týmy jsou seskupení překladatelů, kteří se hlásí k něčemu společnému jako např. WoW serveru, způsobu překladu, ke stejnému hernímu spolku, aj. Být členem týmu samo o sobě nemá žádný zásadní důsledek a spíše to může pomoci se lépe orientovat mezi překladateli někomu, kdo sestavuje export.<br/>');
     13  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team`');
    1414  $DbRow = mysql_fetch_row($DbResult);
    1515  $PageList = GetPageList($DbRow[0]);   
     
    1919
    2020  $TableColumns = array(
    21     array('Name' => 'name', 'Title' => 'Jméno'),
    22     array('Name' => 'numberuser', 'Title' => 'Počet členů'),
     21    array('Name' => 'Name', 'Title' => 'Jméno'),
     22    array('Name' => 'URL', 'Title' => 'Webové stránky'),
     23    array('Name' => 'LeaderName', 'Title' => 'Vedoucí'),
     24    array('Name' => 'NumberUser', 'Title' => 'Počet členů'),
     25    array('Name' => 'TimeCreate', 'Title' => 'Datum založení'),
    2326  );
    2427  if(Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Uživatelské akce');
    2528
    26   $Order = GetOrderTableHeader($TableColumns, 'numberuser', 1);
     29  $Order = GetOrderTableHeader($TableColumns, 'NumberUser', 1);
    2730  echo($Order['Output']);
    2831
     
    4346    */
    4447
    45     $ID = $Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM user WHERE user.team = team.ID) AS numberuser FROM team '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']);
    46     while($Line = mysql_fetch_assoc($ID))
     48    $ID = $Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `user` WHERE `user`.`team` = `Team`.`Id`) AS `NumberUser`, (SELECT `user` FROM `user` WHERE `user`.`ID`=`Team`.`Leader`) AS `LeaderName` FROM `Team` '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']);
     49    while($Team = mysql_fetch_assoc($ID))
    4750    {
    4851      echo('<tr>'.
    49         '<td><a href="?action=team&amp;id='.$Line['ID'].'">'.$Line['name'].'</a></td>'.
    50         '<td><a href="userlist.php?team='.$Line['ID'].'" title="Zobrazit členy týmu">'.$Line['numberuser'].'</a></td>');
    51       if(Licence(LICENCE_USER)) echo ('<td><a href="?action=gointeam&amp;id='.$Line['ID'].'">Vstoupit do týmu</a></td>');
     52        '<td><a href="?action=team&amp;id='.$Team['Id'].'">'.$Team['Name'].'</a></td>'.
     53        '<td><a href="http://'.$Team['URL'].'">'.$Team['URL'].'</a></td>'.
     54        '<td>'.$Team['LeaderName'].'</td>'.
     55        '<td><a href="userlist.php?team='.$Team['Id'].'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a></td>'.
     56        '<td>'.HumanDate($Team['TimeCreate']).'</td>');
     57      if(Licence(LICENCE_USER))
     58      {
     59        if($Team['Leader'] == $_SESSION['UserID']) $Action = ' <a href="?action=modify&amp;id='.$Team['Id'].'">Upravit</a>';
     60          else $Action = '';
     61        echo('<td><a href="?action=gointeam&amp;id='.$Team['Id'].'">Vstoupit</a>'.$Action.'</td>');
     62      }
    5263    echo('</tr>');
    5364    }
     
    6677      if(array_key_exists('id', $_GET))
    6778      {
    68         $ID = $Database->SQLCommand('UPDATE user SET team = '.$_GET['id'].' WHERE ID = '.$_SESSION['UserID']);
     79        $ID = $Database->SQLCommand('UPDATE `user` SET `team` = '.$_GET['id'].' WHERE `ID` = '.$_SESSION['UserID']);
    6980        echo('<strong>Vstoupil jsi do týmu</strong><br /><br />');   
    7081        WriteLog('Uživatel vstoupil do týmu '.$_GET['id'], 3);
    7182
    7283        // Delete all teams without users
    73         $Database->SQLCommand('DELETE FROM `team` WHERE (SELECT COUNT(*) FROM user WHERE user.team = team.ID) = 0');   
     84        $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `user` WHERE `user`.`team` = `Team`.`Id`) = 0');   
    7485       
    7586        ShowTeamList();
     
    8192    if(Licence(LICENCE_USER))
    8293    {   
    83       if(array_key_exists('name', $_POST) and array_key_exists('description', $_POST))
    84       {
    85         $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `team` WHERE `name` = "'.trim($_POST['name']).'"'); 
     94      if(array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST))
     95      {
     96        $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE `Name` = "'.trim($_POST['Name']).'"'); 
    8697        $DbRow = mysql_fetch_row($DbResult);
    8798        $Count = $DbRow[0];
    88         if($Count == 0)
     99        if(($Count == 0) and ($_POST['Name'] != ''))
    89100        {
    90           $ID = $Database->SQLCommand('INSERT INTO `team` (`name` ,`description` ) VALUES ( \''.trim($_POST['name']).'\', \''.trim($_POST['description']).'\');'); 
    91           $Database->SQLCommand('UPDATE user SET team = '.mysql_insert_id().' WHERE ID = '.$_SESSION['UserID']);
     101          $ID = $Database->SQLCommand('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`,`Leader`) VALUES ("'.trim($_POST['Name']).'", "'.trim($_POST['Description']).'", "'.$_POST['URL'].'", NOW(), '.$_SESSION['UserID'].')'); 
     102          $Database->SQLCommand('UPDATE `user` SET `team` = '.mysql_insert_id().' WHERE `ID` = '.$_SESSION['UserID']);
    92103          echo('<strong>Překladatelský tým vytvořen</strong><br /><br />');
    93           WriteLog('Překladatelský tým vytvořen '.$_POST['name'], 3);
     104          WriteLog('Překladatelský tým vytvořen '.$_POST['Name'], 3);
    94105
    95106          // Delete all teams without users
    96           $Database->SQLCommand('DELETE FROM `team` WHERE (SELECT COUNT(*) FROM user WHERE user.team = team.ID) = 0');   
     107          $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `user` WHERE `user`.`team` = `Team`.`Id`) = 0');   
    97108        } else echo('Již existuje tým se stejným jménem');
    98109      } else echo('Chybí údaje formuláře');
     
    100111    ShowTeamList();
    101112  } else
     113  if($_GET['action'] == 'modify')
     114  {
     115    if(Licence(LICENCE_USER))
     116    {   
     117      if(array_key_exists('id', $_GET))
     118      {
     119        $DbResult = $Database->SQLCommand('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$_SESSION['UserID']);
     120        if(mysql_num_rows($DbResult) > 0)
     121        {
     122          $Team = mysql_fetch_assoc($DbResult);
     123          echo('<form action="?action=finish_modify&amp;id='.$_GET['id'].'" method="post">'.
     124      '<fieldset><legend>Nastavení týmu</legend>'.
     125      '<table><tr><td>Jméno:</td><td><input type="text" name="Name" value="'.$Team['Name'].'"/></td></tr>'.
     126      '<tr><td>Webové stránky:</td><td>http://<input type="text" name="URL" value="'.$Team['URL'].'"/></td></tr>'.
     127      '<tr><td>Popis:</td><td><input type="text" name="Description" value="'.$Team['Description'].'"/></td></tr>'.
     128      '<tr><td colspan="2"><input type="submit" value="Uložit" /></td></tr>'.
     129      '</table></fieldset></form>');
     130        } else echo('Tým nenalezen nebo nemáte oprávnění');
     131      } else echo('Nezadáno id týmu');
     132    } else echo('Nemáte oprávnění');
     133  } else
     134  if($_GET['action'] == 'finish_modify')
     135  {
     136    if(Licence(LICENCE_USER))
     137    {   
     138      if(array_key_exists('id', $_GET) and array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST) and array_key_exists('URL', $_POST))
     139      {
     140        $DbResult = $Database->SQLCommand('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$_SESSION['UserID']);
     141        if(mysql_num_rows($DbResult) > 0)
     142        {
     143          $Team = mysql_fetch_assoc($DbResult);
     144          $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE `Name` = "'.trim($_POST['Name']).'"'); 
     145          $DbRow = mysql_fetch_row($DbResult);
     146          $Count = $DbRow[0];
     147          if(($Count == 0) and ($_POST['Name'] != ''))
     148          {         
     149            $Database->SQLCommand('UPDATE `Team` SET `Name`="'.$_POST['Name'].'", `Description`="'.$_POST['Description'].'", `URL`="'.$_POST['URL'].'" WHERE Id='.$Team['Id']);
     150            echo('Nastavení týmu uloženo.<br/>');
     151            WriteLog('Překladatelský tým upraven '.$_POST['Name'], 3);
     152          } else echo('Již existuje tým se stejným jménem');
     153        } else echo('Tým nenalezen nebo nemáte oprávnění');
     154      } else echo('Nezadáno id týmu nebo některé položky formuláře');
     155    } else echo('Nemáte oprávnění');
     156    ShowTeamList();
     157  } else
    102158  if($_GET['action'] == 'create')
    103159  {
     
    106162      echo('<form action="?action=finish_create" method="post">'.
    107163      '<fieldset><legend>Vytvoření nového týmu</legend>'.
    108       '<table><tr><td>Jméno:</td><td><input type="text" name="name" /></td></tr>'.
    109       '<tr><td>Popis:</td><td><input type="text" name="description" /></td></tr>'.
     164      '<table><tr><td>Jméno:</td><td><input type="text" name="Name" /></td></tr>'.
     165      '<tr><td>Webové stránky:</td><td>http://<input type="text" name="URL" value=""/></td></tr>'.
     166      '<tr><td>Popis:</td><td><input type="text" name="Description" /></td></tr>'.
    110167      '<tr><td colspan="2"><input type="submit" value="Vytvořit a vstoupit" /></td></tr>'.
    111168      '</table></fieldset></form>');
     
    126183      }
    127184     
    128       $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT *,(SELECT count(*) FROM user WHERE team = team.ID) as numberuser, (SELECT sum('.substr($Columns, 0, -3).') FROM user '.$Joins.' WHERE team = team.ID) as NumberTranslate FROM team WHERE ID='.$_GET['id']));
     185      $Team = mysql_fetch_assoc($Database->SQLCommand('SELECT *, (SELECT count(*) FROM `user` WHERE `team` = `Team`.`Id`) as `NumberUser`, (SELECT SUM('.substr($Columns, 0, -3).') FROM user '.$Joins.' WHERE `team` = `Team`.`Id`) as `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id']));
     186      $DbResult = $Database->SQLCommand('SELECT user FROM user WHERE ID='.$Team['Leader']);
     187      if(mysql_num_rows($DbResult) > 0) $Leader = mysql_fetch_assoc($DbResult);
     188        else $Leader = '';
    129189   
    130      echo('<strong>Překladatelský tým '.$Line['name'].'</strong><br />'.
    131       $Line['description'].'<br /><br />'.
    132         '<a href="export/?team='.$_GET['id'].'">Exportovat překlad týmu</a> ');
    133       if(Licence(LICENCE_USER)) echo('<a href="?action=gointeam&amp;id='.$Line['ID'].'">Vstoupit do týmu</a><br /><br />');
     190      echo('<strong>Překladatelský tým '.$Team['Name'].'</strong><br />'.
     191     'Webové stránky: <a href="http://'.$Team['URL'].'">'.$Team['URL'].'</a><br/>'.
     192     'Vedoucí: '.$Leader.'<br/>'.
     193      $Team['Description'].'<br /><br />'.
     194        '<a href="export/?team='.$Team['Id'].'">Exportovat překlad týmu</a> ');
     195      if(Licence(LICENCE_USER)) echo('<a href="?action=gointeam&amp;id='.$Team['Id'].'">Vstoupit do týmu</a><br /><br />');
    134196      echo('<fieldset><legend>Statistika</legend>'.
    135       'Počet členů týmu: <a href="userlist.php?team='.$Line['ID'].'" title="Zobrazit členy týmu">'.$Line['numberuser'].'</a><br />'.
    136       'Počet přeložených textů týmu: <strong>'.$Line['NumberTranslate'].'</strong><br />'.
    137       'Průměrná úroveň překladatelů v týmu: <img src="tmp/team/'.$Line['name'].'/level.png" /><br /><br />'.
     197      'Počet členů týmu: <a href="userlist.php?team='.$Team['Id'].'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a><br />'.
     198      'Počet přeložených textů týmu: <strong>'.$Team['NumberTranslate'].'</strong><br />'.
     199      'Průměrná úroveň překladatelů v týmu: <img src="tmp/team/'.$Team['Name'].'/level.png" /><br /><br />'.
    138200      '<strong>Stav dokončení pro tým:</strong><br />');
    139201      foreach($TranslationTree as $Group)
    140202        if($Group['TablePrefix'] != '')
    141           echo('<div class="state-image"><img alt="'.$Group['TablePrefix'].'" src="img_statistic.php?group='.$Group['Id'].'&amp;team='.$_GET['id'].'" title="statistika překladů '.$Group['Name'].'"/></div>');
     203          echo('<div class="state-image"><img alt="'.$Group['TablePrefix'].'" src="img_statistic.php?group='.$Group['Id'].'&amp;team='.$Team['Id'].'" title="statistika překladů '.$Group['Name'].'"/></div>');
    142204      echo('</fieldset>');   
    143205    } else echo('Musíte zadat id týmu');
Note: See TracChangeset for help on using the changeset viewer.