I finally got a chance to re-apply fixes for shutterfly to my site, and noticed some things about yours vs. mine. In mine, I update the smarty template to keep the output in line and working (yours didn't work for me, not sure why).
Here's my fix, as I have in my site. It was partly my previous fix and partly yours.
view_photo.php, at line 220, change this:
To this:
if (strcmp($gallery->album->fields["print_photos"],"none") && !$gallery->session->offline && !$gallery->album->isMovie($id)) {
$photo = $gallery->album->getPhoto($GLOBALS["index"]);
$photoPath = $gallery->album->getAlbumDirURL("full");
$rawImage = $photoPath . "/" . $photo->image->name . "." . $photo->image->type;
$thumbImage= $photoPath . "/";
if ($photo->thumbnail) {
$thumbImage .= $photo->image->name . "." . "thumb" . "." . $photo->image->type;
} else if ($photo->image->resizedName) {
$thumbImage .= $photo->image->name . "." . "sized" . "." . $photo->image->type;
} else {
$thumbImage .= $photo->image->name . "." . $photo->image->type;
}
list($imageWidth, $imageHeight) = $photo->image->getRawDimensions();
if (strlen($adminCommands) > 0) {
$adminCommands .="
";
}
$adminCommands .= "document.sflyc4p.returl.value=document.location; document.sflyc4p.submit();return false">[print this photo on Shutterfly]";
}
view_photo.php, at line 284, change this:
if (!empty($xoops_imageid)) {
include XOOPS_ROOT_PATH.'/include/comment_view.php';
}
$breadcrumb["top"] = false;
ob_start();
To this:
if (!empty($xoops_imageid)) {
include XOOPS_ROOT_PATH.'/include/comment_view.php';
}
// Shutterfly form additional information
if (!strcmp($gallery->album->fields["print_photos"],"none") || $gallery->album->isMovie($id)) {
// no form
$xoopsTpl->assign('shutterfly_form', 'false');
} else {
$xoopsTpl->assign('shutterfly_form', 'true');
$photo = $gallery->album->getPhoto($GLOBALS["index"]);
$photoPath = $gallery->album->getAlbumDirURL("full");
$rawImage = $photoPath . "/" . $photo->image->name . "." . $photo->image->type;
$imbkprnt = $gallery->album->getCaption($index);
if (empty($imbkprnt)) {
$imbkprnt = makeAlbumUrl($gallery->session->albumName, $id);
}
$thumbImage= $photoPath . "/";
if ($photo->image->resizedName) {
$thumbImage .= $photo->image->resizedName . "." . $photo->image->type;
} else {
$thumbImage .= $photo->image->name . "." . $photo->image->type;
}
list($imageWidth, $imageHeight) = $photo->image->getRawDimensions();
$xoopsTpl->assign('rawImage', $rawImage);
$xoopsTpl->assign('imageHeight', $imageHeight);
$xoopsTpl->assign('imageWidth', $imageWidth);
$xoopsTpl->assign('thumbImage', $thumbImage);
$xoopsTpl->assign('imageCaption', $imbkprnt);
if ($gallery->album->fields["print_photos"] == "shutterfly without donation") {
$xoopsTpl->assign('gallery_pid', "C4P");
$xoopsTpl->assign('gallery_psid', "AFFL");
} else {
$xoopsTpl->assign('gallery_pid', "C4PP");
$xoopsTpl->assign('gallery_psid', "GALL");
}
}
$breadcrumb["top"] = false;
ob_start();
Then, at the very end of templates/xoopsgallery_viewphoto.html, add this:
<{if $shutterfly_form == "true"}>
<form name="sflyc4p" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="post">
<input type=hidden name=addim value="1">
<input type=hidden name=protocol value="SFP,100">
<input type=hidden name=pid value="<{$gallery_pid}>">
<input type=hidden name=psid value="<{$gallery_psid}>">
<input type=hidden name=referid value="gallery">
<input type=hidden name=returl value="this-gets-set-by-javascript-in-onClick">
<input type=hidden name=imraw-1 value="<{$rawImage}>">
<input type=hidden name=imrawheight-1 value="<{$imageHeight}>">
<input type=hidden name=imrawwidth-1 value="<{$imageWidth}>">
<input type=hidden name=imthumb-1 value="<{$thumbImage}>">
<input type=hidden name=imbkprnta-1 value="<{$imageCaption}>">
form>
<{/if}>
Be sure to update your module after changing the template.
I'll be including this in my updated XoopsGallery that I hope to bundle up sometime soon (still some more fixes to apply).
Note that I still see a problem with the return function--it returns back to the same URL but gets a permission error (could be a referrer check possibly). If anyone has info on this already it would be helpful.