1
ssananik
xoopsgallery Gallery 1.3.3 with XOOPs bug found & Fixed
  • 2003/4/15 18:48

  • ssananik

  • Just popping in

  • Posts: 2

  • Since: 2003/4/15


Hi all:

Just joined the XOOPs community! I've been playing with the xoopsgallery 1.3.3 for XOOPs and ran into a little defect when I tried to modify thumbnails. The Java applet does not load b/c it's referencing the local filesystem. Heres how you fix it:

// xoopsgallery/init.php(23)
// add the following
$GALLERY_URL = XOOPS_URL . '/modules/xoopsgallery/';

// xoopsgallery/edit_thmb.php (118)
// change $GALLERY_DIRECTORY to $GALLERY_URL


That should do it.

I hope this helps.

2
Boobtoob
Re: xoopsgallery Gallery 1.3.3 with XOOPs bug found & Fixed
  • 2003/4/15 20:02

  • Boobtoob

  • Friend of XOOPS

  • Posts: 202

  • Since: 2001/12/22


Sure did.. Added it to my xoopsgallery package. I've also completed the rewrite of the block code for random thumbnails. I'll put a news in a little while.


3
ssananik
Re: xoopsgallery Gallery 1.3.3 with XOOPs bug found & Fixed
  • 2003/4/15 21:34

  • ssananik

  • Just popping in

  • Posts: 2

  • Since: 2003/4/15


That's great that you are working on the randomizer! I was going to build one myself. :)

BTW, the shutterfly print stuff is broken. So I'm taking a look at that. I'll post more as soon as I fix it.

Looking forward to the randomizer. Anyway that you can add captions to the XOOPS database as well?

Do you know of anyone who has the Gallery v1.3.3 for XOOPS v2.0 in CVS anywhere?

4
darapera
xoops Gallery Print To Shutterfly 'fix'
  • 2003/8/26 4:36

  • darapera

  • Just popping in

  • Posts: 67

  • Since: 2003/7/22


User beware! I am no programmer and the only PHP I know is reading the Welling & Thomson PHP & MySQL book (that too not halfway through to book!). I believed I have 'fixed' the print to shutterfly that doesn't print when you click on it. It only seems to bring you back to the top of the page.

After looking through pages and pages of Gallery forums and XOOPS I found zip so looking into the code, I found that in view_photo.php the form to submit the 'order' so to speak is not there and a couple of things. I don't know if this is going to create problems elsewhere but this is what I did.

Open xoopsgallery/view_photo.php around line 219 look for this
if (strcmp($gallery->album->fields["print_photos"],"none")) {
        if (
strlen($adminCommands) > 0) {
            
$adminCommands .="
"
;
        }
        
$adminCommands .= "document.sflyc4p.returl.value=document.locationdocument.sflyc4p.submit();return false">[print this photo on Shutterfly]";
    }
and change it 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 .="
"
;
        }
        
$printService $gallery->album->fields["print_photos"];
        if (!
strncmp($printService"shutterfly"10)) {
            
$adminCommands .= "document.sflyc4p.returl.value=document.locationdocument.sflyc4p.submit();return false">[print this photo on Shutterfly]";
            
$printShutterflyForm 1;}}


In the very same file scroll down to about line 291 add this
if (isset($printShutterflyForm)) { ?>

  
  
if ($gallery->album->fields["print_photos"] == "shutterfly without donation") { ?>
  
  
} else { ?>
  
  
?>
  
  
  echo $rawImage ?>">
  echo $imageHeight ?>">
  echo $imageWidth ?>">
  echo $thumbImage ?>">
       /* Print the caption on back of photo. If no caption,
      * then print the URL to this page. Shutterfly cuts
      * the message off at 80 characters. */
     
$imbkprnt $gallery->album->getCaption($index);
     if (empty(
$imbkprnt)) {
        
$imbkprnt makeAlbumUrl($gallery->session->albumName$id);
     }
  
?>
  echo strip_tags($imbkprnt?>">

}
. Be aware there are a few things closing tags that you might need to delete or add in. It works for me (http://www.search-www.com - I'm moving servers and transfering domains so give this link about 2-3 days for it to work) good luck!

5
gstarrett
Re: xoops Gallery Print To Shutterfly 'fix'
  • 2003/8/31 18:27

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


There are a number of other fixes in this thread

I've also previously fixed the shutterfly link--I'll take a look and compare, if there are any noteworthy differences I'll post more info.

6
gstarrett
Re: xoops Gallery Print To Shutterfly 'fix'
  • 2003/10/5 20:32

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


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:
if (strcmp($gallery->album->fields["print_photos"],"none")) {
        if (
strlen($adminCommands) > 0) {
            
$adminCommands .="
"
;
        }
        
$adminCommands .= "document.sflyc4p.returl.value=document.locationdocument.sflyc4p.submit();return false">[print this photo on Shutterfly]";
    }

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.locationdocument.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.

7
Raymie
Re: xoops Gallery Print To Shutterfly 'fix'
  • 2004/6/1 18:01

  • Raymie

  • Just popping in

  • Posts: 29

  • Since: 2003/7/23


So I have been looking around, and I have seen a couple sites using the shutterfly feature. I have a demand for this functionality on my site.

Is there now a module download including the working shutterfly functionality? Or do I have to use these posts to put my novice php skills to the test?

8
gstarrett
Re: xoops Gallery Print To Shutterfly 'fix'
  • 2004/6/1 19:31

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


The current version of XoopsGallery (1.3.3.3, released Nov. 2003) has the working Shutterfly functionality included.

9
Raymie
Re: xoops Gallery Print To Shutterfly 'fix'
  • 2004/6/1 20:15

  • Raymie

  • Just popping in

  • Posts: 29

  • Since: 2003/7/23


Thank You

Login

Who's Online

324 user(s) are online (243 user(s) are browsing Support Forums)


Members: 0


Guests: 324


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits