suggestion to include file fetch
walktalker - January 22, 2009 - 10:42
| Project: | Wordpress Import |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | lavamind |
| Status: | duplicate |
Jump to:
Description
in line 605 of wordpress_import.module
include this to alias the files/images location
$thepath = url(file_directory_path());
$subpath = "/images";
$myURL = $thepath . $subpath;
$content = str_replace('/wp-content/uploads', $myURL , $content);then copy the whole folder of wp-content/uploads from wordpress folder to drupal file directory path (e.g. sites/all/default/)
| Attachment | Size |
|---|---|
| wordpress_import.zip | 7.28 KB |

#1
#2
I'm not so superb about webserver > webserver file transfer. could anyone include this in the module?
#3
Hi walktalker,
Thanks for your interest in wordpress import.
Your code is a nice workaround, but I'm afraid it isn't robust enough to be integrated into the module. If a post contains the phrase "Wordpress stores its files in the directory /wp-content/uploads", it will be replaced by "Wordpress stores its files in the directory /sites/example/files/images". Furthermore, I think a better approach would be to create a customisable filter, so that the original content won't be changed and we will be able to support special cases, for example a drupal installed in a subdirectory.
#4
I agree with you. I never think to write a module would be that hard... ^.^
Anyway, this is my 1st trial to work around a module. I'd need to learn more about creating a form to gather more var.
#5
Fetching post images is implemented using cURL in 6.x-2.x-dev, removing need to manually transfer files. However, other types of content aren't transferred, though a similar approach could eventually be used for attachements.
#6
Marking duplicate of #206749: Add attachments support