Changeset 488 for trunk/export
- Timestamp:
- Aug 24, 2010, 10:31:50 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r476 r488 347 347 while($DbRow = $DbResult2->fetch_assoc()) 348 348 $LookupTable[$DbRow['ShortCut']] = $DbRow; 349 //print_r($LookupTable); 349 350 350 351 while(!$File->EOF()) … … 353 354 if(strpos($Line, '=') !== false) 354 355 { 355 $LineParts = explode(';', $Line); 356 $LineParts2 = explode('=', $LineParts[0]); 357 $Value['ShortCut'] = trim($LineParts2[0]); 358 $Value['Text'] = substr(trim($LineParts2[1]), 1, -1); 359 $Value['Comment'] = substr(trim($LineParts[1]), 3); 356 $LineParts = explode('=', $Line, 2); 357 $Value['ShortCut'] = trim($LineParts[0]); 358 $Line = trim($LineParts[1]); 359 if($Line[0] == '"') 360 { 361 // Quoted string value 362 $Line = substr($Line, 1); // Skip start qoute 363 $TempLine = str_replace('\"', ' ', $Line); // Temporary remove slashed quotes 364 $Value['Text'] = substr($Line, 0, strpos($TempLine, '"')); 365 // $Value['Text'] = str_replace('\n', "\n", $Value['Text']); 366 // $Value['Text'] = addslashes(stripslashes($Value['Text'])); 367 $Line = trim(substr($Line, strpos($TempLine, '"') + 1)); // Skip closing quote and semicolon { 368 } else 369 { 370 // Nonstring value 371 $Value['Text'] = substr($Line, 0, strpos($Line, ';')); 372 } 373 $Line = substr($Line, strpos($Line, ';') + 1); 374 $Value['Comment'] = addslashes(stripslashes(substr($Line, 3))); // Skip " --" 360 375 361 376 if(array_key_exists($Value['ShortCut'], $LookupTable)) … … 373 388 } 374 389 $NewLine = $Value['ShortCut'].' = "'.$Value['Text'].'";'; 375 if($Value['Comment'] != '') $NewLine .= ' -- '.$Value['Comment'];376 $NewLine .= "\ n";390 //if($Value['Comment'] != '') $NewLine .= ' -- '.$Value['Comment']; 391 $NewLine .= "\r\n"; 377 392 $File2->WriteLine($NewLine); 378 393 } else $File2->WriteLine($Line);
Note:
See TracChangeset
for help on using the changeset viewer.