CMS & Slideshow Pro (LR2)

25 posts by 7 authors in: Forums > CMS Builder
Last Post: June 6, 2010   (RSS)

By Jason - April 28, 2010

Hi,

So, when you are getting your information from the database:
list($multi_photo_galleryRecords, $multi_photo_galleryMetaData) = getRecords(array(
'tableName' => 'multi_photo_gallery',
));


are you only expecting to return a single record?
If so, try putting this line just below the above:

$multi_photo_galleryRecord=$multi_photo_galleryRecords[0];

Give that a try and let me know if that works for you.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] CMS & Slideshow Pro (LR2)

By sublmnl - April 28, 2010

OK well that worked in the sense that a page renders....
but I'm about to pull my hair out.
Even though I am directly asking for the multi_photos.xml.php file in the HTML source code
the photos that show in the SSP on screen are for the single editor which uses: photos.xml.php

WTheck?

By Jason - April 28, 2010

Could you provide a link to the file you're using?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By sublmnl - June 6, 2010

Back on this inbetween other projects and Jason and Chris have both helped me finish this.
Much thanks to the both of them for their patience and also finding stupid oversights.... well I guess when you're looking at so much code you're bound to make dumb mistakes

I'll give you a few steps in no particular order:
(Disclaimer - all of these instructions are following as if you have already done the SSP/CMS integration instructions above)

Make a copy of this AC RunActiveContent.js like we did above and then I renamed it: AC_RunActiveContent_SSP_multi.js

why?

Well - dumb mistake number 1 - Jason showed me that the photogallery never changed because I overlooked the fact that we were calling in the XML file in the JS which is really unnecessary after all because you call it in the swf code too.
So copy it and that way you won't mess up the current photo gallery currently relying on the JS we were about to modify.
Here are the lines that I edited (about 190 lines down):

function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash", "FlashVars",
"xmlfile=http://YOURWEBSITE.com/xml/photos.xml.php&xmlfiletype=Default"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}


Now looks like this so that you have taken out the FLashVars and the XML file pathway.

function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"

);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}


Next step, make a Multi Editor in the CMS with these fields:

Album - Textfield
Description - TextBox
Thumbnail - Upload
Photos - Upload

Its up to you with SSP how big you want the Thumbnail so make your image size match.
Its also up to you on whether or not you want a custom location entered in the CMS for your images. In this case, I did.

Now for the real meat - the XML file.
I kept having issues trying to target the Thumbnail pathway and largepathway
but Jason pointed out that you gonna have to have it hard coded, no worries because its all gonna be in one place anyhow.

Make your usual call for the XML above this.....
<gallery>
<?php foreach ($multi_photo_galleryRecords as $record): ?>
<album title="<?php echo $record['title'] ?>" description="<?php echo $record['description'] ?>"
tnpath="/images/uploads/multi_gallery/thumb/" tn="<?php echo @$record['photos'][0]['thumbUrlPath'] ?>"
lgpath="/images/uploads/multi_gallery/">
<?php foreach ($record['photos'] as $upload): ?>
<img src="<?php echo $upload['filename'] ?>"
caption="<?php echo $upload['info1'] ?>" />
<?php endforeach ?>
</album>
<?php endforeach ?>
</gallery>


This is really what Dave was talking about by writing For Each around the album and the images.... Makes perfect sense now once all the bugs have been ironed out. There is one big For Each around the Albums, so that it repeats and there is a For Each around the Images.
Voila!

If you look closely the XML doesn't ask for "album".
Well that is the beauty of having a name that doesn't match the fieldname in the CMS or the XML. I changed the name for the client after I already had the XML code in place so that is why the XML gallery code ask for 'title'.

Now for the SWF - HTML code
Make sure you spit out the code generator from the CMS and put it above the <head> like normal with a few tweaks of course:
list($multi_photo_galleryRecords, $multi_photo_galleryMetaData) = getRecords(array(
'tableName' => 'multi_photo_gallery',
));
$multi_photo_galleryRecord=$multi_photo_galleryRecords[0];


Then in your SWF code call in your HTML, you spit it out like normal but behind the XML pathway call (flashvars) you must have the php code so it looks like this in the 3 or 4 places it ask for it....:
xmlfile=http://YOURWEBSITE.com/xml/multi_photos.xml.php?<?php echo $multi_photo_galleryRecord['num'] ?>

and thats it.
Thanks again IT staff.
No more request for new albums from clients.
One thing I noticed was either I'm on a slow connection or it seems to strain the system to run through so many records to display the SSP.
We'll find out as we get more records, You could always limit the upload count though.