update for ht_image paths
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 14 Aug 2015 15:16:23 +0000 (11:16 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 14 Aug 2015 15:16:23 +0000 (11:16 -0400)
controllers/Import.php

index 9e48baf..18abce9 100644 (file)
                                 echo '<pre>Sub Src Match: ' . print_r($srcMatch[1], true)  . '</pre>';
                                 $fileName = basename($srcMatch[1]);
                                 echo '<pre>File Name: ' . print_r($fileName, true)  . '</pre>';
+                                $path = str_replace($fileName, '', $srcMatch[1]);
                                 $imagesKey = $this->_getAttachmentByName($fileName);
                                 var_dump($imagesKey);
                                 if (!$imagesKey) {
                                         $fileName,
                                         '',
                                         $post->ID,
-                                        $this->_options['toolbox_image_url'] . '/tbs1/'
+                                        $path
                                     );
                                 }
                                 if ($imagesKey) {
                             if (preg_match('%src="([^"]+)"%', $matches[1][$index], $srcMatch)) {
                                 echo '<pre>Sub Src Match: ' . print_r($srcMatch[1], true)  . '</pre>';
                                 $fileName = basename($srcMatch[1]);
+                                echo '<pre>File Url: ' . print_r($srcMatch[1], true)  . '</pre>';
                                 echo '<pre>File Name: ' . print_r($fileName, true)  . '</pre>';
+                                $path = str_replace($fileName, '', $srcMatch[1]);
+                                echo '<pre>File Path: ' . print_r($path, true)  . '</pre>';
                                 $imagesKey = $this->_getAttachmentByName($fileName);
                                 var_dump($imagesKey);
                                 if (!$imagesKey) {
                                         $fileName,
                                         '',
                                         $post->ID,
-                                        $this->_options['toolbox_image_url'] . '/tbs1/'
+                                        $path
                                     );
                                 }
                                 if ($imagesKey) {
                 echo '<p>Phase Three</p>';
                 $this->_updateMediaSrc();
                 echo '<p>Done</p>';
+                echo '<p><a href="admin.php?import=toolbox&amp;step=4">Step Four (Updating Files Ref)</a></p>';
                 break;
             case 4:
                 echo '<p>Phase Four</p>';
                 echo '<p>Files</p>';
-                //$this->_updateFilesHref();
+                $this->_updateFilesHref();
+                echo '<p>Done</p>';
+                echo '<p><a href="admin.php?import=toolbox&amp;step=5">Step Five (Updating Url\'s and keywords)</a></p>';
+            case 5:
+                echo '<p>Phase Five</p>';
                 echo '<p>Site Url</p>';
                 // Replace the page Url's
                 $this->_replaceUrls();
                 $this->_replaceKeywords();
                 echo '<p>Done</p>';
                 break;
-            case 5:
-                echo '<p>Reset</p>';
-                $this->_post = $this->_images = $this->_files = array();
-                $this->_storePost();
-                $this->_storeImages();
-                $this->_storeFiles();
-                break;
             }
 
             $this->_footer();