Changeset 363 for trunk/import
- Timestamp:
- Mar 8, 2010, 1:54:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/import/import_lua.php
r357 r363 4 4 { 5 5 global $Database, $TranslationTree, $PatchVersion, $Config; 6 6 7 $BuildNumber = GetBuildNumber($import_version); 7 8 … … 24 25 $LineParts2 = explode('=', $LineParts[0]); 25 26 $Value['ShortCut'] = trim($LineParts2[0]); 26 $Value['Text'] = substr(trim($LineParts2[1]), 1, -1);27 $Value['Comment'] = addslashes(s ubstr(trim($LineParts[1]), 3));27 $Value['Text'] = addslashes(stripslashes(substr(trim($LineParts2[1]), 1, -1))); 28 $Value['Comment'] = addslashes(stripslashes(substr(trim($LineParts[1]), 3))); 28 29 29 30 $Columns = ''; 30 31 foreach($Group['Items'] as $GroupItem) 31 32 { 32 $Columns .= ', '.$GroupItem['Column'].'';33 $Columns .= ', `'.$GroupItem['Column'].'` '; 33 34 } 34 35 $Columns = substr($Columns, 1); 35 36 36 $DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE ShortCut="'.$Value['ShortCut'].'" AND (Language=0) ORDER BY VersionStartDESC LIMIT 1');37 $DbResult2 = $Database->SQLCommand('SELECT `VersionEnd`, `ID`, `entry`, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE `ShortCut`="'.$Value['ShortCut'].'" AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1'); 37 38 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 38 39 { … … 41 42 if(HaveSameText($Group, $DbRow2, $Value)) 42 43 { 43 if ($DbRow2['VersionEnd'] <> $BuildNumber) { 44 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET VersionEnd = "'.$BuildNumber.'" WHERE ID='.$DbRow2['ID']); 45 echo(', '); 46 } else 47 echo('. '); 44 if($DbRow2['VersionEnd'] <> $BuildNumber) 45 { 46 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = "'.$BuildNumber.'" WHERE `ID`='.$DbRow2['ID']); 47 echo(', '); 48 } else 49 echo('. '); 48 50 } else 49 51 { 50 $Columns = ' entry, language, VersionStart, VersionEnd';52 $Columns = '`entry`, `language`, `VersionStart`, `VersionEnd`'; 51 53 $Values = $DbRow2['entry'].', 0, '.$BuildNumber.', '.$BuildNumber; 52 54 foreach($Group['Items'] as $GroupItem) … … 69 71 $Entry += $DbRow[0]; 70 72 } 71 $Columns = ' entry, language, VersionStart, VersionEnd';73 $Columns = '`entry`, `language`, `VersionStart`, `VersionEnd`'; 72 74 $Values = $Entry.', 0, '.$BuildNumber.', '.$BuildNumber; 73 75 foreach($Group['Items'] as $GroupItem)
Note:
See TracChangeset
for help on using the changeset viewer.