"add to beginning of album" using gallery remote?

forresto

Joined: 2002-11-10
Posts: 8
Posted: Thu, 2003-09-18 08:13

Does this new version of gallery (1.4) and gallery remote support the new "add to beginning of album" option that has been around since 1.3.5?

When 1.3.5 came out I set this option for my moblog album, but it did not work unless uploading with the web interface.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-09-18 08:26

Moved to GR forum.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Sat, 2003-09-20 06:21

Good question. We'll look into this, thanks for reporting it. It's now tracked by this task.

 
Muti

Joined: 2002-12-14
Posts: 10
Posted: Fri, 2003-11-07 16:13

Yes, if add to beginning of album is enabled, gallery remote will add it to the beginning of the specified album. (Tested it on latest CVS, but the add-item hasn't been altered since 1.4)

 
Vesna

Joined: 2003-09-29
Posts: 8
Posted: Sat, 2003-11-08 00:09

I am using fresh Gallery remote on Gallery 1.4 pl2 and altough i checked in ablums properties to add images at the beginning, images uploaded via Gallery remote are positioned at the end of the album.
Any ideas why?

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sat, 2003-11-08 02:44
Vesna wrote:
I am using fresh Gallery remote on Gallery 1.4 pl2 and altough i checked in ablums properties to add images at the beginning, images uploaded via Gallery remote are positioned at the end of the album. Any ideas why?

I have tested the add images to the beginning and galley remote correctly uploads the photos to the beginning.. Have you tried manually uploading a photo direct via gallery?? If not please do, so you can confirm it is not a problem within the gallery install..

 
Vesna

Joined: 2003-09-29
Posts: 8
Posted: Sat, 2003-11-08 08:53

Of course I tried, uploading directly via gallery ba "add photos" link uploads them correctly at the beginning of album.

 
coulterjohnson

Joined: 2002-08-30
Posts: 9
Posted: Sun, 2003-11-09 04:21

I have the same problem as well :(

 
oregano

Joined: 2003-04-21
Posts: 11
Posted: Sun, 2003-11-09 23:53

Same problem here as well :cry:

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Mon, 2003-11-10 03:58

What version of Gallery remote are you all using?? and what version of Gallery?? I cannot reproduce this problem utilising 1.2B14 and 1.4.1 RC2, Gallery adds files directly to the begining

 
joel558
joel558's picture

Joined: 2003-04-10
Posts: 93
Posted: Mon, 2003-11-10 07:40

I just tested this and I get the same thing. Using GR just downloaded and built out of cvs and gallery 1.4pl2

 
Vesna

Joined: 2003-09-29
Posts: 8
Posted: Mon, 2003-11-10 08:11

I have written above versions that I am using. It is Gallery 1.4 pl2 and Gallery Remote 1.1.

 
joel558
joel558's picture

Joined: 2003-04-10
Posts: 93
Posted: Mon, 2003-11-10 08:18

alright, I've tracked down what is causing this,

this isn't technically a gallery remote issue and it is fixed in gallery 1.4.1...

for those who care why, read on:

gallery_remote2.php calls the gallery function addPhoto(), this function is in the gallery/classes/album.php file. at the end of that function, just before the return, in gallery 1.4.1, it has this bit of code:

	       	/*move to the beginning if needed */
	       	if ($this->getAddToBeginning() ) {
		       	$this->movePhoto($this->numPhotos(1), 0);
	       	}

this is missing in 1.4 and adding it in DOES fix the problem...

joel

 
oregano

Joined: 2003-04-21
Posts: 11
Posted: Mon, 2003-11-10 17:25

Joel - while this does make sense, and is indeed missing from the addPhoto() function in 1.4-pl2, adding this bit of code before the return causes Gallery Remote to burp with:
Error: Server contacted, but Gallery not found at <insert address here>/gallery/gallery_remote2.php

Any other thoughts?

:)

 
joel558
joel558's picture

Joined: 2003-04-10
Posts: 93
Posted: Tue, 2003-11-11 00:59

are you adding the code in the albums.php file? or gallery_remote2.php file? it should go in the first...

this is what the new addPhoto, in albums.php, should look like with the 3 lines added(taken starting at line 673)

    $this->photos[] = $item;

    /* If this is the only photo, make it the highlight */
    if ($this->numPhotos(1) == 1 && !$item->isMovie()) {
      $this->setHighlight(1);
    }

    /*move to the beginning if needed */
    if ($this->getAddToBeginning() ) {
      $this->movePhoto($this->numPhotos(1), 0);
    }

    return 0;
  }

this causes no problems whatsoever for me and adds the picture to the beginning of the album. I can attach my albums.php if you want.

but, due to the way GR adds photos one at a time, if you're adding more than one image, the images end up in reverse order of what you'd probably expect. not sure how to fix this....
but I'd guess everything works properly with 1.4.1??? at least according to ozgreg anyway.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2003-11-11 08:05

Yep works fine under 1.4.1 RC2.. Worth the upgrade maybe? 1.4.1 got an excellent image resizing features...

 
Vesna

Joined: 2003-09-29
Posts: 8
Posted: Wed, 2003-11-12 18:53

Thank you very much.
This works now as it is supposed to for me.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2003-11-12 19:05

Great! Thanks Joel for all the support.

I have opened a task to track your suggestion that GR should upload pictures in reverse order to albums that are set to add to beginning. Do you know how the web upload interface handles that?

 
joel558
joel558's picture

Joined: 2003-04-10
Posts: 93
Posted: Wed, 2003-11-12 21:59

oh boy, I've really really got myself confused :roll: had a message typed saying web interface uploads in reverse order, then tested in another of my galleries, found it uploaded my 2 test pictures in proper order, forgot which gallery I modified with updated code from this thread, typed a message about how the web interface uploads in correct order, then decided to test with more than 2 pictures, and things got ended up in a really strange order. Finally realized that was the Gallery I modified :-? ...

Anyway... seems adding via the web interface also uploads in reverse order on an unmodified 1.4 gallery and my change suggested earlier causes GR to add the same way the web interface does in an unmodified install, but messes up the web interface...

so, if I have this sorted out in my mind, using GR with:
-unmodified gallery 1.4 leads to not uploading at beginning of album
-gallery1.4 modified with above code leads to GR uploading properly, web interface messed up

I'll upgrade one of my installs to 1.4.1 RC3 later and test there. And if it works properly, I don't think any changes will need to be made in GR...

joel

 
joel558
joel558's picture

Joined: 2003-04-10
Posts: 93
Posted: Thu, 2003-11-13 03:25

alright, got 1.4.1 RC3 installed successfully and have tested uploading in there. Uploading with both the web interface and GR adds the files in reverse order of how they are specified when adding to beginning (even though thats not what I'd personally expect). So no need to change anything in GR...

For all those of you who upload(to gallery 1.4) with GR only, you can make the change specified above, however, if you use the webinterface and GR, one or the other won't work, depending on if you change albums.php or not.

But, for eveyone, I'd really recommend upgrading to gallery 1.4.1 when the final is released, as it includes lots of great new features(and GR and gallery webinterface both add photos correctly to the beginning of an album)

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2003-11-13 04:15

Hehe which explains why the feature was working fine for me as I was running the testing on 1.4.1 ;) and yes Gallery 1.4.1 is an excellent upgrade.. I love the concept of setting the image max size and I cannot wait until Gallery remote supports this feature!! (Hint Hint) :-)