OK, here is what I have so far - basically the same as what was posted before but this add support for captions and titles..plus some comments that might help.  I plan on working on this some more, but for now here you go:

<?php 
$baseURL = $_GET['baseURL'];
$parameters = array(
    'album' => $_GET['album'],
    'w' => $_GET['w'],
    'h' => $_GET['h'],
    's' => $_GET['s'],
    'q' => $_GET['q'],
    'sh' => $_GET['sh'],
    'tw' => $_GET['tw'],
    'th' => $_GET['th'],
    'ts' => $_GET['ts'],
    'tlw' => $_GET['tlw'],
    'tlh' => $_GET['tlh'],
    'tq' => $_GET['tq'],
    'tsh' => $_GET['tsh'],
    'pw' => $_GET['pw'],
    'ph' => $_GET['ph'],
    'aps' => $_GET['aps'] );


header('Content-type: application/xml');
$doc = new DOMDocument('1.0', 'iso-8859-1');
$sourceURL = $baseURL . "/images.php?" . http_build_query($parameters);
$doc->load( $sourceURL ); 

$images = array();

$xmlimages = $doc->getElementsByTagName( "img" );
foreach( $xmlimages as $xmlimage ) 
{ 
$images[] = array( 'id' => $xmlimage->getAttribute('id'),           //Image catalog id
                   'src' => $xmlimage->getAttribute('src'),         //Image url
                   'file' => $xmlimage->getAttribute('file'),       //Image file name
                   'tn' => $xmlimage->getAttribute('tn'),           //Thumbnail, hover
                   'tnsm' => $xmlimage->getAttribute('tnsm'),       //Thumbnail, navigation
                   'dims' => $xmlimage->getAttribute('dims'),       //Image dimensions, original
                   'fp' => $xmlimage->getAttribute('fp'),           //Image focal point
                   'target' => $xmlimage->getAttribute('target'),
                   'link' => $xmlimage->getAttribute('link'),
                   'tags' => $xmlimage->getAttribute('tags'),       //Image tags
                   'caption' => $xmlimage->getAttribute('caption'), //Image caption
                   'title' => $xmlimage->getAttribute('title'));    //Image title
}

$dom = new DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
 
$r = $dom->createElement( "juiceboxgallery" );
$dom->appendChild( $r );
 
foreach( $images as $image )
{
 $b = $dom->createElement( "image" );
 
 $title = $dom->createElement( "title" );
 $title->appendChild(  $dom->createTextNode( $image['title'] ) );
 $b->appendChild( $title );

 $caption = $dom->createElement( "caption" );
 $caption->appendChild(  $dom->createTextNode( $image['caption'] ) );
 $b->appendChild( $caption );

 $b->setAttribute( "imageURL", $baseURL . "/p.php?a=" . $image['src'] );
 $b->setAttribute( "thumbURL", $baseURL . "/p.php?a=" . $image['tn']  );
 $b->setAttribute( "linkURL", $baseURL . "/p.php?a=" . $image['src'] );
 $b->setAttribute( "linkTarget", $image['target'] );

 
 $r->appendChild( $b );

 }
 
 echo $dom->saveXML();
 $dom->save("config.xml")
?> 

-N

TOTAL INSANITY!  The problem was due to a problem in the original code posted by UrsusMaritimus.  The line:

 $title->appendChild(  $dom->createTextNode( $image['tag'] ) );

should be:

 $title->appendChild(  $dom->createTextNode( $image['tags'] ) );

The missing 's' on tags was throwing it off.  It works fine with encoded characters BTW.  If you go to my site here: http://nicholasbreslow.com/test/portfolio.html you can see it working.  Only the first two image/links are set up so far but they show different galleries being loaded.  Works really well - SWEET!

I am going to get to work on the captions next and will post back.  I think that some stuff fromt he original script is matched up wrong.  A little hard to tell but I think I have it sorted.

Thanks for your help!  Will be back to ask some more or at least let you know it is all setup properly.

-N

Thanks so much for the help - I appreciate it very much!

1) I set up the gallery two ways...

The gallery is located here as a PHP file:

http://nicholasbreslow.com/test/portfol … p?album=11

And the gallery is located here as an HTML file:

http://nicholasbreslow.com/test/portfol … l?album=11

Also, the index page is located here:

http://nicholasbreslow.com/test/portfolio.html

(Note: Only the first image 'square' is hyper-linked and it is set to go to the HTML version)

2) I tried what you suggested but got the following error:  Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /vservers/nicholasbres/htdocs/test/portfolio.viewer.php on line 94 

I think there is an extra space in your code:

config.php?album=<?php echo $ _GET["album"]; ?>

I changed it to (removed space between $ and _) and got:

config.php?album=<?php echo $_GET["album"]; ?>

It seemed to work, at least I am back to getting the spinner and not the error code.

Regarding the document type - I was able to keep my previous index page as html while passing the variable before (see http://www.nicholasbreslow.com/photography.html).  Anyway I tried http://nicholasbreslow.com/test/portfolio.php and that didn't work either.  Maybe I need a certain doctype?

3) Will test that out and report back.

Thanks again, look forward to getting this sorted. :)

-Nick

PS - I am actually a Pro license owner.  I just posted in this forum as a follow up to the Director post.  Hope that is OK.

Hi,

First - great script and thanks for sharing it with everyone.  I am a Slideshow Pro Director/Player user who is also looking to use Director to manage content and Juicebox to display it.  I ran into an issue and have a question or two so hopefully someone can help...

1) I followed the instructions to a T and have had partial success.  The config.php script runs successfully and the config.xml based on my SSP Director content is created.  However it does not pass the newly generated config.xml through to Juicebox - the slideshow never appears and I am left with the spinner.  I know the config.xml generated from SSP Director is created properly because I can re-set the configURL to 'config.xml' and the SSP Director content loads fine.  I am no coder but it seems like there might be something missing at the end of the config.php script posted that will echo the newly created config.xml path so it loads?  Any thoughts?

2)  I wanted to make one tweak to the SSP configURL posted here and was hoping someone could help.  I am hoping to structure my setup as follows:

-Index page that contains a series of links to albums.  The links pass the album variable via php through the url.  Example link:

http://www.mydomainname.com/portfolio.viewer.php?album=11

-Viewer page that contains one Juicebox instance.  The embed code takes the album variable from the url.  Example:

configUrl : 'config.php?album=(GET ALBUM NUMBER FROM URL)&w=800&h=600&s=0&q=80&sh=1&tw=100&th=100&ts=0&tlw=50&tlh=50&tq=60&tsh=1&pw=54&ph=40&aps=0&baseURL=http%3A%2F%2Fdomain.name%2Fssp_director'

I am wondering what I would have to change in the configUrl (where I wrote (GET ALBUM NUMBER FROM URL)) to make this happen?  Something like: $ _GET["album"]?  Would I wrap it in brackets or parenthesis?  Not sure.

3) I was hoping that the original author of the script could post a link or explain what the variables in his configUrl mean in regards to what is being requested from SSP Director.  I understand the basic ones like w (width) and h (height), but some of the others (pw and ph?) are a bit of a mystery.  Also, are captions supported in the script?  If not, could they be?

Great stuff and I hope to hear back - looking forward to getting this up and running.  Thanks in advance,

-Nick

PS: You can see my current setup using SSP Director and SSP Flash Player here: http://www.nicholasbreslow.com/photography.html.  It is basically the same setup as what I am going for in #2 above except I will be using Juicebox on the viewer page.