Changeset 216 for trunk/import/import_lua.php
- Timestamp:
- Jun 24, 2009, 10:30:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/import/import_lua.php
r215 r216 1 1 <?php 2 3 function HaveSameText($Group, $DbRow2, $Value)4 {5 $result = true;6 foreach($Group['Items'] as $GroupItem)7 {8 $old = $DbRow2[$GroupItem['Column']];9 $old = str_replace(chr(10), '', $old);10 $old = str_replace(chr(13), '', $old);11 $old = str_replace('\n', '', $old);12 $old = str_replace('\r', '', $old);13 $old = str_replace('\"', '"', $old);14 $old = str_replace('\\\\', '\\', $old);15 $old = str_replace('\32', '32', $old);16 $old = str_replace('\124', '124', $old);17 18 $new = $Value[$GroupItem['Column']];19 $new = str_replace(chr(10), '', $new);20 $new = str_replace(chr(13), '', $new);21 $new = str_replace('\n', '', $new);22 $new = str_replace('\r', '', $new);23 $new = str_replace('\"', '"', $new);24 $new = str_replace('\\\\', '\\', $new);25 $new = str_replace('\32', '32', $new);26 $new = str_replace('\124', '124', $new);27 28 if(($old <> $new) and ($GroupItem['Column'] <> 'Comment'))29 {30 // echo $old.'-'.$new;31 $result = false;32 }33 }34 return($result);35 }36 2 37 3 function ImportLUA($import_version) 38 4 { 39 5 global $Database, $TranslationTree, $PatchVersion, $Config; 6 $BuildNumber = GetBuildNumber($import_version); 40 7 41 8 echo('Načítání textů z LUA souborů...'); … … 74 41 if(HaveSameText($Group, $DbRow2, $Value)) 75 42 { 76 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET VersionEnd = "'.GetBuildNumber($import_version).'" WHERE ID='.$DbRow2['ID']); 43 if ($DbRow2['VersionEnd'] <> $BuildNumber) { 44 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET VersionEnd = "'.$BuildNumber.'" WHERE ID='.$DbRow2['ID']); 45 echo(', '); 46 } else 47 echo('. '); 77 48 } else 78 49 { 79 50 $Columns = 'entry, language, VersionStart, VersionEnd'; 80 $Values = $DbRow2['entry'].', 0, '. GetBuildNumber($import_version).', '.GetBuildNumber($import_version);51 $Values = $DbRow2['entry'].', 0, '.$BuildNumber.', '.$BuildNumber; 81 52 foreach($Group['Items'] as $GroupItem) 82 53 { … … 89 60 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.$DbRow2['ID'].'">'.$DbRow2['ID'].'</a> ('.$DbRow2['entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', 11); 90 61 } 91 echo('. ');92 62 } else 93 63 { … … 101 71 } 102 72 $Columns = 'entry, language, VersionStart, VersionEnd'; 103 $Values = $Entry.', 0, '. GetBuildNumber($import_version).', '.GetBuildNumber($import_version);73 $Values = $Entry.', 0, '.$BuildNumber.', '.$BuildNumber; 104 74 foreach($Group['Items'] as $GroupItem) 105 75 { … … 108 78 } 109 79 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 110 echo(' #');80 echo('+ '); 111 81 $NewCount++; 112 82 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.$DbRow2['ID'].'</a> ('.$Entry.') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' přidán.', 11);
Note:
See TracChangeset
for help on using the changeset viewer.