$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. 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? |
|
Posts: 8601
If I recall correctly, use $i instead of $index.
If that doesn't work I can dig into it further..
Posts: 8
Thank you, but still gives me the same errorline. :cry:
Jan
Posts: 8601
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.
Posts: 8
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.
Posts: 8601
I think the "getPhotoId" call you have above should work, just use the GLOBALS value for the parameter instead of just $index..
Posts: 8
Thnaks a lot, it works fine now.
J