Gallery mambo component hack

jentulman
jentulman's picture

Joined: 2004-10-08
Posts: 2
Posted: Tue, 2004-10-19 15:19

As it is now possible to include a component more than once in the menu in Mambo, I have been trying to hack the gallery mambo component to allow a menu entry to point to a particular album.
I'm fine with sorting out the mambo side of the code, but what mambo does is include(gallerydir/index.php) so I need to set the $set_albumName to the album name and $include to view_album.php variables that are normally passed in in the URL.
Before the index.php is included I am setting the value of both of these variables as global vars, but this causes the script to redirect endlessly.
can anyone tell me how I can set these variables up before the include?
Passing them in on the URL is not going to be possible.

Attached is my modified gallery.php from the component.

I'm modifing the file from this thread on the mambo forums http://forum.mamboserver.com/showthread.php?t=17693 and yes I'm the same Jentulman as there :)

AttachmentSize
gallery.zip1.39 KB
 
jentulman
jentulman's picture

Joined: 2004-10-08
Posts: 2
Posted: Thu, 2004-10-21 17:45

I've been playing with this a bit more.
I have 2 menu items in my mambo site.
The first does not set the $include or $set_albumName variables it just includes Gallery/index.php as normal at the root album.
The second causes $include and set_albumName to be set and then includes Gallery/index.php.
If I visit my second link before I've viewed the gallery then I get the infinaite redirection problem.
If I visit it after visiting my first "normal" link to the gallery then I get gallery on the last page I viewed.
I assume in that case that this is mucking up Galleries session object somehow.

You can see this in action on http://www.justthesepeople.co.uk
The "normal" link is "media galleries" on the main menu.
The problematic link is the . (period) at the very bottom of the main menu.

I've been trawling through the code trying to work out what's happening but there's a lot of code there :)