Closed (duplicate)
Project:
Wordpress Import
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
22 Jan 2009 at 10:42 UTC
Updated:
3 Nov 2009 at 18:44 UTC
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/)
| Comment | File | Size | Author |
|---|---|---|---|
| wordpress_import.zip | 7.28 KB | walktalker |
Comments
Comment #1
walktalker commentedComment #2
walktalker commentedI'm not so superb about webserver > webserver file transfer. could anyone include this in the module?
Comment #3
yrocq commentedHi 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.
Comment #4
walktalker commentedI 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.
Comment #5
lavamind commentedFetching 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.
Comment #6
lavamind commentedMarking duplicate of #206749: Add attachments support