Trying to work with phpZenfolio library, stuck (maybe?) on authentication.

In a nutshell I'm trying to export 3,000 images from a Gallery2 installation into Zenfolio.

I've written the routines to pull everything I need out of Gallery2's database, but none of the function calls in the phpZenfolio library seem to work, other than the ones that don't require login.

After I authenticate within this loop ...
require_once("phpZenfolio.php"); try { $f = new phpZenfolio("AppName=Gallery2ExportTester", "APIver=1.6"); $f->login("Username=$zenfolioUserName", "Password=$zenfolioPassword","Plaintext=TRUE"); ... } catch(Exception $e) { echo "{$e->getMessage()} (Error Code: {$e->getCode()})"; }

I can run
$key = $f->GetVisitorKey(); echo $key;

And get back something that looks like a key.

Or this
$gallery = $f->GetRecentPhotos(0,4); print_r($gallery);

And get back an array of information about (someone else's) images.

However this:
$updateTest = $f->UpdatePhoto('p637226771', array('Title'=>"BRT Logo")); print_r($updateTest);

Or this
$newImg = $f->upload("PhotoSetId=p637226771", "File=/var/www/appdata/g2data/albums/shu_only/People/Ziccardi.jpg","modified=Wed, 29 Oct 2014 15:21:48 -0400");

Throws back "Zenfolio API Error for method UpdatePhoto: : An unexpected error has occurred. Please try again later. If this problem persists, contact Support. (Error Code: -2)"

Where I'm trying to get is, I have all this Gallery2 information structured so I can loop through each gallery in turn, create it, then add new images or sub-galleries within it, then move on to the next. It should be a matter of a few simple function calls for each element.

Thoughts welcome.

Sign In or Register to comment.