Ignore:
Timestamp:
Apr 8, 2010, 7:58:16 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Doplněny upravené soubory do vývojové větve CombinedTextTables.
  • Nastavení ignorování obsahu složek s ikonami u AoWoW.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CombinedTextTables/save.php

    r420 r425  
    1010$GroupId = LoadGroupIdParameter();
    1111$Group = $TranslationTree[$GroupId];
    12 $Table = $Group['TablePrefix'];
    1312if($User->Licence(LICENCE_USER))
    1413{
     
    2221   
    2322    // Get source text record from database by ID
    24     $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID`='.$TextID);
     23    $DbResult = $System->Database->query('SELECT * FROM `Translation` WHERE (`Id`='.$TextID.') AND (`Group` = '.$Group['Id'].')');
    2524    if($DbResult->num_rows > 0)
    2625    {
     
    2827     
    2928      // Get data for english original
    30       $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') AND (`Language` = 0) AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');
    31       if($DbResult->num_rows > 0)
     29      $DbResult = $System->Database->query('SELECT * FROM `Translation` WHERE (`Entry`='.$SourceText['Entry'].') AND (`Language` = 0) AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].') AND (`Group` = '.$Group['Id'].')');
     30      if($DbResult->num_rows > 0) 
    3231      {
    3332        $EnglishText = $DbResult->fetch_assoc();
     
    3938            $Filter .= ' AND (`'.$GroupItem['Column'].'` = "'.$EnglishText[$GroupItem['Column']].'")';
    4039       
    41         $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0)'.$Filter);
     40        $DbResult = $System->Database->query('SELECT * FROM `Translation` WHERE (`Language` = 0) AND (`Group` = '.$Group['Id'].')'.$Filter);
    4241        while($DbRow = $DbResult->fetch_assoc())
    4342        {         
    4443          // Get user translation paired to found english item entry
    45           $DbResult2 = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id.') AND (`Entry` = '.$DbRow['Entry'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');
     44          $DbResult2 = $System->Database->query('SELECT * FROM `Translation` WHERE (`User` = '.$User->Id.') AND (`Entry` = '.$DbRow['Entry'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].') AND (`Group` = '.$Group['Id'].')');
    4645          if($DbResult2->num_rows > 0)
    4746          {
     
    5655           
    5756            // Update user translation
    58             $System->Database->query('UPDATE `'.$Table.'` SET '.$Values.' WHERE `ID` = '.$ExistedText['ID']);
     57            $System->Database->query('UPDATE `Translation` SET '.$Values.' WHERE `ID` = '.$ExistedText['ID']);
    5958           
    6059            echo('Změny v překladu <a href="form.php?group='.$GroupId.'&amp;ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy!<br />');
     
    6362          {
    6463            // Insert new user translation
    65             $Columns = '`Entry`, `VersionStart`, `VersionEnd`, `Language`, `Complete`, `User`, `Take`';
    66             $Values = $DbRow['Entry'].', '.$DbRow['VersionStart'].', '.$DbRow['VersionEnd'].', '.$Language.', '.$Complete.', '.$User->Id.', '.$SourceText['ID'];
     64            $Columns = '`Group`, `Entry`, `VersionStart`, `VersionEnd`, `Language`, `Complete`, `User`, `Take`';
     65            $Values = $DbRow['Group'].', '.$DbRow['Entry'].', '.$DbRow['VersionStart'].', '.$DbRow['VersionEnd'].', '.$Language.', '.$Complete.', '.$User->Id.', '.$SourceText['ID'];
    6766            foreach($Group['Items'] as $GroupItem)
    6867            {
     
    8281              }
    8382            }
    84             $System->Database->query('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')');
     83            $System->Database->query('INSERT INTO `Translation` ('.$Columns.') VALUES ('.$Values.')');
    8584            $LastID = $System->Database->insert_id;
    8685           
Note: See TracChangeset for help on using the changeset viewer.