$gallery->album->getPhotoId($index)

jean2399

Joined: 2003-10-31
Posts: 8
Posted: Tue, 2004-02-03 11:35

Dear Gallery ppl!

Sorry, I sent this post to the wrong forum before.
http://www.stock-photography.bz

I am trying to add my shopping cart to my gallery. It works more or less fine by now, allthough I have a small problem. I can add the following line to the inline_albumthumb.footer:

<input type=button value="Add / Remove" onclick=addCart('<?=$gallery->album->getPhotoId($index)?>')>

but I cannot add it to the inline_foto.footer.

This line adds the Add/Remove button below the picture. While adding it to the inline_foto.footer I get the following message on the corresponding output page:

Fatal error: Call to a member function on a non-object in classes/Album.php on line 1063

The header of the inline_foto.footer file says I can use the $gallery->album->getPhotoId($index) variable, but it does not seem to be true in a simple way.

Anyone?
Thank you for your time,
Jan Csernoch
----
Give us your Gallery/webserver information to get a faster answer.
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery URL (optional but very useful): http://www.stock-photography.bz
Gallery version: v1.4.1
Apache version: apache-1.3.27-2
PHP version (don't just say PHP 4, please): php-4.1.2-7.3.6
Graphics Toolkit:
Operating system:Red Hat Linux 7.3
Web browser/version (if applicable):

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2004-02-04 05:34

If I recall correctly, use $i instead of $index.
If that doesn't work I can dig into it further..

 
jean2399

Joined: 2003-10-31
Posts: 8
Posted: Wed, 2004-02-04 17:56

Thank you, but still gives me the same errorline. :cry:
Jan

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2004-02-05 06:25

I verified that in inline_albumthumb.footer you should use $GLOBALS['i'] and in inline_photo.footer you should use $GLOBALS['index']
Also make sure to put global $gallery; near the top.

 
jean2399

Joined: 2003-10-31
Posts: 8
Posted: Mon, 2004-02-09 04:00

Thanks Mindless! It works, however it gives me the index of the picture, not the Id. Is there any way to get the Id?

Thanks for your time.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2004-02-09 04:29

I think the "getPhotoId" call you have above should work, just use the GLOBALS value for the parameter instead of just $index..

 
jean2399

Joined: 2003-10-31
Posts: 8
Posted: Mon, 2004-02-09 13:08

Thnaks a lot, it works fine now.
J