G2 Sidebar Module and Photo Cart problem with Mambo + G2

KAC

Joined: 2004-12-01
Posts: 164
Posted: Fri, 2005-06-10 18:17

I'm running Mambo 4.5.2 with G2 beta 3 embedded.

The embedding works fine.

I have the Mambo G2 sidebar module installed also. In the module options in Mambo, I have chosen to display the G2 Sidebar Module on the Gallery page.

There are two problems with this:

1. On the top of my mambo page, I put a link called "Photo Gallery" that takes you to my embedded G2 homepage. At this point the G2 sidebar displays and functions perfectly. Once I start browsing around albums and such, the G2 sidebar disappears.

The only way to get the G2 sidebar to display again is to click on the "Photo Gallery" link at the top of the page (Mambo TopMenu).

That's not good cuz, as you know, some of the G2 sidebar features are needed while viewing albums/pictures.

2. The above problem creates a major problem that practically renders the Photo Cart useless. If I open an album and add a picture to the photo cart, it works great. I can see the picture has been added to the cart.

Now, remember that while I'm browsing, the G2 sidebar is no longer viewable because of the reasons explained in item 1 above.

If I go to another album, and add another photo to the cart, I can now see there are two pictures in the cart. At this point, If I click on the "Photo Gallery" link to go to my G2 homepage so I can view the G2 sidebar, ALL the pictures that I added to the cart are GONE.

It says "0 pictures added to cart" or something like that.

Basically, I'm desperate for two things:

A. A fix to have the G2 sidebar module display while viewing ALL G2 pages, not only the home page. ( I don't want to choose "ALL" in the sidebar module options because I don't want it on my site homepage)

B. A fix so that the pics added to the photo cart remain in the photocart throughout the whole time the user is browsing all areas of my website.

I hope I explained this well. :P

 
jdezarn

Joined: 2003-11-21
Posts: 8
Posted: Sun, 2005-06-19 14:33

I don't know how to fix it, but I can tell you why it does that. It has to do with the ItemID in the URL. When you create a new menu item it automatically gives it an ItemID. In my case it is 229 so my URL is http://www.mydomain.com/index.php?option=com_gallery2&Itemid=229

I tried to make the link in the menu without the itemid, but it creates it anyways.

So when you click on a sub-album, the Itemid disappears from the URL. Add &Itemid=(your number) into the URL after com_gallery and before &g2_view and voila it works. Unfortunately you can't keep doing that and it would be tough to explain to members etc. So it isn't a fix, it is just an explanation as to why. I wouldn't even know where to begin on how to fix it.

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Tue, 2005-06-21 20:04

KAC,

The firts problem i posted a fix in the main mambo G2 thread.

jdezarn, is correct mambo needs itemid to know which modules should be loaded on the page.

this is fixed in the new release i'm working on.

second problem might be a little bit trickier, i take a look and add it to my todo list.

grtz,
Michiel

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Wed, 2005-06-22 02:00

I've added this

'gallerySessionId' => $HTTP_COOKIE_VARS["sessioncookie"],

to the galleryEmbed::Init

in both the sidebar and the gallery2.php component and that should keep your cart.

I also copied into the gallery sidebar the

if (MOS_GALLERY2_PARAMS_MIRROR_USERS == 1)
{
$user_id = $my->id;
}
else
{
$user_id = '0';
}

from the gallery2.php file and changed the galleryembed::init where it sets the activeuserid to '0' to

'activeUserId' => $user_id

This seemed to fix some permission problems I was having. It was kind of weird. Hope this helps.

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Wed, 2005-06-22 08:52

shocksll,

thxs, i'll take a look at those changes.

Michiel

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-06-22 08:56

$user_id = '0'; for anonymous?
set
activeUserId => ''
for guest / anonymous user! an empty string, not '0'.

 
KAC

Joined: 2004-12-01
Posts: 164
Posted: Thu, 2005-06-23 12:21

Just to close this out. I wanted to add that the photo cart problem has been fixed in michiel_1981's version 2 of the G2 component for mambo that was released here: http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=148135#148135.