update image server import files
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 5 Feb 2010 21:44:45 +0000 (21:44 +0000)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 5 Feb 2010 21:44:45 +0000 (21:44 +0000)
admin/Photos/export-images-is0.php

index faa8623..cae3c46 100755 (executable)
@@ -2,7 +2,7 @@
 require_once '../../setup.phtml';
 require_once BASE.'Toolkit/Image/Server.php';
 $db = new PDO('pgsql:'.CONN_STR);
-define('OLDORG', 'http://www.migcsa.org/testphoto/');
+define('OLDORG', 'http://www.troutcreek.com/images/photo-large/');
 $db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
 $sql = "
   SELECT id,image
@@ -32,19 +32,23 @@ if (is_array($data)) {
         $row['image'] = trim($row['image']);
             var_dump(OLDORG.$row['image']);
         if (!ereg("^is", $row['image'])) {
-            $image_URL = OLDORG.$row['image'];
-            $image = $IServer->imageUpload($image_URL);
-            if ($image) {
-                try {
-                    $stmt3->bindParam(":image", $image, PDO::PARAM_STR);
-                    $stmt3->bindParam(":id", $row['id'], PDO::PARAM_INT);
-                    $stmt3->execute();
-                } catch(PDOException $e) {
-                    die($e->getMessage());
+            try {
+                $image_URL = OLDORG.$row['image'];
+                $image = $IServer->imageUpload($image_URL);
+                if ($image) {
+                    try {
+                        $stmt3->bindParam(":image", $image, PDO::PARAM_STR);
+                        $stmt3->bindParam(":id", $row['id'], PDO::PARAM_INT);
+                        $stmt3->execute();
+                    } catch(PDOException $e) {
+                        die($e->getMessage());
+                    }
                 }
+                echo '<br>Image Name Returned: ';
+                var_dump($image);
+            } catch(PDOException $e) {
+                die($e->getMessage());
             }
-            echo '<br>Image Name Returned: ';
-            var_dump($image);
         }
     }
 }