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
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/)

AttachmentSize
wordpress_import.zip7.28 KB

#1

walktalker - January 23, 2009 - 12:08
Assigned to:walktalker» Anonymous

#2

walktalker - January 23, 2009 - 12:10

I'm not so superb about webserver > webserver file transfer. could anyone include this in the module?

#3

yrocq - January 24, 2009 - 00:15
Status:active» needs work

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

walktalker - January 24, 2009 - 10:46

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

lavamind - October 28, 2009 - 00:24
Version:6.x-1.x-dev» 6.x-2.x-dev
Assigned to:Anonymous» lavamind
Status:needs work» active

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

lavamind - November 3, 2009 - 18:44
Status:active» duplicate

Marking duplicate of #206749: Add attachments support

 
 

Drupal is a registered trademark of Dries Buytaert.