Changeset 431 for trunk


Ignore:
Timestamp:
Apr 8, 2010, 8:49:29 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Zobrazovat v nabídce ostatních variant překladů jen dokončené a nezobrazovat vlastní překlad.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/TranslationList.php

    r430 r431  
    263263function SearchEntry()
    264264{
    265   global $Table;
     265  global $Table, $System;
    266266 
    267267  if(array_key_exists('ID', $_GET) and is_numeric($_GET['ID'])) $Search = $_GET['ID'];
    268268  else if(array_key_exists('ID', $_POST) and is_numeric($_POST['ID'])) $Search = $_POST['ID'];
    269   else $Search = '';
    270  
    271   $sql = 'SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` LIKE "'.$Search.'")'.
    272   ' AND ((`Language` = 0) OR ((`Complete` = 1) AND (`Language` != 0)))'; // Do not show uncompleted user translation
     269  else ErrorMessage('Nebylo zadáno ID položky');
     270 
     271  $DbResult = $System->Database->query('SELECT `Entry` FROM `'.$Table.'` WHERE `ID`='.$Search);
     272  if($DbResult->num_rows > 0)
     273  {
     274    $DbRow = $DbResult->fetch_assoc();
     275    $sql = 'SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$DbRow['Entry'].')'.
     276  ' AND (`Complete` = 1) AND (`Language` != 0) AND (`ID` != '.$Search.')'; // Do not show uncompleted user translation
    273277   
    274   WriteQuests($sql);
     278    WriteQuests($sql);
     279  } else echo('Položka nenalezena');
    275280}
    276281
  • trunk/form.php

    r420 r431  
    6363  echo('<br />');
    6464   
    65   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE `Entry` = '.$Line['Entry'].' AND `Language` <> 0');
     65  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> 0) AND (`Complete` = 1) AND (`ID` <> '.$Line['ID'].')');
    6666  $Version = mysql_fetch_row($DbResult);
    6767  $Version = $Version[0];
    6868  if($Version > 0)
    6969  {
    70     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> 
     70    echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['ID'].'">Počet verzí: <strong>'.$Version.'</strong></a> 
    7171      <input type="hidden" name="group" value="'.$GroupId.'" />
    7272      <input type="hidden" name="entry" value="'.$Line['Entry'].'" />
     
    7575      <option value="-1">Vyberte text k porovnání</option>
    7676      <option value="-1">Zobrazit/porovnat všechny</option>');
    77     $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'].')'); 
     77    $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'].') AND (`Complete` = 1)'); 
    7878    while($version = mysql_fetch_array($DataID))
    7979    {     
Note: See TracChangeset for help on using the changeset viewer.