Changeset 476 for trunk/export/export.php
- Timestamp:
- Apr 25, 2010, 1:12:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r460 r476 112 112 $Values = substr($Values, 2); 113 113 114 // Get multicolumn index 114 115 $ColumnItems = explode(',', $Group['MangosTableIndex']); 115 116 if(count($ColumnItems) > 1) … … 121 122 } else $Where = '`'.$Group['MangosTableIndex'].'`'; 122 123 $Where .= ' = "'.$Line[$Group['PrimaryKeyItem']].'";'; 124 123 125 $Line = 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE '.$Where; 124 126 $Line = str_replace("\n", '\n', $Line); … … 266 268 $DbResult2 = $this->Database->query($this->BuildQuery($Group)); 267 269 while($DbRow = $DbResult2->fetch_assoc()) 268 $LookupTable[$DbRow[ 'Entry']] = $DbRow;270 $LookupTable[$DbRow[$Group['PrimaryKeyItem']]] = $DbRow; 269 271 270 272 // Open original DBC file … … 288 290 { 289 291 $Line = $SourceDBCFile->GetLine($Row); 290 foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem) 291 { 292 if(array_key_exists($GroupItem['Id'], $ColumnIndexes) and array_key_exists($Line[0], $LookupTable)) 293 $Line[$ColumnIndexes[$GroupItem['Id']]] = $LookupTable[$Line[0]][$GroupItem['Column']]; 292 293 // Get multicolumn index value 294 $PrimaryKeyItem = ''; 295 $ColumnItems = explode(',', $Group['DBCIndex']); 296 if(count($ColumnItems) > 1) 297 { 298 foreach($ColumnItems as $ColumnItem) 299 $PrimaryKeyItem .= $Line[$ColumnItem].'_'; 300 $PrimaryKeyItem = substr($PrimaryKeyItem, 0, -1); 301 } else $PrimaryKeyItem = $Line[$Group['DBCIndex']]; 302 303 if(array_key_exists($PrimaryKeyItem, $LookupTable)) 304 { 305 // Replace text columns 306 $LookupTableItem = $LookupTable[$PrimaryKeyItem]; 307 foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem) 308 { 309 if(array_key_exists($GroupItem['Id'], $ColumnIndexes)) 310 $Line[$ColumnIndexes[$GroupItem['Id']]] = $LookupTableItem[$GroupItem['Column']]; 311 } 294 312 } 295 313 $NewDBCFile->SetLine($Row, $Line);
Note:
See TracChangeset
for help on using the changeset viewer.