Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. //Photos bit...
  2. $destination = 'tmp/ebay';
  3. $filename = 'ebay-photos';
  4.  
  5. //images array
  6. $row = array();
  7. foreach ($result->images as $images) {
  8. $images = explode(',', $row['images']);
  9. foreach ( $images as $image ) {
  10. copy('uploads/used-cars/autotrader/' . $image, $destination . $image);
  11. $all_images[] = $image;
  12. }
  13. }
  14.  
  15. exec('zip -g0 ' . $zip_filename . ' *.jpg *.jpeg');
  16. foreach ( $all_images as $image ) {
  17. @unlink($destination.$image);
  18. }
  19. $zip_filename = $filename . '.zip';
  20.  
  21. while ($row = @mysql_fetch_assoc($result)){
  22. $all_images->images as $images);
  23. }
  24.  
  25. while ($row = @mysql_fetch_assoc($result)){
  26. // XML
  27. $node = $dom->createElement("ad");
  28. $newnode = $parnode->appendChild($node);
  29. $newnode->setAttribute("vrm",$row['vrm']);
  30. $newnode->setAttribute("make",$row['make']);
  31. $newnode->setAttribute("model",$row['model']);
  32. $newnode->setAttribute("type",$row['type']);
  33. $newnode->setAttribute("consumerPrice",$row['consumerPrice']);
  34. $newnode->setAttribute("numPreviousOwners",$row['numPreviousOwners']);
  35. $newnode->setAttribute("transmission",$row['transmission']);
  36. $newnode->setAttribute("images",$row['images']);
  37. $newnode->setAttribute("numPreviousOwners",$row['numPreviousOwners']);
  38. $newnode->setAttribute("color",$row['color']);
  39. }
  40.  
  41. $dom->save('tmp/ebay/ebay.xml');
  42. echo $dom->saveXML();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement