Changeset 363
- Timestamp:
- Mar 8, 2010, 1:54:55 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r349 r363 297 297 $Value['ShortCut'] = trim($LineParts2[0]); 298 298 $Value['Text'] = substr(trim($LineParts2[1]), 1, -1); 299 $Value['Comment'] = addslashes(substr(trim($LineParts[1]), 3));300 301 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (ShortCut="'.$Value['ShortCut'].'") AND (VersionStart <= '.$this->ClientVersion['BuildNumber'].') AND (VersionEnd >= '.$this->ClientVersion['BuildNumber'].')'.$this->OrderByUserList.') AS T GROUP BY T.entry';299 $Value['Comment'] = substr(trim($LineParts[1]), 3); 300 301 $Query = 'SELECT * FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`ShortCut`="'.$Value['ShortCut'].'") AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'.$this->OrderByUserList.') AS `T` GROUP BY `T`.`entry`'; 302 302 //echo($Query); 303 303 $DbResult2 = $this->Database->query($Query); … … 305 305 { 306 306 $DbRow = $DbResult2->fetch_assoc(); 307 $Value['Text'] = $DbRow['Text'];308 $Value['Comment'] = $DbRow['Comment'];307 $Value['Text'] = addslashes($DbRow['Text']); 308 $Value['Comment'] = addslashes($DbRow['Comment']); 309 309 //echo('.'); 310 310 } … … 315 315 } else $File2->WriteLine($Line."\n"); 316 316 } 317 echo('Hotovo <br 317 echo('Hotovo <br/>'); 318 318 } 319 319 } -
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.