From 489d2312603c02b1a856626f453c53dc677b50af Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 14 Aug 2015 11:16:23 -0400 Subject: [PATCH] update for ht_image paths --- controllers/Import.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/controllers/Import.php b/controllers/Import.php index 9e48baf..18abce9 100644 --- a/controllers/Import.php +++ b/controllers/Import.php @@ -1016,6 +1016,7 @@ echo '
Sub Src Match: ' . print_r($srcMatch[1], true)  . '
'; $fileName = basename($srcMatch[1]); echo '
File Name: ' . print_r($fileName, true)  . '
'; + $path = str_replace($fileName, '', $srcMatch[1]); $imagesKey = $this->_getAttachmentByName($fileName); var_dump($imagesKey); if (!$imagesKey) { @@ -1024,7 +1025,7 @@ $fileName, '', $post->ID, - $this->_options['toolbox_image_url'] . '/tbs1/' + $path ); } if ($imagesKey) { @@ -1053,7 +1054,10 @@ if (preg_match('%src="([^"]+)"%', $matches[1][$index], $srcMatch)) { echo '
Sub Src Match: ' . print_r($srcMatch[1], true)  . '
'; $fileName = basename($srcMatch[1]); + echo '
File Url: ' . print_r($srcMatch[1], true)  . '
'; echo '
File Name: ' . print_r($fileName, true)  . '
'; + $path = str_replace($fileName, '', $srcMatch[1]); + echo '
File Path: ' . print_r($path, true)  . '
'; $imagesKey = $this->_getAttachmentByName($fileName); var_dump($imagesKey); if (!$imagesKey) { @@ -1062,7 +1066,7 @@ $fileName, '', $post->ID, - $this->_options['toolbox_image_url'] . '/tbs1/' + $path ); } if ($imagesKey) { @@ -1336,11 +1340,16 @@ echo '

Phase Three

'; $this->_updateMediaSrc(); echo '

Done

'; + echo '

Step Four (Updating Files Ref)

'; break; case 4: echo '

Phase Four

'; echo '

Files

'; - //$this->_updateFilesHref(); + $this->_updateFilesHref(); + echo '

Done

'; + echo '

Step Five (Updating Url\'s and keywords)

'; + case 5: + echo '

Phase Five

'; echo '

Site Url

'; // Replace the page Url's $this->_replaceUrls(); @@ -1348,13 +1357,6 @@ $this->_replaceKeywords(); echo '

Done

'; break; - case 5: - echo '

Reset

'; - $this->_post = $this->_images = $this->_files = array(); - $this->_storePost(); - $this->_storeImages(); - $this->_storeFiles(); - break; } $this->_footer(); -- 2.17.1