Changeset 365 for trunk/form.php


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ů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.