Changeset 365 for trunk


Ignore:
Timestamp:
Mar 9, 2010, 11:29:05 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Jména tabulek v databází upraveny na stejná s prvními velkými písmeny.
  • Upraveno: Doplněny SQL uvozovky do mnoha SQL dotazů.
Location:
trunk
Files:
1 added
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Options.php

    r357 r365  
    1717    $redirecting = $_POST['redirecting'];
    1818
    19    // $Line = mysql_fetch_assoc($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID']));
    2019    if(($_SESSION['Pass'] == $OldPass) and ($NewPass == $NewPass2))
    2120    {
    2221      // Update password
    2322      $Salt = GetPasswordSalt();
    24       $Database->SQLCommand('UPDATE user SET pass = sha1(CONCAT(sha1("'.$NewPass.'"), "'.$Salt.'")), Salt="'.$Salt.'" WHERE ID = '.$_SESSION['UserID']);
     23      $Database->SQLCommand('UPDATE `User` SET `Pass` = sha1(CONCAT(sha1("'.$NewPass.'"), "'.$Salt.'")), `Salt`="'.$Salt.'" WHERE `ID` = '.$_SESSION['UserID']);
    2524      echo('Heslo změněno!<br />');
    2625    } else echo('<br />Hesla se neshodují!<br />');
    2726   
    28     $Database->SQLCommand('UPDATE user SET Email = "'.$Email.'", Language = "'.$Language.'", redirecting = "'.$redirecting.'" WHERE ID = '.$_SESSION['UserID']);
     27    $Database->SQLCommand('UPDATE `User` SET `Email` = "'.$Email.'", `Language` = "'.$Language.'", `Redirecting` = "'.$redirecting.'" WHERE `ID` = '.$_SESSION['UserID']);
    2928    echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User.'</b><br />');
    3029    WriteLog('Úprava nastavení!', LOG_TYPE_USER);
    3130  } else
    3231  {
    33     $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM user WHERE ID = '.$_SESSION['UserID']));   
     32    $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID']));   
    3433    echo('<form action="Options.php" method="post">
    3534  <fieldset><legend>Nastavení uživatele</legend>
     
    8685    {
    8786      echo('<option value="'.$LineTeam['Id'].'"');
    88       if ($LineTeam['Id'] == $Line['team']) echo(' selected="selected"');
     87      if ($LineTeam['Id'] == $Line['Team']) echo(' selected="selected"');
    8988        echo('>'.$LineTeam['Name'].'</option>');
    9089    }   
  • trunk/TranslationList.php

    r322 r365  
    88 
    99  // Get total item count
    10   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS T');
     10  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `T`');
    1111  $DbRow = mysql_fetch_row($DbResult);
    1212  $PageList = GetPageList($DbRow[0]);   
     
    1616  $TableColumns = array(
    1717    array('Name' => 'ID', 'Title' => 'Pořadové číslo'),
    18     array('Name' => 'entry', 'Title' => 'Identifikační číslo'),
     18    array('Name' => 'Entry', 'Title' => 'Identifikační číslo'),
    1919    array('Name' => $TranslationTree[$GroupId]['Items'][0]['Column'], 'Title' => 'Název'),
    2020    array('Name' => 'VersionStart', 'Title' => 'Verze'),
     
    3131  while($Line = mysql_fetch_assoc($DbResult))
    3232  {
    33     echo('<tr><td><a href="form.php?group='.$GroupId.'&amp;ID='.$Line['ID'].'">'.$Line['ID'].'</a></td><td>'.$Line['entry'].'</td>'.
     33    echo('<tr><td><a href="form.php?group='.$GroupId.'&amp;ID='.$Line['ID'].'">'.$Line['ID'].'</a></td><td>'.$Line['Entry'].'</td>'.
    3434      '<td>'.htmlspecialchars($Line[$TranslationTree[$GroupId]['Items'][0]['Column']]).'</td>'.
    3535      '<td>'.GetVersionWOW($Line['VersionStart']).'-'.GetVersionWOW($Line['VersionEnd']).'</td>');
     
    5151  '<strong>Vypsání nepřeložených textů s limitem na stránku</strong><br /><br />');
    5252
    53   WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0) AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.`entry` = `items`.`entry`) AND (`sub`.`Complete`=1) AND (`sub`.`VersionStart` = `items`.`VersionStart`) AND (`sub`.`VersionEnd` = `items`.`VersionEnd`))');
     53  WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0) AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.`Entry` = `items`.`Entry`) AND (`sub`.`Complete`=1) AND (`sub`.`VersionStart` = `items`.`VersionStart`) AND (`sub`.`VersionEnd` = `items`.`VersionEnd`))');
    5454}
    5555
     
    6060  if(array_key_exists('connexion_id', $_GET)) $_SESSION['connexion_id'] = $_GET['connexion_id'];
    6161
    62  //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1)
    6362  $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT `Name` FROM `connexion` WHERE `Id` = '.$_SESSION['connexion_id']));
    6463    echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> ->
     
    6665        <strong>Vypsání souvislostí ze skupiny '.$Line['Name'].'</strong><br /><br />');
    6766
    68    WriteQuests('SELECT *, (SELECT `sub`.`User` FROM `'.$Table.'` AS `sub` WHERE (`sub`.`entry` = `'.$Table.'`.`entry`) AND (`Language` <> 0) LIMIT 1) AS `UserID`, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `UserID`) AS `UserName` FROM `'.$Table.'` WHERE (`Language` = 0) AND (`entry` IN(SELECT `entry` FROM `connexion_item` WHERE `connexion` = '.$_SESSION['connexion_id'].') AND `VersionEnd` = "'.$BuildNumber_max.'" AND `VersionEnd` = "'.$BuildNumber_max.'"');
     67   WriteQuests('SELECT *, (SELECT `sub`.`User` FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Entry` = `'.$Table.'`.`Entry`) AND (`Language` <> 0) LIMIT 1) AS `UserID`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `UserID`) AS `UserName` FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` IN(SELECT `Entry` FROM `connexion_item` WHERE `connexion` = '.$_SESSION['connexion_id'].') AND `VersionEnd` = "'.$BuildNumber_max.'" AND `VersionEnd` = "'.$BuildNumber_max.'"');
    6968}
    7069
     
    7372  global $GroupId, $Table, $BuildNumber_max, $Database;
    7473
    75  //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1)
    7674  echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> -> '.
    7775    '<a title="Zde je seznam souvislostí" href="?group='.$GroupId.'&amp;action=connexion">Souvislosti</a> - > '.
     
    7977  echo('<table class="BaseTable"><tr><th>Pořadové číslo</th><th>Název</th>');
    8078  echo('</tr>');
    81   $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE `Group` = '.$GroupId);       
     79  $ID = $Database->SQLCommand('SELECT * FROM `connexion` WHERE `Group` = '.$GroupId);       
    8280  while($Line = mysql_fetch_assoc($ID))
    8381  {
     
    9694        <strong>Vypsání nedokončených textů s limitem na stránku</strong><br /><br />');
    9795
    98   WriteQuests('SELECT `items`.*, `user`.`user` AS `UserName` FROM `'.$Table.'` AS `items` JOIN `user` ON `user`.`id` = `items`.`User` WHERE (`items`.`Language` = 0) AND
    99     NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.`entry` = `items`.`entry`) AND (`sub`.`Complete` = 1) AND (`VersionEnd` = '.$BuildNumber_max.')) AND
    100    EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub2` WHERE (`sub2`.`Language` <> 0) AND (`sub2`.`entry` = `items`.`entry`) AND (`sub2`.`Complete` = 0) AND (`VersionEnd` = '.$BuildNumber_max.')) AND (`items`.`VersionEnd` = '.$BuildNumber_max.')');
     96  WriteQuests('SELECT `items`.*, `User`.`Name` AS `UserName` FROM `'.$Table.'` AS `items` JOIN `User` ON `User`.`ID` = `items`.`User` WHERE (`items`.`Language` = 0) AND
     97    NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.`Entry` = `items`.`Entry`) AND (`sub`.`Complete` = 1) AND (`VersionEnd` = '.$BuildNumber_max.')) AND
     98   EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub2` WHERE (`sub2`.`Language` <> 0) AND (`sub2`.`Entry` = `items`.`Entry`) AND (`sub2`.`Complete` = 0) AND (`VersionEnd` = '.$BuildNumber_max.')) AND (`items`.`VersionEnd` = '.$BuildNumber_max.')');
    10199}
    102100
     
    108106     <a title="Přeložené texty, můžete zde hlasovat, nebo opravovat texty" href="?group='.$GroupId.'&amp;action=Translate">Přeložené texty</a><br /><br />');
    109107     
    110   WriteQuests('SELECT `'.$Table.'`.*, `user`.`user` AS `UserName` FROM `'.$Table.'` JOIN `user` ON `user`.`id` = `'.$Table.'`.`User` WHERE (`'.$Table.'`.`Language` <> 0) AND (`'.$Table.'`.`Complete` = 1)');
     108  WriteQuests('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName` FROM `'.$Table.'` JOIN `User` ON `User`.`ID` = `'.$Table.'`.`User` WHERE (`'.$Table.'`.`Language` <> 0) AND (`'.$Table.'`.`Complete` = 1)');
    111109}
    112110
     
    117115  echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> ->
    118116        <a title="Přeložené questy přilášeného uživatele" href="?group='.$GroupId.'&amp;action=my">Moje překlady</a><br /><br />');
    119   WriteQuests('SELECT `'.$Table.'`.*, `user`.`user` AS `UserName` FROM `'.$Table.'` JOIN `user` ON `user`.`id` = `'.$Table.'`.`user` WHERE `'.$Table.'`.`user` = '.$_SESSION['UserID']);
     117  WriteQuests('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName` FROM `'.$Table.'` JOIN `User` ON `User`.`id` = `'.$Table.'`.`User` WHERE `'.$Table.'`.`User` = '.$_SESSION['UserID']);
    120118}
    121119
     
    126124  echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> ->
    127125    <a title="Nedokončené texty" href="?group='.$GroupId.'&amp;action=mydevelop">Rozepsané překlady</a><br /><br />');
    128   WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE `user` = '.$_SESSION['UserID'].' AND `Complete` = 0');
     126  WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `User` = '.$_SESSION['UserID'].' AND `Complete` = 0');
    129127}
    130128
     
    146144  if($WhereUsers == '') $WhereUsers = '0'; 
    147145 
    148   WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE '.$WhereUsers);
     146  WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE '.$WhereUsers);
    149147}
    150148
     
    153151  global $Database, $Table, $GroupId, $TranslationTree;
    154152 
    155   $ID = $Database->SQLCommand('SELECT `user` FROM `user` WHERE `id` = '.$_GET['user']);
     153  $ID = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID` = '.$_GET['user']);
    156154  $Line = mysql_fetch_row($ID);
    157155  echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a>'.
     
    165163      if(array_key_exists('not', $_GET))
    166164      {
    167         $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `Complete` = 0 AND `user`='.$_GET['user'];
     165        $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `Complete` = 0 AND `User`='.$_GET['user'];
    168166        $ID = $Database->SQLCommand($sql);
    169167        $Line = mysql_fetch_row($ID);
     
    173171      } else
    174172      {
    175         $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `user`='.$_GET['user'];
     173        $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `User`='.$_GET['user'];
    176174        $ID = $Database->SQLCommand($sql);
    177175        $Line = mysql_fetch_row($ID);
     
    223221  if(array_key_exists('user', $_GET))
    224222  {
    225     $ID = $Database->SQLCommand('SELECT `user` FROM `user` WHERE `id` = '.($_GET['user'] * 1));
     223    $ID = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID` = '.($_GET['user'] * 1));
    226224    if(mysql_num_rows($ID) > 0)
    227225    {
     
    230228        '<strong>Vypis překladů uživatele '.$Line[0].': </strong><br /><br />');
    231229      if(array_key_exists('not', $_GET))
    232         WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE (`Complete` = 0) AND (`user` = '.$_GET['user'].')');
    233       else WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE `user` = '.$_GET['user']);
     230        WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Complete` = 0) AND (`User` = '.$_GET['user'].')');
     231      else WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `User` = '.$_GET['user']);
    234232    } else echo('Nebyl nalezen uživatel se zadaným id');
    235233  } else echo('Je nutno zadat id uživatele.');
     
    244242  else ErrorMessage('Nebyl zadán text k vyhledání.');
    245243 
    246   $sql = 'SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%"
    247     OR `entry` LIKE "%'.$Search.'%"
     244  $sql = 'SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%"
     245    OR `Entry` LIKE "%'.$Search.'%"
    248246    OR `Language` LIKE "%'.$Search.'%"
    249247    OR `User` LIKE "%'.$Search.'%"
     
    265263  else $Search = '';
    266264 
    267   $sql = 'SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE `entry` LIKE "'.$Search.'"';
     265  $sql = 'SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `Entry` LIKE "'.$Search.'"';
    268266   
    269267  WriteQuests($sql);
     
    278276        <strong>Výpis všech textů s limitem na stránku</strong><br /><br />');
    279277
    280   WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0)');
     278  WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`'.$Table.'`.`Language` = 0)');
    281279}
    282280
     
    307305    '<select name="users[]" size="10" multiple="multiple" class="UserList">');
    308306       
    309   $ID = $Database->SQLCommand('SELECT `user`, `ID` FROM `user` WHERE
    310     EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `user` = `user`.`ID`) ORDER BY `user`');
     307  $ID = $Database->SQLCommand('SELECT `Name`, `ID` FROM `User` WHERE
     308    EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `User` = `User`.`ID`) ORDER BY `Name`');
    311309  if($ID)
    312310  while($Line = mysql_fetch_assoc($ID))
    313     echo('<option value="'.$Line['ID'].'">'.$Line['user'].'</option>');
     311    echo('<option value="'.$Line['ID'].'">'.$Line['Name'].'</option>');
    314312 
    315313  echo('</select><br />
     
    331329                                               
    332330  echo('</table>');
    333   //  WriteQuests("SELECT * FROM quests Where user = ".$_SESSION['UserID']." AND Complete = '0'", '', 'mydevelop');
    334331}
    335332
  • trunk/action.php

    r358 r365  
    1515    $Table = $Group['TablePrefix'];
    1616 
    17     $sql = 'SELECT count(*) FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%"
    18       OR `entry` LIKE "%'.$Search.'%"
     17    $sql = 'SELECT COUNT(*) FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%"
     18      OR `Entry` LIKE "%'.$Search.'%"
    1919      OR `User` LIKE "%'.$Search.'%"
    2020      OR `Complete` LIKE "%'.$Search.'%"';
     
    2727  }
    2828 
    29     $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `user` WHERE `user` LIKE "%'.$Search.'%"'));
     29    $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>');
    3131    $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"'));
     
    3434  echo('<tr><td><a href="download.php?addon">Čeština pro klienta</a></td><td>'.$Line[0].'</td></tr>');
    3535  echo('<tr><td><a href="aowow/?search='.$Search.'">Vyhledávací databáze AoWoW</a></td></tr>');
    36     $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND Language = 0'));
     36    $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = 0'));
    3737  echo('<tr><td><a href="dictionary.php?search='.$Search.'">Slovníček</a></td><td>'.$Line[0].'</td></tr>');
    3838 
    3939  echo('</table>');
    4040}
    41 
    4241
    4342function DatabaseKit()
     
    6261    if(array_key_exists('Type',$_POST))
    6362    {
    64       $sql = 'DELETE FROM log WHERE Type = '.$_POST['Type'];
     63      $sql = 'DELETE FROM `Log` WHERE `Type` = '.$_POST['Type'];
    6564      $Database->SQLCommand($sql);
    6665      WriteLog('Vymazán log '.$_POST['Type'], LOG_TYPE_MODERATOR);
     
    7978        echo($Table.' ');
    8079   
    81         $sql = 'SELECT * FROM '.$Table.' WHERE (Language <> 0) AND (';
     80        $sql = 'SELECT * FROM '.$Table.' WHERE (`Language` <> 0) AND (';
    8281        foreach($Group['Items'] as $Item)
    8382        {
     
    9796          }
    9897          $sql = substr($sql,0,strlen($sql)-1);
    99           $sql .= ' WHERE ID = '.$Line['ID'];
     98          $sql .= ' WHERE `ID` = '.$Line['ID'];
    10099          $Database->SQLCommand($sql);
    101100          echo ('.');
     
    121120        echo($Table.' ');
    122121   
    123         $sql = 'SELECT ID,entry as entry_tran, Take,
    124      (SELECT ID FROM '.$Table.' WHERE Language = 0 AND entry = entry_tran LIMIT 1) as ID_orig
    125       FROM '.$Table.' as tran WHERE (Language <> 0) AND ((Take = 0) OR (ID = Take) OR NOT EXISTS(SELECT 1 FROM '.$Table.' WHERE ID = tran.Take))';
     122        $sql = 'SELECT `ID`, `Entry` AS EntryTran, `Take`,
     123     (SELECT `ID` FROM `'.$Table.'` WHERE `Language = 0 AND `Entry` = `EntryTran` LIMIT 1) AS `IDOrig`
     124      FROM `'.$Table.'` AS `Tran` WHERE (`Language` <> 0) AND ((`Take` = 0) OR (`ID` = `Take`) OR NOT EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `ID` = `Tran`.`Take`))';
    126125     
    127126        $ID = $Database->SQLCommand($sql);
    128127        while($Line = mysql_fetch_assoc($ID))
    129128        {
    130           $sql = 'UPDATE '.$Table.' SET Take = '.$Line['ID_orig'].' WHERE ID = '.$Line['ID'];
     129          $sql = 'UPDATE `'.$Table.'` SET `Take` = '.$Line['IDOrig'].' WHERE `ID` = '.$Line['ID'];
    131130          $Database->SQLCommand($sql);
    132131          echo('.');
     
    151150      {     
    152151        echo ($Table.' ');
    153         $sql = 'SELECT gs_orig.ID, gs_tran.entry, gs_tran.ShortCut as ShortCut_tran, gs_orig.ShortCut  as ShortCut_orig FROM '.$Table.' as gs_tran JOIN '.$Table.' as gs_orig ON gs_orig.entry = gs_tran.entry WHERE gs_tran.Language <> 0 AND gs_tran.ShortCut <> gs_orig.ShortCut';     
     152        $sql = 'SELECT `gs_orig`.`ID`, `gs_tran`.`Entry`, `gs_tran`.`ShortCut` AS `ShortCut_tran`, `gs_orig`.`ShortCut`  AS `ShortCut_orig` FROM `'.$Table.'` AS `gs_tran` JOIN `'.$Table.'` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` WHERE `gs_tran`.`Language` <> 0 AND `gs_tran`.`ShortCut` <> `gs_orig`.`ShortCut`';     
    154153        $ID = $Database->SQLCommand($sql);
    155154        while ($Line = mysql_fetch_assoc($ID))
    156155        {
    157           $sql = 'UPDATE '.$Table.' SET ShortCut = '.$Line['ShortCut_orig'].' WHERE ID = '.$Line['ID'];
     156          $sql = 'UPDATE `'.$Table.'` SET `ShortCut` = '.$Line['ShortCut_orig'].' WHERE `ID` = '.$Line['ID'];
    158157          $Database->SQLCommand($sql);
    159158          echo ('.');
     
    178177  {
    179178    $TextID = $_GET['ID'];       
    180     $Database->SQLCommand('DELETE FROM '.$Table.' WHERE ID = '.$TextID.' AND Language <> 0');
     179    $Database->SQLCommand('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> 0');
    181180    echo('Překlad byl smazán!');   
    182181    WriteLog('Překlad byl smazán! <a href="form.php?group='.$GroupID.'&amp;ID='.$TextID.'">'.$TextID.'</a>', LOG_TYPE_MODERATOR);
     
    205204  else die('Pro vkládaní musíte byt registrováni!');
    206205    $text = $_POST['text'];
    207     $Database->SQLCommand('INSERT INTO `shoutbox` ( `user` , `text` , `date` , `IP` )
     206    $Database->SQLCommand('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` )
    208207    VALUES ("'.$user.'", "'.$text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")');
    209208    echo('Zpráva vložena!<br>Budete přesměrováni...');   
     
    219218  global $Database;
    220219 
    221   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `shoutbox`');
     220  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ShoutBox`');
    222221  $DbRow = mysql_fetch_row($DbResult);
    223222  $PageList = GetPageList($DbRow[0]);   
     
    227226  if(Licence(LICENCE_USER)) echo(' <a href="action.php?action=shoutbox">Vložit</a>');
    228227  echo('<div class="shoutbox">');
    229   $ID = $Database->SQLCommand('SELECT * FROM `shoutbox` ORDER BY `ID` DESC '.$PageList['SQLLimit']);
     228  $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    230229  while($Line = mysql_fetch_assoc($ID))
    231     echo('<div><strong>'.$Line['user'].'</strong>: '.htmlspecialchars($Line['text']).'</div>');
     230    echo('<div><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</div>');
    232231  echo('</div>');
    233232  echo($PageList['Output']);
     
    238237  global $Database;
    239238 
    240   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `news`');
     239  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `News`');
    241240  $DbRow = mysql_fetch_row($DbResult);
    242241  $PageList = GetPageList($DbRow[0]);   
     
    246245  if(Licence(LICENCE_USER)) echo(' <a href="admin.php?action=addnew">Vložit</a>');
    247246  echo('<div class="shoutbox">');
    248   $ID = $Database->SQLCommand('SELECT `news`.`time`, `news`.`text`, `user`.`user` FROM `news` JOIN `user` ON `user`.`ID`=`news`.`user` ORDER BY `news`.`time` DESC '.$PageList['SQLLimit']);
     247  $ID = $Database->SQLCommand('SELECT `News`.`Time`, `News`.`Text`, `User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`ID`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']);
    249248  while($Line = mysql_fetch_assoc($ID))
    250     echo('<div><strong>'.HumanDate($Line['time']).'</strong> '.$Line['text'].' ('.$Line['user'].')</div>');
     249    echo('<div><strong>'.HumanDate($Line['Time']).'</strong> '.$Line['Text'].' ('.$Line['User'].')</div>');
    251250  echo('</div>');
    252251  echo($PageList['Output']);
  • trunk/admin.php

    r358 r365  
    4444  if(array_key_exists('text', $_POST))
    4545  {
    46     $querty = 'INSERT INTO `news` ( `Time` ,`User` ,`Text`) VALUES ( NOW( ) , '.$_SESSION['UserID'].', "'.$_POST['text'].'")';
     46    $querty = 'INSERT INTO `News` ( `Time` ,`User` ,`Text`) VALUES ( NOW( ) , '.$_SESSION['UserID'].', "'.$_POST['text'].'")';
    4747    $Database->SQLCommand($querty);
    4848    echo('Aktualita uložena!');
     
    5555  global $Database;
    5656 
    57   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `user`');
     57  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `User`');
    5858  $DbRow2 = mysql_fetch_row($DbResult);
    5959
     
    6161    ' AND (`ID` != 128)'. // Skip user Neznámý
    6262    ' AND (`LastLogin` < DATE_SUB(NOW(), INTERVAL 3 MONTH))'. // Time limit
    63     ' AND (NOT EXISTS (SELECT `Id` FROM `Export` WHERE `user`.`ID` = `Export`.`User`))'. // Without exports
    64     ' AND (NOT EXISTS (SELECT `ID` FROM `dictionary` WHERE `user`.`ID` = `dictionary`.`user`))'. // Without dictionary words
    65     ' AND (NOT EXISTS (SELECT `Id` FROM `news` WHERE `user`.`ID` = `news`.`user`))'. // Without news
    66     ' AND (NOT EXISTS (SELECT `ID` FROM `shoutbox` WHERE `user`.`user` = `shoutbox`.`user`))'. // Without shoutbox messages
     63    ' AND (NOT EXISTS (SELECT `Id` FROM `Export` WHERE `User`.`ID` = `Export`.`User`))'. // Without exports
     64    ' AND (NOT EXISTS (SELECT `ID` FROM `Dictionary` WHERE `User`.`ID` = `Dictionary`.`User`))'. // Without dictionary words
     65    ' AND (NOT EXISTS (SELECT `Id` FROM `News` WHERE `User`.`ID` = `News`.`User`))'. // Without news
     66    ' AND (NOT EXISTS (SELECT `ID` FROM `ShoutBox` WHERE `User`.`User` = `ShoutBox`.`User`))'. // Without shoutbox messages
    6767    '';
    68   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `user`'.$Condition);
     68  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `User`'.$Condition);
    6969  $DbRow = mysql_fetch_row($DbResult);
    70   $Database->SQLCommand('DELETE FROM `user`'.$Condition);
     70  $Database->SQLCommand('DELETE FROM `User`'.$Condition);
    7171  echo('Smazáno '.$DbRow[0].' účtů ze všech '.$DbRow2[0].'<br/>');
    7272
    7373  // Delete logs without user
    74   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `log`');
     74  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log`');
    7575  $DbRow2 = mysql_fetch_row($DbResult);
    76   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `log` WHERE (NOT EXISTS (SELECT `ID` FROM `user` WHERE `user`.`ID` = `log`.`user`)) AND (user != 0)');
     76  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` WHERE (NOT EXISTS (SELECT `ID` FROM `User` WHERE `User`.`ID` = `Log`.`User`)) AND (`User` != 0)');
    7777  $DbRow = mysql_fetch_row($DbResult);
    78   $Database->SQLCommand('DELETE FROM `log` WHERE (NOT EXISTS (SELECT `ID` FROM `user` WHERE `user`.`ID` = `log`.`user`)) AND (user != 0)');
     78  $Database->SQLCommand('DELETE FROM `Log` WHERE (NOT EXISTS (SELECT `ID` FROM `User` WHERE `User`.`ID` = `Log`.`User`)) AND (`User` != 0)');
    7979  echo('Smazáno '.$DbRow[0].' položek logu ze všech '.$DbRow2[0].'<br/>');     
    8080     
     
    8282  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ExportUser`');
    8383  $DbRow2 = mysql_fetch_row($DbResult);
    84   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `user` WHERE `user`.`ID` = `ExportUser`.`User`))');
     84  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `User` WHERE `User`.`ID` = `ExportUser`.`User`))');
    8585  $DbRow = mysql_fetch_row($DbResult);
    86   $Database->SQLCommand('DELETE FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `user` WHERE `user`.`ID` = `ExportUser`.`User`))');
     86  $Database->SQLCommand('DELETE FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `User` WHERE `User`.`ID` = `ExportUser`.`User`))');
    8787  echo('Smazáno '.$DbRow[0].' položek výběru překladatelů u exportů ze všech '.$DbRow2[0].'<br/>');     
    8888
     
    9090  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team`');
    9191  $DbRow2 = mysql_fetch_row($DbResult);
    92   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE (SELECT COUNT(*) FROM `user` WHERE `user`.`Team` = `Team`.`Id`) = 0');
     92  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0');
    9393  $DbRow = mysql_fetch_row($DbResult);
    94   $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `user` WHERE `user`.`team` = `Team`.`Id`) = 0');
     94  $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`team` = `Team`.`Id`) = 0');
    9595  echo('Smazáno '.$DbRow[0].' týmů ze všech '.$DbRow2[0].'<br/>');     
    9696       
    9797  // Set new leader for teams where old leader went to other team
    98   $Database->SQLCommand('UPDATE Team SET Leader=(SELECT Id FROM `user` WHERE user.Team=Team.Id ORDER BY user.RegistrationTime LIMIT 1) WHERE Leader NOT IN (SELECT ID FROM user WHERE user.Team=Team.Id);');
     98  $Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);');
    9999 
    100100  WriteLog('Smazány staré uživatelské účty', LOG_TYPE_ADMINISTRATION);
     
    105105  global $Database;
    106106 
    107   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `log` WHERE `type`='.LOG_TYPE_ERROR);
     107  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR);
    108108  $DbRow = mysql_fetch_row($DbResult);
    109   $Database->SQLCommand('DELETE FROM `log` WHERE `type`='.LOG_TYPE_ERROR);
     109  $Database->SQLCommand('DELETE FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR);
    110110  WriteLog('Vymazány chybové záznamy', LOG_TYPE_ADMINISTRATION); 
    111111  echo('Smazáno všech '.$DbRow[0].' chybových záznamů.<br/>');     
  • trunk/banners.php

    r290 r365  
    1818echo($BannerSmall.' &nbsp;&nbsp;<textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />');
    1919 
    20 $ID = $Database->SQLCommand('SELECT * FROM `banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)');
     20$ID = $Database->SQLCommand('SELECT * FROM `Banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)');
    2121 
    2222echo('<br/><strong>Servery odkazující na nás:</strong> <br />
  • trunk/banners/banner.php

    r301 r365  
    1616    {
    1717      $Referer = 'http://'.$HostName.'/';
    18       $DbResult = $System->Database->query('SELECT * FROM `banner` WHERE `Web` = "'.$Referer.'"');
     18      $DbResult = $System->Database->query('SELECT * FROM `Banner` WHERE `Web` = "'.$Referer.'"');
    1919      if($DbResult->num_rows > 0)
    20       $System->Database->query('UPDATE `banner` SET `DateLast` = NOW(), `LastURL` = "'.addslashes($_SERVER['HTTP_REFERER']).'" WHERE `Web` = "'.$Referer.'"');
    21         else $System->Database->query('INSERT INTO `banner` (`Web`, `DateFirst`, `DateLast`, `LastURL`) VALUES ("'.$Referer.'", NOW(), NOW( ), "'.addslashes($_SERVER['HTTP_REFERER']).'")');
     20      $System->Database->query('UPDATE `Banner` SET `DateLast` = NOW(), `LastURL` = "'.addslashes($_SERVER['HTTP_REFERER']).'" WHERE `Web` = "'.$Referer.'"');
     21        else $System->Database->query('INSERT INTO `Banner` (`Web`, `DateFirst`, `DateLast`, `LastURL`) VALUES ("'.$Referer.'", NOW(), NOW( ), "'.addslashes($_SERVER['HTTP_REFERER']).'")');
    2222    }
    2323
  • trunk/comparison.php

    r320 r365  
    7272  foreach($Line as $Index => $LineItem)
    7373  {
    74     $LineUser = mysql_fetch_array($Database->SQLCommand('SELECT * FROM user WHERE id = '.$LineItem['User']));
    75     echo('<th>'.$LineUser['user'].'</th>');
     74    $LineUser = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$LineItem['User']));
     75    echo('<th>'.$LineUser['Name'].'</th>');
    7676  }
    7777  echo('</tr>');
  • trunk/dictionary.php

    r288 r365  
    9393  if(Licence(LICENCE_USER))
    9494  {
    95     $DbResult = $Database->SQLCommand('SELECT `Language` FROM `user` WHERE `ID`='.$_SESSION['UserID']);
     95    $DbResult = $Database->SQLCommand('SELECT `Language` FROM `User` WHERE `ID`='.$_SESSION['UserID']);
    9696    $User = mysql_fetch_assoc($DbResult);
    9797    $_SESSION['language'] = $User['Language'];
     
    144144      if(array_key_exists('Original', $_POST) and array_key_exists('Translated', $_POST) and array_key_exists('Description', $_POST))
    145145      {       
    146         $DbResult = $Database->SQLCommand('SELECT * FROM `dictionary` WHERE `Text` = "'.$_POST['Original'].'" AND Language=0');
     146        $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `Text` = "'.$_POST['Original'].'" AND `Language`=0');
    147147        if(mysql_num_rows($DbResult) > 0)
    148148        {
     
    151151        } else
    152152        {
    153           $DbResult = $Database->SQLCommand('SELECT MAX(Entry) FROM dictionary');
     153          $DbResult = $Database->SQLCommand('SELECT MAX(`Entry`) FROM `Dictionary`');
    154154          $DbRow = mysql_fetch_row($DbResult);
    155155          $Entry = $DbRow[0] + 1;
    156           $Database->SQLCommand('INSERT INTO `dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", 0, 0);');
     156          $Database->SQLCommand('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", 0, 0);');
    157157        }
    158158     
    159         $DbResult = $Database->SQLCommand('SELECT Id FROM `dictionary` WHERE `Entry` = '.$Entry.' AND Language='.$_SESSION['language'].' AND User='.$_SESSION['UserID']);
     159        $DbResult = $Database->SQLCommand('SELECT `Id` FROM `Dictionary` WHERE `Entry` = '.$Entry.' AND `Language`='.$_SESSION['language'].' AND `User`='.$_SESSION['UserID']);
    160160        if(mysql_num_rows($DbResult) > 0)
    161161        {
    162162          $DbRow = mysql_fetch_assoc($DbResult);
    163           $Database->SQLCommand('UPDATE `dictionary` SET `Text`="'.$_POST['Translated'].'", `Description` = "'.$_POST['Description'].'" WHERE Id='.$DbRow['Id']);
     163          $Database->SQLCommand('UPDATE `Dictionary` SET `Text`="'.$_POST['Translated'].'", `Description` = "'.$_POST['Description'].'" WHERE Id='.$DbRow['Id']);
    164164        } else     
    165           $Database->SQLCommand('INSERT INTO `dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$_SESSION['UserID'].', '.$_SESSION['language'].')');
     165          $Database->SQLCommand('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$_SESSION['UserID'].', '.$_SESSION['language'].')');
    166166        echo('Záznam byl uložen!');
    167167      } else echo('Nebyly zaslány všechny položky formuláře.');
     
    169169    if(($_GET['action'] == 'remove') and Licence(LICENCE_USER))
    170170    {
    171       $Database->SQLCommand('DELETE FROM dictionary WHERE User='.$_SESSION['UserID'].' AND Language='.$_SESSION['language'].' AND Entry='.$_GET['entry']);
     171      $Database->SQLCommand('DELETE FROM `Dictionary` WHERE `User`='.$_SESSION['UserID'].' AND `Language`='.$_SESSION['language'].' AND `Entry`='.$_GET['entry']);
    172172    } else
    173173    if(($_GET['action'] == 'modify')  and Licence(LICENCE_USER))
    174174    {
    175       $DbResult = $Database->SQLCommand('SELECT * FROM dictionary WHERE User='.$_SESSION['UserID'].' AND Entry='.$_GET['entry'].' AND Language='.$_SESSION['language']);
     175      $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`='.$_SESSION['UserID'].' AND `Entry`='.$_GET['entry'].' AND `Language`='.$_SESSION['language']);
    176176      $DbRow = mysql_fetch_assoc($DbResult);
    177       $DbResult = $Database->SQLCommand('SELECT * FROM dictionary WHERE User=0 AND Entry='.$_GET['entry'].' AND Language=0');
     177      $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`=0 AND `Entry`='.$_GET['entry'].' AND `Language`=0');
    178178      $DbRow2 = mysql_fetch_assoc($DbResult);
    179179      echo('<form action="dictionary.php?action=save" method="post">'.
     
    216216  if($Search <> '')
    217217  {
    218     $sql = 'SELECT `user`.`user` AS `UserName`, `user`. `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT T2.User, `T1`.Language, `T1`.`Text` AS Original, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `dictionary` AS `T1` JOIN `dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].' WHERE LOWER(T1.Text) LIKE LOWER("%'.$Search.'%") OR LOWER(T1.Description) LIKE LOWER("%'.$Search.'%") ) AS T3 JOIN `user` ON `user`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0';
    219   } else $sql = 'SELECT `user`.`user` AS `UserName`, `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT T2.User, `T1`.Language, `T1`.`Text` AS Original, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `dictionary` AS `T1` JOIN `dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].') AS T3 JOIN `user` ON `user`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0';
    220 
    221   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$sql.') AS T1');
     218    $sql = 'SELECT `User`.`Name` AS `UserName`, `User`. `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.`Language`, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].' WHERE LOWER(`T1`.`Text`) LIKE LOWER("%'.$Search.'%") OR LOWER(`T1`.`Description`) LIKE LOWER("%'.$Search.'%") ) AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0';
     219  } else $sql = 'SELECT `User`.`Name` AS `UserName`, `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.Language, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].') AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0';
     220
     221  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$sql.') AS `T1`');
    222222  $DbRow = mysql_fetch_row($DbResult);
    223223  $PageList = GetPageList($DbRow[0]); 
  • trunk/download.php

    r361 r365  
    1313  $Group = $TranslationTree[$TableID];
    1414
    15   $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(distinct(entry)) FROM '.$Group['TablePrefix'].' WHERE (Language <> 0) AND (Complete = 1) AND User IN('.$Users.')'));
     15  $ID = mysql_fetch_row($Database->SQLCommand('SELECT COUNT(DISTINCT(`Entry`)) FROM '.$Group['TablePrefix'].' WHERE (`Language` <> 0) AND (`Complete` = 1) AND `User` IN('.$Users.')'));
    1616  $NumberTranslate = $ID[0];
    1717 
    18   $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM '.$Group['TablePrefix'].' WHERE (Language = 0)'));
     18  $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `'.$Group['TablePrefix'].'` WHERE (`Language` = 0)'));
    1919  $NumberAJ = $ID[0];
    2020
     
    2828}
    2929
    30   if (array_key_exists('createverse', $_GET) and Licence(LICENCE_ADMIN)) {
     30  /*
     31   if (array_key_exists('createverse', $_GET) and Licence(LICENCE_ADMIN)) {
    3132    if (array_key_exists('verse', $_POST)) { //ukládání
    32         $Database->SQLCommand('INSERT INTO `verseclient` (`verse` ,`date` ,`text` ,`user`)
     33        $Database->SQLCommand('INSERT INTO `verseclient` (`verse` ,`date` ,`text` ,`User`)
    3334                  VALUES ( "'.$_POST['verse'].'", NOW( ) , "'.$_POST['text'].'", "'.$_SESSION['UserID'].'");');
    3435      WriteLog('Nová verze ('.$_POST['verse'].') češtiny pro clienta uložena.', LOG_TYPE_MODERATOR);
     
    3738      'Verze: <input type="text" name="verse" /> <input type="submit" value="Uložit" /><br />'.
    3839      'Popis: <textarea rows="20" cols="60" name="text">');
    39       $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT ExportSetting FROM user Where ID = '.$_SESSION['UserID']));
     40      $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT `ExportSetting` FROM `User` WHERE `ID` = '.$_SESSION['UserID']));
    4041      $ExportSetting = unserialize($Line['ExportSetting']);     
    4142       
     
    4445      foreach($ExportSetting['groups'] as $Index) $Tables .= GetPercentOfTable($Index,implode(',', $ExportSetting['users-selection']));
    4546     
    46       $ID = $Database->SQLCommand('SELECT user FROM user WHERE ID IN('.implode(',', $ExportSetting['users-selection']).')');
     47      $ID = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID` IN('.implode(',', $ExportSetting['users-selection']).')');
    4748      $Users = 'Vyexportovány překlady od uživatelů: ( ';
    48       while($Line = mysql_fetch_assoc($ID)) $Users .= $Line['user'].', '; $Users .= ' )';
     49      while($User = mysql_fetch_assoc($ID)) $Users .= $User['Name'].', '; $Users .= ' )';
    4950      //Výpis
    5051      echo ('
     
    5556    }
    5657  }
     58  */
    5759
    5860if(array_key_exists('addon', $_GET))
     
    6062  echo('<br />Stažený soubor pouze rozbalte a zkopírujte do kořenové složky wow (C:\Program Files\World Of Warcraft\). Hru spouštějte přes soubor WoWME.exe <br /><br />'.
    6163  '<table  class="BaseTable"><tr><th>Verze/datum</th><th>Popis</th></tr>');
    62   $ID = $Database->SQLCommand('SELECT * FROM verseclient ORDER BY DATE DESC');
     64  $ID = $Database->SQLCommand('SELECT * FROM `verseclient` ORDER BY `Date` DESC');
    6365  while($Line = mysql_fetch_assoc($ID))
    6466  {
  • trunk/export/export.php

    r364 r365  
    3737    $this->SelectedUsers = ''; 
    3838    $this->UserNames = '';
    39     $DbResult = $this->Database->query('SELECT `ExportUser`.*, `user`.`user` FROM `ExportUser` LEFT JOIN `user` ON `user`.`ID`=`ExportUser`.`User` WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`');
     39    $DbResult = $this->Database->query('SELECT `ExportUser`.*, `User`.`Name`, `User`.`ID` FROM `ExportUser` LEFT JOIN `User` ON `User`.`ID`=`ExportUser`.`User` WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`');
    4040    while($User = $DbResult->fetch_assoc())
    4141    {
    42       $this->SelectedUsers .= ','.$User['User'];
    43       $this->UserNames .= ','.$User['user'];
     42      $this->SelectedUsers .= ','.$User['ID'];
     43      $this->UserNames .= ','.$User['Name'];
    4444    }
    4545    $this->SelectedUsers = substr($this->SelectedUsers, 1);
     
    5959    if(isset($_SESSION) and ($_SESSION['UserID'] != ''))
    6060    {
    61       $DbResult = $this->Database->query('SELECT `user` FROM `user` WHERE `ID`='.$_SESSION['UserID']);
     61      $DbResult = $this->Database->query('SELECT `Name` FROM `User` WHERE `ID`='.$_SESSION['UserID']);
    6262      $this->User = $DbResult->fetch_assoc();
    63     } else $this->User = array('user' => 'Neznámý');
     63    } else $this->User = array('User' => 'Neznámý');
    6464
    6565
     
    8282      "-- Znaková sada: ".$this->Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n".
    8383      "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n".
    84       "-- Vygeneroval uživatel: ".$this->User['user']."\n".
     84      "-- Vygeneroval uživatel: ".$this->User['Name']."\n".
    8585      "-- Vzato od uživatelů: ".$this->UserNames."\n".
    8686      "-- Generované tabulky: ";
     
    9898      if($Group['MangosTable'] != '')
    9999      {
    100         $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T GROUP BY T.entry'; 
     100        $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (`Complete` = 1) AND `VersionStart` <= '.$this->ClientVersion['BuildNumber'].' AND `VersionEnd` >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T` GROUP BY `T`.`Entry`'; 
    101101        //echo($Query);
    102102        $Buffer .= "\n\n-- ".$Group['Name']."\n\n";
     
    111111          }
    112112          $Values = substr($Values, 2);
    113           $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line['entry'].';'."\n";
     113          $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line['Entry'].';'."\n";
    114114        }     
    115115      }
     
    146146      {
    147147        $Ori_text = $Line['name'];
    148         $DbResult2 = $Database2->query('SELECT text as en,
     148        $DbResult2 = $Database2->query('SELECT `text` AS en,
    149149        (SELECT `text` FROM `'.$Config['Database']['Database'].'`.`global_strings` AS `tabletran`
    150150         WHERE `tableen`.`entry` = `tabletran`.`entry` AND (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `tran`
     
    186186    "    <time>".date('r')."</time>\n".
    187187    "    <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n".
    188     "    <author>".$this->User['user']."</author>\n".
     188    "    <author>".$this->User['Name']."</author>\n".
    189189    "    <contributors>\n";
    190190    foreach(explode(',', $this->UserNames) as $UserName)
     
    203203        $Group['MangosTableIndex'] = 'entry';
    204204      }
    205       $Query = 'SELECT *,(SELECT `user` FROM `user` WHERE `user`.`ID`=`T`.`User`) AS `UserName` FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].') AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T` GROUP BY `T`.`entry`';
     205      $Query = 'SELECT *,(SELECT `Name` FROM `User` WHERE `User`.`ID`=`T`.`User`) AS `UserName` FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].') AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T` GROUP BY `T`.`entry`';
    206206      //echo($Query);
    207207      $Buffer .= '    <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n";
     
    251251      {
    252252        $Line = $DBCFile->GetLine($I);
    253         $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (entry='.$Line[0].')  AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry';       
     253        $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`Entry`='.$Line[0].')  AND `VersionStart` <= '.$this->ClientVersion['BuildNumber'].' AND `VersionEnd` >= '.$this->ClientVersion['BuildNumber'].' ORDER BY FIELD(`User`, '.$this->SelectedUsers.')) AS `T` GROUP BY `T`.`Entry`';       
    254254        $DbResult2 = $this->Database->query($Query);
    255255        if($DbResult2->num_rows > 0)
     
    299299          $Value['Comment'] = substr(trim($LineParts[1]), 3);
    300300
    301           $Query = 'SELECT * FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`ShortCut`="'.$Value['ShortCut'].'") AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'.$this->OrderByUserList.') AS `T` GROUP BY `T`.`entry`';
     301          $Query = 'SELECT * FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`ShortCut`="'.$Value['ShortCut'].'") AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'.$this->OrderByUserList.') AS `T` GROUP BY `T`.`Entry`';
    302302          //echo($Query);
    303303          $DbResult2 = $this->Database->query($Query);
  • trunk/export/index.php

    r357 r365  
    4242  echo($Order['Output']);
    4343
    44   $DbResult = $Database->SQLCommand('SELECT `user`.`user` AS `UserName`, `Export`.*, (SELECT COUNT(*) FROM ExportGroup WHERE ExportGroup.Export=Export.Id) AS GroupCount, (SELECT COUNT(*) FROM ExportUser WHERE ExportUser.Export=Export.Id) AS UserCount FROM `Export` LEFT JOIN `user` ON `user`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);
     44  $DbResult = $Database->SQLCommand('SELECT `User`.`Name` AS `UserName`, `Export`.*, (SELECT COUNT(*) FROM `ExportGroup` WHERE `ExportGroup`.`Export`=`Export`.`Id`) AS `GroupCount`, (SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);
    4545  while($Export = mysql_fetch_assoc($DbResult))
    4646  {
     
    178178    else $InitialOrder = '';
    179179
    180   $Query = 'SELECT (@I := @I + 1) AS Sequence2, TT.* FROM (SELECT ExportUser.Sequence, T.ID, T.TranslatedCount, T.user, T.XP FROM (SELECT user.ID, user.user, user.XP, TranslatedCount FROM `user`) AS T';
    181   $Query .=' LEFT JOIN ExportUser ON ExportUser.Export = '.$_GET['ExportId'].' AND ExportUser.User=T.ID';
    182   $Query .=' WHERE T.TranslatedCount > 0 ORDER BY COALESCE(ExportUser.Sequence, 100000000)'.$InitialOrder.') AS TT';
    183 
    184   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');
     180  $Query = 'SELECT (@I := @I + 1) AS `Sequence2`, `TT`.* FROM (SELECT `ExportUser`.`Sequence`, `T`.`ID`, `T`.`TranslatedCount`, `T`.`Name`, `T`.`XP` FROM (SELECT `User`.`ID`, `User`.`Name`, `User`.`XP`, `TranslatedCount` FROM `User`) AS T';
     181  $Query .=' LEFT JOIN `ExportUser` ON `ExportUser`.`Export` = '.$_GET['ExportId'].' AND `ExportUser`.`User`=`T`.`ID`';
     182  $Query .=' WHERE `T`.`TranslatedCount` > 0 ORDER BY COALESCE(`ExportUser`.`Sequence`, 100000000)'.$InitialOrder.') AS `TT`';
     183
     184  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`');
    185185  $DbRow = mysql_fetch_row($DbResult);
    186186  $PageList = GetPageList($DbRow[0]);   
     
    210210    $Sequence = '<input type="text" name="seq'.$User['ID'].'" style="text-align: center; width: 40px;" value="'.$User['Sequence2'].'"'.$DisabledInput[$Editable].'/>';
    211211    echo('<tr>
    212     <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&amp;action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User['user'].'</a></td>
     212    <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&amp;action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User['Name'].'</a></td>
    213213    <td>'.$User['TranslatedCount'].'</td>
    214       <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User['user'].'/level.png" alt="Úroveň uživatele" /></td>
     214      <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User['Name'].'/level.png" alt="Úroveň uživatele" /></td>
    215215    <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>');
    216216  }
     
    269269  if(array_key_exists('ExportId', $_GET))
    270270  {
    271     $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
     271    $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    272272    if(mysql_num_rows($DbRows) > 0)
    273273    {   
     
    289289          if(array_key_exists('sel'.$LanguageId, $_POST)) $Selected = true;
    290290            else $Selected = false;
    291           $Condition = ' WHERE Export='.$_GET['ExportId'].' AND Language='.$LanguageId;
    292           $DbResult = $Database->SQLCommand('SELECT * FROM ExportLanguage '.$Condition);
     291          $Condition = ' WHERE Export='.$_GET['ExportId'].' AND `Language`='.$LanguageId;
     292          $DbResult = $Database->SQLCommand('SELECT * FROM `ExportLanguage` '.$Condition);
    293293          if(mysql_num_rows($DbResult) > 0)
    294294          {
    295             if(!$Selected) $Database->SQLCommand('DELETE FROM ExportLanguage '.$Condition);
    296               else $Database->SQLCommand('UPDATE ExportLanguage SET Sequence='.$Value.$Condition);
     295            if(!$Selected) $Database->SQLCommand('DELETE FROM `ExportLanguage` '.$Condition);
     296              else $Database->SQLCommand('UPDATE `ExportLanguage` SET `Sequence`='.$Value.$Condition);
    297297          } else
    298298          {
    299             if($Selected) $Database->SQLCommand('INSERT INTO ExportLanguage (Export, Language, Sequence) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')');
     299            if($Selected) $Database->SQLCommand('INSERT INTO `ExportLanguage` (`Export`, `Language`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')');
    300300          }         
    301301        }
     
    304304      // Recalculate sequence number
    305305      $Database->SQLCommand('SET @I = 0');
    306       $Database->SQLCommand('UPDATE ExportLanguage SET Sequence = (@I := @I + 1) WHERE Export='.$_GET['ExportId'].' ORDER BY Sequence;');
     306      $Database->SQLCommand('UPDATE `ExportLanguage` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;');
    307307    }
    308308  }
    309309
    310   $Query = 'SELECT (@I := @I + 1) AS Sequence2, Sequence, language.Id, Name FROM language';
    311   $Query .=' LEFT JOIN ExportLanguage ON ExportLanguage.Export = '.$_GET['ExportId'].' AND ExportLanguage.Language=language.Id';
    312   $Query .=' WHERE language.Enabled = 1 ORDER BY COALESCE(Sequence, 100)';
     310  $Query = 'SELECT (@I := @I + 1) AS `Sequence2`, `Sequence`, `Language`.`Id`, `Name` FROM `Language`';
     311  $Query .=' LEFT JOIN `ExportLanguage` ON `ExportLanguage`.`Export` = '.$_GET['ExportId'].' AND `ExportLanguage`.`Language`=`Language`.`Id`';
     312  $Query .=' WHERE `Language`.`Enabled` = 1 ORDER BY COALESCE(`Sequence`, 100)';
    313313
    314314  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');
     
    451451  if(array_key_exists('ExportId', $_GET))
    452452  {
    453     $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
     453    $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    454454    if(mysql_num_rows($DbRows) > 0)
    455455    {   
     
    463463  }
    464464
    465   $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
     465  $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    466466  $Export = mysql_fetch_assoc($DbResult);
    467467 
     
    473473    '<br />');
    474474  }
    475   $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType ORDER BY Name');
     475  $DbResult = $Database->SQLCommand('SELECT * FROM `ExportOutputType` ORDER BY `Name`');
    476476  while($ExportFormat = mysql_fetch_assoc($DbResult))
    477477  {
     
    490490  if(array_key_exists('ExportId', $_GET))
    491491  {
    492     $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
     492    $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    493493    if(mysql_num_rows($DbRows) > 0)
    494494    {   
     
    499499  if(array_key_exists('ClientVersion', $_POST))
    500500  {
    501     $Database->SQLCommand('UPDATE Export SET ClientVersion='.$_POST['ClientVersion'].' WHERE Id='.$_GET['ExportId']);
    502   }
    503 
    504   $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
     501    $Database->SQLCommand('UPDATE `Export` SET `ClientVersion`='.$_POST['ClientVersion'].' WHERE `Id`='.$_GET['ExportId']);
     502  }
     503
     504  $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    505505  $Export = mysql_fetch_assoc($DbResult);
    506506
    507   $Query = 'SELECT wow_client_version.* FROM ExportVersion LEFT JOIN wow_client_version ON wow_client_version.Id=ExportVersion.ClientVersion WHERE ExportType='.$Export['OutputType'];
    508 
    509   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');
     507  $Query = 'SELECT `wow_client_version`.* FROM `ExportVersion` LEFT JOIN `wow_client_version` ON `wow_client_version`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType'];
     508
     509  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`');
    510510  $DbRow = mysql_fetch_row($DbResult);
    511511  $PageList = GetPageList($DbRow[0]);   
     
    532532  echo($Order['Output']);
    533533
    534   $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit'];
     534  $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit'];
    535535  $DbResult = $Database->SQLCommand($Query);
    536536  while($Version = mysql_fetch_assoc($DbResult))
     
    551551  global $Database;
    552552 
    553   $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
     553  $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    554554  $Export = mysql_fetch_assoc($DbResult);
    555   $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType WHERE Id='.$Export['OutputType']);
     555  $DbResult = $Database->SQLCommand('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']);
    556556  if(mysql_num_rows($DbResult) > 0)
    557557  {
    558     $DbResult = $Database->SQLCommand('SELECT * FROM ExportVersion WHERE ExportType='.$Export[ 'OutputType'].' AND ClientVersion='.$Export['ClientVersion']);
     558    $DbResult = $Database->SQLCommand('SELECT * FROM `ExportVersion` WHERE `ExportType`='.$Export[ 'OutputType'].' AND `ClientVersion`='.$Export['ClientVersion']);
    559559    if(mysql_num_rows($DbResult) > 0)
    560560    { 
     
    569569  global $Database;
    570570
    571   $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
     571  $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    572572  $Export = mysql_fetch_assoc($DbResult);
    573   $DbResult = $Database->SQLCommand('SELECT * FROM user WHERE ID='.$Export['User']);
     573  $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID`='.$Export['User']);
    574574  $User = mysql_fetch_assoc($DbResult);
    575   echo('Export <strong><a href="?Action=View&amp;Tab=6&amp;ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$User['user'].'</strong> s označením <strong>'.$Export['Title'].'</strong>');
     575  echo('Export <strong><a href="?Action=View&amp;Tab=6&amp;ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$User['Name'].'</strong> s označením <strong>'.$Export['Title'].'</strong>');
    576576  ShowTabs(array('Obecné', 'Překladatelé', 'Překlady', 'Jazyky', 'Formát', 'Verze', 'Výstup'));
    577577  echo('<div id="content">');
  • trunk/export/process_aowow_export.php

    r349 r365  
    1818// Rebuild user selection
    1919$UserSelection = array();
    20 $DbResult = $Database->SQLCommand('SELECT `ID`, `XP` FROM `user`');
     20$DbResult = $Database->SQLCommand('SELECT `ID`, `XP` FROM `User`');
    2121while($DbRow = mysql_fetch_assoc($DbResult))
    2222{
  • trunk/form.php

    r321 r365  
    1717  if(!$Line) die('Překlad nenalezen.');
    1818   
    19   $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `Language` = 0  AND `entry` = '.$Line['entry'].' AND `VersionEnd` = '.$Line['VersionEnd'].' LIMIT 1');
     19  $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `Language` = 0  AND `Entry` = '.$Line['Entry'].' AND `VersionEnd` = '.$Line['VersionEnd'].' LIMIT 1');
    2020  $LineAJ = mysql_fetch_assoc($DbResult);
    2121  if(!$Line) die('Anglický originál k překladu nenalezen.');
    2222 
    2323  $User = @$_SESSION['User'];
    24   $IDUser = $Database->SQLCommand('SELECT * FROM `user` WHERE `id` = '.$Line['User']);
     24  $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$Line['User']);
    2525  $LineUser = mysql_fetch_array($IDUser);
    2626 
    2727  echo('Skupina: <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />');
    2828     
    29   if(($Line['Language'] <> 0) and ($LineUser['user'] <> ''))
    30     echo('Přeložil: <strong>'.$LineUser['user'].'</strong> <br />');
     29  if(($Line['Language'] <> 0) and ($LineUser['Name'] <> ''))
     30    echo('Přeložil: <strong>'.$LineUser['Name'].'</strong> <br />');
    3131  if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID']))
    3232  {
     
    4747  echo('<br />');
    4848   
    49   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE `entry` = '.$Line['entry'].' AND `Language` <> 0');
     49  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE `Entry` = '.$Line['Entry'].' AND `Language` <> 0');
    5050  $Version = mysql_fetch_row($DbResult);
    5151  $Version = $Version[0];
    5252  if($Version > 0)
    5353  {
    54     echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['entry'].'">Počet verzí: <strong>'.$Version.'</strong></a> 
     54    echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['Entry'].'">Počet verzí: <strong>'.$Version.'</strong></a> 
    5555      <input type="hidden" name="group" value="'.$GroupId.'" />
    56       <input type="hidden" name="entry" value="'.$Line['entry'].'" />
     56      <input type="hidden" name="entry" value="'.$Line['Entry'].'" />
    5757      <input type="hidden" name="ID2" value="'.$TextID.'" />
    5858      <select onchange="this.form.submit();" name="ID1">
    5959      <option value="-1">Vyberte text k porovnání</option>
    6060      <option value="-1">Zobrazit/porovnat všechny</option>');
    61     $DataID = $Database->SQLCommand('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE (`entry` = '.$Line['entry'].') AND (`ID` <> '.$Line['ID'].')'); 
     61    $DataID = $Database->SQLCommand('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].')'); 
    6262    while($version = mysql_fetch_array($DataID))
    6363    {     
     
    6565      else
    6666      {
    67         if($version['Language'] == 0) $version['User'] = 'Předloha';
    68         echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['User'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');
     67        if($version['Language'] == 0) $version['UserName'] = 'Předloha';
     68        echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['UserName'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');
    6969      }
    7070    }
     
    7272  } else
    7373  {
    74     echo('<a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>');
     74    echo('<a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['Entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>');
    7575  }
    7676
     
    8787
    8888  if($TranslationTree[$GroupId]['WowheadName'] != '')
    89     $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ['entry'].'">'.$LineAJ['entry'].'</a>';
    90     else $WowheadLink = $LineAJ['entry'];
     89    $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ['Entry'].'">'.$LineAJ['Entry'].'</a>';
     90    else $WowheadLink = $LineAJ['Entry'];
    9191 
    92   echo('<input type="hidden" name="entry" value="'.$LineAJ['entry'].'" />
     92  echo('<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" />
    9393    <input type="hidden" name="user" value="'.$User.'" />
    9494    <input type="hidden" name="ID" value="'.$TextID.'" />
     
    107107  else if($_SESSION['UserID'] != '')
    108108  {
    109     $IDUser = $Database->SQLCommand('SELECT * FROM `user` WHERE `id` = '.$_SESSION['UserID']);
     109    $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID']);
    110110    $LineUser = mysql_fetch_array($IDUser);
    111     $Language = $LineUser['Language'];  //jiný user vyčítám
     111    $Language = $LineUser['Language'];  // jiný user vyčítám
    112112  } else $Language = 0;
    113113  WriteLanguages($Language);
  • trunk/img_level.php

    r357 r365  
    7272          else $groupby .= ', '.$TextItem['Column'];
    7373      }
    74       $IDtran = $Database->SQLCommand('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE User = '.$user_ID.' AND Complete = 1 '.$groupby);
     74      $IDtran = $Database->SQLCommand('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE `User` = '.$user_ID.' AND `Complete` = 1 '.$groupby);
    7575      while($Line = mysql_fetch_array($IDtran))
    7676      {   //jednotlivé překlady
     
    106106
    107107  // Hlavní kod pro uživatele
    108   $ID = $Database->SQLCommand('SELECT `ID`, `user` FROM `user` WHERE `NeedUpdate` = 1');
     108  $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `User` WHERE `NeedUpdate` = 1');
    109109  while($LineUser = mysql_fetch_array($ID))
    110110  {
     
    120120   
    121121    $xp = GetXPFromTranslation($LineUser['ID']);
    122     $Database->SQLCommand('UPDATE `user` SET `XP` = '.$xp.', `TranslatedCount` = '.$TranslatedCount.' WHERE `user`.`ID` = '.$LineUser['ID']);
    123     CreateImg('user', $LineUser['user'], $xp);
     122    $Database->SQLCommand('UPDATE `User` SET `XP` = '.$xp.', `TranslatedCount` = '.$TranslatedCount.' WHERE `User`.`ID` = '.$LineUser['ID']);
     123    CreateImg('user', $LineUser['Name'], $xp);
    124124  }
    125125
    126126  // Hlavní kod pro překladatelské týmy
    127   $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)');
     127  $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)');
    128128  while($LineTeam = mysql_fetch_array($ID))
    129129  {
    130     CreateImg('team', $LineTeam['name'], substr($LineTeam['average'], 0, strpos($LineTeam['average'],'.')));  //vytváření obrázku
     130    CreateImg('team', $LineTeam['Name'], substr($LineTeam['Average'], 0, strpos($LineTeam['Average'],'.')));  //vytváření obrázku
    131131  }
    132   $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 0');
     132  $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 0');
    133133}
    134134
     
    138138 
    139139  // Do update for all users
    140   $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1');
     140  $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1');
    141141  ImgLevelUpdate();
    142142 
    143143  echo('<strong>Uživatelé</strong><br/>');
    144   $ID = $Database->SQLCommand('SELECT `ID`, `user` FROM `user`');
     144  $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `User`');
    145145  while($LineUser = mysql_fetch_array($ID))
    146146  {
    147     echo('<img src="tmp/user/'.$LineUser['user'].'/level.png" /> '.$LineUser['user'].'<br />');
     147    echo('<img src="tmp/user/'.$LineUser['Name'].'/level.png" /> '.$LineUser['Name'].'<br />');
    148148  }
    149149
    150150  echo('<br/><strong>Týmy</strong><br/>');
    151   $ID = $Database->SQLCommand('SELECT ID, Name FROM Team');
     151  $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `Team`');
    152152  while($LineTeam = mysql_fetch_array($ID))
    153153  {
  • trunk/img_statistic.php

    r349 r365  
    1010if(array_key_exists('team', $_GET))
    1111{
    12   $team = ' AND `User` IN (SELECT `ID` FROM `user` WHERE `team` = '.($_GET['team'] * 1).')';
     12  $team = ' AND `User` IN (SELECT `ID` FROM `User` WHERE `Team` = '.($_GET['team'] * 1).')';
    1313} else $team = '';
    1414
     
    2424
    2525$where = 'VersionEnd = '.$BuildNumber_max.' AND (`Language` <> 0) AND (`Complete` = 1) '.$team.$language;
    26 $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(distinct(`entry`)) FROM `'.$Group['TablePrefix'].'` WHERE '.$where));
     26$ID = mysql_fetch_row($Database->SQLCommand('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE '.$where));
    2727$NumberTranslate = $ID[0];
    2828 
    29 $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(distinct(`entry`)) FROM `'.$Group['TablePrefix'].'` WHERE `VersionEnd` = '.$BuildNumber_max.' AND (`Language` = 0)'));
     29$ID = mysql_fetch_row($Database->SQLCommand('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE `VersionEnd` = '.$BuildNumber_max.' AND (`Language` = 0)'));
    3030$NumberAJ = $ID[0];
    3131
    32 $DbResult = $Database->SQLCommand('SELECT count(*) FROM `log` WHERE (`Type` = 1) AND (`date` >= CURRENT_DATE - INTERVAL '.$Days.' DAY) AND (`text` LIKE "%'.$Group['Name'].'%")');
     32$DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` WHERE (`Type` = 1) AND (`Date` >= CURRENT_DATE - INTERVAL '.$Days.' DAY) AND (`Text` LIKE "%'.$Group['Name'].'%")');
    3333$ID = mysql_fetch_row($DbResult);
    3434$NumberPerDay = $ID[0]; //date ("Y-m-d H:i:s")
  • trunk/import/import_dbc.php

    r357 r365  
    55UPDATE `gametips` SET VersionStart = 8606,VersionEnd = 8606;
    66UPDATE `spell` SET VersionStart = 8606,VersionEnd = 8606;
    7 DELETE FROM `log` WHERE Type = 11;
     7DELETE FROM `Log` WHERE Type = 11;
    88*/ 
    99 
  • trunk/includes/global.php

    r362 r365  
    4444  if(Licence(LICENCE_USER)) echo(' <a href="'.$Config['Web']['BaseURL'].'action.php?action=shoutbox">Vložit</a>');
    4545  echo('<div class="box"><table>');
    46   $ID = $Database->SQLCommand('SELECT * FROM shoutbox ORDER BY ID DESC LIMIT 20');
     46  $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20');
    4747  while($Line = mysql_fetch_assoc($ID))
    48     echo('<tr><td><strong>'.$Line['user'].'</strong>: '.htmlspecialchars($Line['text']).'</td></tr>');
     48    echo('<tr><td><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</td></tr>');
    4949  echo('</table></div>');
    5050}
     
    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`, `Name` 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
    6565    //echo('<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>');
    66     echo('<span class="MenuItem2">'.$User['user'].' <a href="'.$Config['Web']['BaseURL'].'?Logout">Odhlášení</a> <a href="'.$Config['Web']['BaseURL'].'Options.php">Nastavení</a></span>');
     66    echo('<span class="MenuItem2">'.$User['Name'].' <a href="'.$Config['Web']['BaseURL'].'?Logout">Odhlášení</a> <a href="'.$Config['Web']['BaseURL'].'Options.php">Nastavení</a></span>');
    6767  } else
    6868  {
     
    189189 
    190190  echo('Online překladatelé:<br />');
    191   $ID = $Database->SQLCommand('SELECT `user`, `GM`, `ID` FROM `user` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))');
    192   while ($Line = mysql_fetch_assoc($ID))
    193   {
    194     if(Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>';
    195     else $Name = $Line['user'];
    196     //if($Line['GM'] <> 0) $TextGM = '<small>('.$Moderators[$Line['GM']].')</small>';
    197     //else
     191  $ID = $Database->SQLCommand('SELECT `Name`, `GM`, `ID` FROM `User` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))');
     192  while($User = mysql_fetch_assoc($ID))
     193  {
     194    if(Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$User['ID'].'">'.$User['Name'].'</a>';
     195    else $Name = $User['Name'];
    198196    $TextGM = '';
    199197    echo('<strong>'.$Name.'</strong>'.$TextGM.'<br />');
     
    215213    $_SESSION['Pass'] = $_POST['LoginPass'];
    216214
    217     $DbResult = $Database->SQLCommand('SELECT * FROM `user` WHERE LOWER(`user`) = LOWER("'.$_SESSION['User'].'") AND `pass` = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), `Salt`))');
     215    $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE LOWER(`Name`) = LOWER("'.$_SESSION['User'].'") AND `Pass` = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), `Salt`))');
    218216    if(mysql_num_rows($DbResult) == 0)
    219217    {
     
    226224      $User = mysql_fetch_assoc($DbResult);
    227225      $_SESSION['UserID'] = $User['ID'];
    228       $_SESSION['User'] = $User['user'];
     226      $_SESSION['User'] = $User['Name'];
    229227      WriteLog('Login: '.$_SESSION['User'], LOG_TYPE_USER);
    230228    }
     
    236234    WriteLog('Odhlášení', LOG_TYPE_USER);
    237235    if(is_numeric($_SESSION['UserID']))
    238       $Database->SQLCommand('UPDATE `user` SET `LastLogout` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
     236      $Database->SQLCommand('UPDATE `User` SET `LastLogout` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
    239237    $_SESSION['User'] = '';
    240238    $_SESSION['Pass'] = '';
     
    244242  // Záznam o aktivitě
    245243  if(Licence(LICENCE_USER) and array_key_exists('REMOTE_ADDR', $_SERVER))
    246     $Database->SQLCommand('UPDATE `user` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
     244    $Database->SQLCommand('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
    247245}
    248246
  • trunk/includes/global_function.php

    r357 r365  
    223223    // $User = $_SESSION['User'];
    224224    $Pass = $_SESSION['Pass'];
    225     $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM user WHERE ID = '.$_SESSION['UserID'].' AND GM >= '.$Licence.' AND pass = sha1(CONCAT(sha1("'.$Pass.'"), Salt))'));
     225    $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID'].' AND `GM` >= '.$Licence.' AND `Pass` = sha1(CONCAT(sha1("'.$Pass.'"), `Salt`))'));
    226226    return($Line);
    227227  } else
     
    245245 
    246246  $Result = array();
    247   $DbResult = $Database->SQLCommand('SELECT * FROM `language` WHERE `Enabled` = 1');
     247  $DbResult = $Database->SQLCommand('SELECT * FROM `Language` WHERE `Enabled` = 1');
    248248  while($DbRow = mysql_fetch_assoc($DbResult))
    249249    $Result[$DbRow['Id']] = $DbRow;
     
    288288
    289289  $Database->SelectDatabase($Config['Database']['Database']);   
    290   $Query = 'INSERT INTO `log` ( `user` , `type` , `text` , `date` , `IP` )
     290  $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP` )
    291291   VALUES ('.$user.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$ip.'")';
    292292  $Database->SQLCommand($Query);
  • trunk/index.php

    r357 r365  
    88
    99  $Output = '<strong>Změny systému:</strong><div class="NewsBox">';
    10   $DbResult = $Database->SQLCommand('SELECT news.Time, user.user, news.Text FROM news JOIN user ON user.ID = news.User ORDER BY Time DESC LIMIT 10');
     10  $DbResult = $Database->SQLCommand('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
    1111  while($DbRow = mysql_fetch_assoc($DbResult))
    12     $Output .= '<div><strong>'.$DbRow['user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>'; 
     12    $Output .= '<div><strong>'.$DbRow['Name'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>'; 
    1313  $Output .= '<a href="action.php?action=news">Všechny zprávy</a>';
    1414  $Output .= '</div>';
     
    2121
    2222  $Output = '<br /><strong>Poslední překlady:</strong><div class="NewsBox">';
    23   $DbResult = $Database->SQLCommand('SELECT date,user.user,text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY date DESC LIMIT 20');
     23  $DbResult = $Database->SQLCommand('SELECT `Date`, `User`.`Name`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 20');
    2424  while($DbRow = mysql_fetch_assoc($DbResult))
    25     $Output .= '<strong>'.$DbRow['user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['date'])).')</strong>
    26     '.$DbRow['text'].' <br />'; 
     25    $Output .= '<strong>'.$DbRow['Name'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Date'])).')</strong>
     26    '.$DbRow['Text'].' <br />'; 
    2727  $Output .= '</div>';
    2828  return($Output);
     
    3636  if($_GET['rss'] == 'news')
    3737  {
    38     $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(news.Time), news.Time, user.user, news.Text FROM news JOIN user ON user.ID = news.User ORDER BY Time DESC LIMIT 10');
     38    $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
    3939    while($DbRow = mysql_fetch_assoc($DbResult))
    4040    {
    4141      $Items[] = array
    4242    (
    43         'Title' => $DbRow['user'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')',
     43        'Title' => $DbRow['Name'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')',
    4444        'Link' =>  $Config['Web']['BaseURL'],
    4545        'Description' => $DbRow['Text'],
    46         'Time' => $DbRow['UNIX_TIMESTAMP(news.Time)'],
     46        'Time' => $DbRow['UnixTime'],
    4747      );
    4848    }
     
    5858  if($_GET['rss'] == 'translation')
    5959  {
    60     $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(date), date, user.user, text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY date DESC LIMIT 100');
     60    $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100');
    6161    while($DbRow = mysql_fetch_assoc($DbResult))
    6262    {
    6363      $Items[] = array
    6464    (
    65         'Title' => strip_tags($DbRow['text'].' ('.$DbRow['user'].')'),
     65        'Title' => strip_tags($DbRow['Text'].' ('.$DbRow['UserName'].')'),
    6666        'Link' =>  $Config['Web']['BaseURL'],
    67         'Description' => $DbRow['text'],
    68         'Time' => $DbRow['UNIX_TIMESTAMP(date)'],
     67        'Description' => $DbRow['Text'],
     68        'Time' => $DbRow['Date'],
    6969      );
    7070    }
     
    8282  $TitleLength = 50;
    8383  mb_internal_encoding('utf-8');
    84     $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(date), user, text FROM shoutbox ORDER BY ID DESC LIMIT 20');
     84    $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `Text` FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20');
    8585    while($DbRow = mysql_fetch_assoc($DbResult))
    8686    {
     
    8989      $Items[] = array
    9090    (
    91         'Title' => $DbRow['user'].': '.$Title,
     91        'Title' => $DbRow['User'].': '.$Title,
    9292        'Link' =>  $Config['Web']['BaseURL'],
    93         'Description' => $DbRow['text'],
    94         'Time' => $DbRow['UNIX_TIMESTAMP(date)'],
     93        'Description' => $DbRow['Text'],
     94        'Time' => $DbRow['UnixDate'],
    9595      );
    9696    }
  • trunk/log.php

    r357 r365  
    66{
    77  $Items = array();
    8   if(array_key_exists('type', $_GET)) $Where = ' WHERE `type` = "'.($_GET['type'] * 1).'"';
     8  if(array_key_exists('type', $_GET)) $Where = ' WHERE `Type` = "'.($_GET['type'] * 1).'"';
    99    else $Where = '';
    10   $sql = 'SELECT *,UNIX_TIMESTAMP(`date`), (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `log`.`user`) AS `user` FROM `log`'.$Where.' ORDER BY `date` DESC LIMIT 100';
     10  $sql = 'SELECT *,UNIX_TIMESTAMP(`Date`), (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `User` FROM `Log`'.$Where.' ORDER BY `Date` DESC LIMIT 100';
    1111  $ID = $Database->SQLCommand($sql);
    1212  while($Line = mysql_fetch_assoc($ID))
    1313  {
    14     $DbResult = $Database->SQLCommand('SELECT * FROM `LogType` WHERE `Id`='.$Line['type']);
     14    $DbResult = $Database->SQLCommand('SELECT * FROM `LogType` WHERE `Id`='.$Line['Type']);
    1515    $LogType = mysql_fetch_assoc($DbResult);
    1616   
    1717    $Items[] = array
    1818    (
    19       'Title' => strip_tags($LogType['Name'].': '.$Line['text'].' ('.$Line['user'].', '.$Line['IP'].')'),
     19      'Title' => strip_tags($LogType['Name'].': '.$Line['Text'].' ('.$Line['Name'].', '.$Line['IP'].')'),
    2020      'Link' =>  $Config['Web']['BaseURL'].'log.php',
    21       'Description' => $LogType['Name'].': '.$Line['text'].' ('.$Line['user'].', '.$Line['IP'].')',
    22       'Time' => $Line['UNIX_TIMESTAMP(date)'],
     21      'Description' => $LogType['Name'].': '.$Line['Text'].' ('.$Line['Name'].', '.$Line['IP'].')',
     22      'Time' => $Line['UNIX_TIMESTAMP(Date)'],
    2323    );
    2424  }
     
    3939  if(array_key_exists('group', $_GET)) $_SESSION['group'] = $_GET['group'];
    4040
    41   if($_SESSION['type'] != '') $WhereType = ' `type`='.$_SESSION['type'];
     41  if($_SESSION['type'] != '') $WhereType = ' `Type`='.$_SESSION['type'];
    4242    else $WhereType = '1=1';
    4343   
     
    6161  else
    6262  {
    63     if(array_key_exists('group', $_SESSION)) $Where = ' WHERE `text` LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';
     63    if(array_key_exists('group', $_SESSION)) $Where = ' WHERE `Text` LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';
    6464      else $Where = '';
    6565  }
    6666  //if(($Where != '') and (array_key_exists('group', $_SESSION))) $Where .= ' AND text LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';
    6767
    68   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `log` '.$Where);
     68  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` '.$Where);
    6969  $DbRow = mysql_fetch_row($DbResult);
    7070  $PageList = GetPageList($DbRow[0]);   
     
    7575    array('Name' => 'date', 'Title' => 'Čas'),
    7676    array('Name' => 'text', 'Title' => 'Text'),
    77     array('Name' => 'user', 'Title' => 'Uživatel'),
     77    array('Name' => 'User', 'Title' => 'Uživatel'),
    7878    array('Name' => 'IP', 'Title' => 'Adresa'),
    7979  );
     
    8282  echo($Order['Output']);
    8383 
    84   $sql = 'SELECT *, `LogType`.`Color` AS `LogColor`, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `log`.`user`) AS `user` FROM `log` LEFT JOIN `LogType` ON `LogType`.`Id`=`log`.`type` '.$Where.$Order['SQL'].$PageList['SQLLimit'];
     84  $sql = 'SELECT *, `LogType`.`Color` AS `LogColor`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `User` FROM `Log` LEFT JOIN `LogType` ON `LogType`.`Id`=`Log`.`Type` '.$Where.$Order['SQL'].$PageList['SQLLimit'];
    8585  //echo($sql);
    8686  $ID = $Database->SQLCommand($sql);
    8787  while($Line = mysql_fetch_assoc($ID))
    8888  {
    89     echo('<tr><td>'.$Line['date'].'</td><td><span style="color: '.$Line['LogColor'].'">'.$Line['text'].'</span></td><td>'.$Line['user'].'</td><td>'.$Line['IP'].'</td></tr>');
     89    echo('<tr><td>'.$Line['Date'].'</td><td><span style="color: '.$Line['LogColor'].'">'.$Line['Text'].'</span></td><td>'.$Line['Name'].'</td><td>'.$Line['IP'].'</td></tr>');
    9090  }
    9191  echo('</table>');
  • trunk/registrace.php

    r357 r365  
    77if(array_key_exists('user', $_POST))
    88{
    9   $User = $_POST['user'];
     9  $UserName = $_POST['user'];
    1010  $Pass = $_POST['pass'];
    1111  $Pass2 = $_POST['pass2'];
     
    1919  if($Pass == $Pass2)
    2020  {
    21     $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM user WHERE user = "'.$User.'"'));
     21    $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM `User` WHERE `User` = "'.$User.'"'));
    2222    if(!$Line)
    2323    {
    2424      $Address = $_SERVER['REMOTE_ADDR'];
    2525      $Salt = GetPasswordSalt();
    26       $Database->SQLCommand('INSERT INTO `user` (`user` , `pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `team` , `NeedUpdate`, `RegistrationTime` )
    27       VALUES ("'.$User.'", sha1(CONCAT(sha1("'.$Pass.'"), "'.$Salt.'")), "'.$Salt.'", "'.$Address.'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())');
    28    //   $Database->SQLCommand("INSERT INTO user () VALUES('$User','$Pass','0','$Addres',now(),'0','$Email')");
     26      $Database->SQLCommand('INSERT INTO `User` (`Name` , `Pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime` )
     27      VALUES ("'.$UserName.'", sha1(CONCAT(sha1("'.$Pass.'"), "'.$Salt.'")), "'.$Salt.'", "'.$Address.'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())');
    2928      echo('Registrace proběhla úspěšně.<br />');
    3029     
    31       $_SESSION['User'] = $User;
     30      $_SESSION['User'] = $UserName;
    3231      $_SESSION['Pass'] = $Pass;
    3332   
    34       $Line = mysql_fetch_array($Database->SQLCommand('SELECT ID FROM user WHERE user = "'.$_SESSION['User'].'"'));
     33      $Line = mysql_fetch_array($Database->SQLCommand('SELECT `ID` FROM `User` WHERE `Name` = "'.$_SESSION['User'].'"'));
    3534      $_SESSION['UserID'] = $Line['ID'];
    3635      WriteLog('Uživatel se zaregistroval: '.$User, LOG_TYPE_USER);
  • trunk/save.php

    r357 r365  
    1919    else $complete = 0;
    2020             
    21   $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`entry` = '.$entry.')');
     21  $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$entry.')');
    2222  if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky');
    2323  $LineAJ = mysql_fetch_array($DbResult);
    2424  $LineTake = mysql_fetch_array($Database->SQLCommand('SELECT `VersionEnd`, `VersionStart` FROM `'.$Table.'` WHERE `ID` = '.$TextID));
    2525  if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky');
    26   $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`user`='.$UserID.') AND (`entry` = '.$entry.') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')');
     26  $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$UserID.') AND (`Entry` = '.$entry.') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')');
    2727  $Line = mysql_fetch_array($DbResult);
    2828  if(!$Line)
     
    6969    while($SameTranLine = mysql_fetch_assoc($SameTranID))
    7070    {
    71       $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`user`='.$UserID.') AND (`entry` = '.$SameTranLine['entry'].') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')'));
     71      $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$UserID.') AND (`Entry` = '.$SameTranLine['Entry'].') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')'));
    7272      if(!$Line)
    7373      {
     
    7979            if($Rank_number <> '') $Rank_cur = $Rank.' '.$Rank_number;
    8080              else $Rank_cur = $SameTranLine['Rank'];
    81             $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `Rank`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$Rank_cur.'")');
     81            $Database->SQLCommand('INSERT INTO `'.$Table.'` (`Entry`, '.$Columns.', `Rank`) VALUES ('.$SameTranLine['Entry'].','.$Values.',"'.$Rank_cur.'")');
    8282          } else
    8383          {
    84             $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$SameTranLine['entry'].','.$Values.')');
     84            $Database->SQLCommand('INSERT INTO `'.$Table.'` (`Entry`, '.$Columns.') VALUES ('.$SameTranLine['Entry'].','.$Values.')');
    8585          }
    8686        } else
    8787        {
    88           $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `ShortCut`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$SameTranLine['ShortCut'].'")');
     88          $Database->SQLCommand('INSERT INTO `'.$Table.'` (`Entry`, '.$Columns.', `ShortCut`) VALUES ('.$SameTranLine['Entry'].','.$Values.',"'.$SameTranLine['ShortCut'].'")');
    8989        }
    9090        $LastIDs[] = mysql_insert_id();
     
    119119  $next = FollowingTran($TextID, $Table, $GroupId);
    120120  echo('<br /><br />');
    121   $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `redirecting` FROM `user` WHERE `ID`='.$UserID));
     121  $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `Redirecting` FROM `User` WHERE `ID`='.$UserID));
    122122   
    123123  switch($redirecting['redirecting'])
     
    145145   
    146146  // Aktualizace informace o nutnosti načíst XP
    147   $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1 WHERE `ID` = '.$UserID);
     147  $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$UserID);
    148148} else
    149149{
  • trunk/statistic.php

    r328 r365  
    2222<div>Počet stáhnutí přeložených textů v SQL souboru: <strong>');
    2323       
    24 $ID = $Database->SQLCommand('SELECT count(distinct(IP)) FROM log WHERE type = 2');
     24$ID = $Database->SQLCommand('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 2');
    2525$Line = mysql_fetch_row($ID);
    2626echo($Line[0]);
     
    2929<div>Počet stáhnutí: <strong>');
    3030     
    31 $ID = $Database->SQLCommand('SELECT count(distinct(IP)) FROM log WHERE type = 0');
     31$ID = $Database->SQLCommand('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 0');
    3232$Line = mysql_fetch_row($ID);
    3333echo($Line[0]);
  • trunk/team.php

    r357 r365  
    3131  echo($Order['Output']);
    3232
    33   if(array_key_exists('search', $_GET))  $_SESSION['search'] = ' WHERE `name` LIKE "%'.$_GET['search'].'%" OR `description` LIKE "%'.$_GET['search'].'%"';
     33  if(array_key_exists('search', $_GET))  $_SESSION['search'] = ' WHERE `Name` LIKE "%'.$_GET['search'].'%" OR `Description` LIKE "%'.$_GET['search'].'%"';
    3434    else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
    3535    if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
     
    4646    if(!is_numeric($_SESSION['team'])) echo(' <a href="?Where">Zrušit filtr týmů</a><br />');
    4747    */
    48     $DbResult = $Database->SQLCommand('SELECT `Team` FROM `user` WHERE `ID`='.$_SESSION['UserID']);
     48    $DbResult = $Database->SQLCommand('SELECT `Team` FROM `User` WHERE `ID`='.$_SESSION['UserID']);
    4949    $User = mysql_fetch_assoc($DbResult);   
    5050
    51     $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']);
     51    $ID = $Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) AS `NumberUser`, (SELECT `Name` FROM `User` WHERE `User`.`ID`=`Team`.`Leader`) AS `LeaderName` FROM `Team` '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']);
    5252    while($Team = mysql_fetch_assoc($ID))
    5353    {
     
    8181    if(array_key_exists('id', $_GET))
    8282    {
    83       $Database->SQLCommand('UPDATE `user` SET `team` = '.$_GET['id'].' WHERE `ID` = '.$_SESSION['UserID']);
     83      $Database->SQLCommand('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$_SESSION['UserID']);
    8484      echo('<strong>Vstoupil jsi do týmu</strong><br /><br />');   
    8585      WriteLog('Uživatel vstoupil do týmu '.$_GET['id'], LOG_TYPE_USER);
    8686
    8787      // Delete all teams without users
    88       $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `user` WHERE `user`.`team` = `Team`.`Id`) = 0');
     88      $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0');
    8989       
    9090      // Set new leader for teams where old leader went to other team
    91       $Database->SQLCommand('UPDATE Team SET Leader=(SELECT Id FROM `user` WHERE user.Team=Team.Id ORDER BY user.RegistrationTime LIMIT 1) WHERE Leader NOT IN (SELECT ID FROM user WHERE user.Team=Team.Id);');
     91      $Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);');
    9292       
    9393      ShowTeamList();
     
    110110      {
    111111        $Database->SQLCommand('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`,`Leader`) VALUES ("'.trim($_POST['Name']).'", "'.trim($_POST['Description']).'", "'.$_POST['URL'].'", NOW(), '.$_SESSION['UserID'].')'); 
    112         $Database->SQLCommand('UPDATE `user` SET `team` = '.mysql_insert_id().' WHERE `ID` = '.$_SESSION['UserID']);
     112        $Database->SQLCommand('UPDATE `User` SET `Team` = '.mysql_insert_id().' WHERE `ID` = '.$_SESSION['UserID']);
    113113        echo('<strong>Překladatelský tým vytvořen</strong><br /><br />');
    114114        WriteLog('Překladatelský tým vytvořen '.$_POST['Name'], LOG_TYPE_USER);
    115115
    116116        // Delete all teams without users
    117         $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `user` WHERE `user`.`team` = `Team`.`Id`) = 0');   
     117        $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0');   
    118118      } else echo('Již existuje tým se stejným jménem');
    119119    } else echo('Chybí údaje formuláře');
     
    195195    ImgLevelUpdate();
    196196     
    197     $Team = mysql_fetch_assoc($Database->SQLCommand('SELECT *, (SELECT count(*) FROM `user` WHERE `team` = `Team`.`Id`) AS `NumberUser`, (SELECT SUM(`TranslatedCount`) FROM `user` WHERE `team` = `Team`.`Id`) AS `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id']));
    198     $DbResult = $Database->SQLCommand('SELECT user FROM user WHERE ID='.$Team['Leader']);
     197    $Team = mysql_fetch_assoc($Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `Team` = `Team`.`Id`) AS `NumberUser`, (SELECT SUM(`TranslatedCount`) FROM `User` WHERE `team` = `Team`.`Id`) AS `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id']));
     198    $DbResult = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID`='.$Team['Leader']);
    199199    if(mysql_num_rows($DbResult) > 0)
    200200    {
    201201      $Leader = mysql_fetch_assoc($DbResult);
    202       $Leader = $Leader['user'];
     202      $Leader = $Leader['Name'];
    203203    } else $Leader = '';
    204204   
     
    227227  if(Licence(LICENCE_USER))
    228228  {   
    229     $Database->SQLCommand('UPDATE `user` SET `team` = 0 WHERE `ID` = '.$_SESSION['UserID']);
     229    $Database->SQLCommand('UPDATE `User` SET `Team` = 0 WHERE `ID` = '.$_SESSION['UserID']);
    230230    echo('<strong>Nyní nejste členem žádného týmu</strong><br /><br />');   
    231231    WriteLog('Uživatel vystoupil z týmu', LOG_TYPE_USER);
    232232
    233233    // Delete all teams without users
    234     $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `user` WHERE `user`.`team` = `Team`.`Id`) = 0');
     234    $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0');
    235235       
    236236    // Set new leader for teams where old leader went to other team
    237     $Database->SQLCommand('UPDATE Team SET Leader=(SELECT Id FROM `user` WHERE user.Team=Team.Id ORDER BY user.RegistrationTime LIMIT 1) WHERE Leader NOT IN (SELECT ID FROM user WHERE user.Team=Team.Id);');
     237    $Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);');
    238238       
    239239    ShowTeamList();
  • trunk/user.php

    r350 r365  
    1010  $email = $_POST['email'];
    1111  $subject = $_POST['subject'];
    12   echo('email: <strong>'.$email.'</strong><br />');
    13   echo('předmět: <strong>'.$subject.'</strong><br />');
    14   echo('text: <strong>'.$text.'</strong><br />');
     12  echo('Email: <strong>'.$email.'</strong><br />');
     13  echo('Předmět: <strong>'.$subject.'</strong><br />');
     14  echo('Text: <strong>'.$text.'</strong><br />');
    1515   
    1616  if(@mail($email, $subject, $text, 'From: '.$Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
     
    2626if(array_key_exists('user', $_GET) and Licence(LICENCE_MODERATOR))
    2727
    28   $Query = 'SELECT * FROM `user` WHERE ID = '.$_GET['user'];
    29   $LineUser = mysql_fetch_array($Database->SQLCommand($Query));
     28  $Query = 'SELECT * FROM `User` WHERE `ID` = '.$_GET['user'];
     29  $User = mysql_fetch_array($Database->SQLCommand($Query));
    3030   
    31   echo('ID: <strong>'.$_GET['user'].'</strong><br />');
    32   echo('Jméno: <strong>'.$LineUser['user'].'</strong><br />');
    33   echo('Výchozí jazyk: <strong>'.$LanguageList[$LineUser['Language']]['Name'].'</strong><br />');
    34   echo('Poslední připojení: <strong>'.$LineUser['LastLogin'].'</strong><br />');
    35   echo('Poslední IP: <strong>'.$LineUser['LastIP'].'</strong><br />');
    36   echo('Počet přeložených: <a href="TranslationList.php?user='.$_GET['user'].'&amp;action=userall" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$LineUser['TranslatedCount'].'</strong></a><br />');
    37   echo('Email: <strong>'.$LineUser['Email'].'</strong><br />');
     31  echo('ID: <strong>'.$User['ID'].'</strong><br />');
     32  echo('Jméno: <strong>'.$User['Name'].'</strong><br />');
     33  echo('Výchozí jazyk: <strong>'.$LanguageList[$User['Language']]['Name'].'</strong><br />');
     34  echo('Poslední připojení: <strong>'.$User['LastLogin'].'</strong><br />');
     35  echo('Poslední IP: <strong>'.$User['LastIP'].'</strong><br />');
     36  echo('Počet přeložených: <a href="TranslationList.php?user='.$User['ID'].'&amp;action=userall" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$User['TranslatedCount'].'</strong></a><br />');
     37  echo('Email: <strong>'.$User['Email'].'</strong><br />');
    3838  echo('<br />
    3939
    4040<form action="user.php" method="post"><div>
    4141Napsat E-mail:
    42 <input type="text" name="email" value="'.$LineUser['Email'].'" />
     42<input type="text" name="email" value="'.$User['Email'].'" />
    4343Předmět:
    4444<input type="text" name="subject" value="Projekt překládání textů WoW" />
  • trunk/userlist.php

    r352 r365  
    1111if(array_key_exists('search', $_GET))
    1212{
    13   $_SESSION['Where'] = ' WHERE `user`.`user` LIKE "%'.$_GET['search'].'%"';
     13  $_SESSION['Where'] = ' WHERE `User`.`User` LIKE "%'.$_GET['search'].'%"';
    1414}
    1515if(array_key_exists('team', $_GET))
    1616{
    17   $_SESSION['Where'] = ' WHERE team='.$_GET['team'];
     17  $_SESSION['Where'] = ' WHERE `Team`='.$_GET['team'];
    1818  if($_GET['team'] == '') $_SESSION['Where'] = '';     
    1919}
     
    2626//if($_SESSION['Where'] <> '') echo(' <a href="?action=nofilter">Zrušit filtr uživatelů</a><br />');
    2727
    28 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `user`'.$_SESSION['Where']);
     28$DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `User`'.$_SESSION['Where']);
    2929$DbRow = mysql_fetch_row($DbResult);
    3030$PageList = GetPageList($DbRow[0]);   
     
    3434
    3535$TableColumns = array(
    36   array('Name' => 'user', 'Title' => 'Jméno'),
     36  array('Name' => 'User', 'Title' => 'Jméno'),
    3737  array('Name' => 'TranslatedCount', 'Title' => 'Přeložených'),
    3838  array('Name' => 'XP', 'Title' => 'Úroveň'),
     
    4444
    4545
    46 $Query = 'SELECT `ID`, `user`.`user`, `LastLogin`, `GM`, `TranslatedCount` FROM `user` '.$_SESSION['Where'].$Order['SQL'].$PageList['SQLLimit'];
     46$Query = 'SELECT `ID`, `User`.`Name`, `LastLogin`, `GM`, `TranslatedCount` FROM `User` '.$_SESSION['Where'].$Order['SQL'].$PageList['SQLLimit'];
    4747
    4848$ID = $Database->SQLCommand($Query);
     
    5050{
    5151  if(Licence(LICENCE_MODERATOR))
    52     $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>';
    53     else $Name = $Line['user'];
     52    $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['Name'].'</a>';
     53    else $Name = $Line['Name'];
    5454       
    5555    echo('<tr><td>'.$Name.'</td>
    5656      <td style="text-align: center;"><a href="TranslationList.php?user='.$Line['ID'].'&amp;action=userall" title="Zobrazit Všechny jeho přeložené texty">'.$Line['TranslatedCount'].'</a></td>
    57       <td><img src="tmp/user/'.$Line['user'].'/level.png" alt="Úroveň uživatele" /></td>
     57      <td><img src="tmp/user/'.$Line['Name'].'/level.png" alt="Úroveň uživatele" /></td>
    5858      <td>'.$Moderators[$Line['GM']].'</td>
    5959      <td>'.HumanDate($Line['LastLogin']).'</td></tr>');
Note: See TracChangeset for help on using the changeset viewer.