Gallery strange Url behavior into Mambo

kromm

Joined: 2005-04-21
Posts: 5
Posted: Thu, 2005-04-21 15:07

Mambo 4.5.2.1
Menalto Gallery 1.5
integration: install gallery/contrib/mambo

Integration between the Gallery and Mambo is fine, that is, the gallery's mainpage is integrated within Mambo and uses the Mambo template.
Unfortunately the urls produced within the gallery are not correct. Although both Internet Explorer and Firefox have problems with the links, the urls are quite different:

The following urls are links to albums within the gallery:

The "firefox url" shows "%5C" after the domain-name, which is the same as a backslash. If I manually remove "%5C/", the url is alright.

The "IE url" doesn't show the domain-name. If I manually add the domain-name, the url is alright.

The standalone gallery works great.

What on earth is going on here? There are several threads with this same question, but unfortunately with no solution. I mailed the author of the integrator 'gallery/contrib/mambo' but hasn't replied yet.

Anybody?

 
larsbrink
larsbrink's picture

Joined: 2004-05-24
Posts: 6
Posted: Thu, 2005-04-21 18:07

Hi kromm,

I have the same problem. with the same configuration. More info is that the server hosting the mambo/gallery is Windows 2000.

I dont know about the FireFox thing but the IE problem is exactly like. Standalone works.

Anyone have a patch or a clue where to look for this?

 
syn

Joined: 2005-03-10
Posts: 14
Posted: Fri, 2005-04-22 06:58
larsbrink wrote:
Hi kromm,

I have the same problem. with the same configuration. More info is that the server hosting the mambo/gallery is Windows 2000.

I dont know about the FireFox thing but the IE problem is exactly like. Standalone works.

Anyone have a patch or a clue where to look for this?

I have givven kromm a potential fix and am awaiting a reply. I just thought of something else that may cause it.. (I have fixed it, but forget how).

 
larsbrink
larsbrink's picture

Joined: 2004-05-24
Posts: 6
Posted: Fri, 2005-04-22 11:43

Hi Syn!

Could you send the same to me please? You might have it in your sent mail?

HavocDK [at] oddguys [dot] com

..or if you lost it a file to look into?

Regards.

 
kromm

Joined: 2005-04-21
Posts: 5
Posted: Fri, 2005-04-22 11:44

Unfortuanely the files 'syn' has sent me don't do the trick (I Mailed 'syn' about this).
I did a controlled merge with my original (newer) gallery files, but the problem remains.

Files have been send through pm to larsbrink

 
brockster

Joined: 2005-04-21
Posts: 6
Posted: Sat, 2005-04-23 21:38

I have the same problem on win2k3. Any fix yet?

 
Bluesuede
Bluesuede's picture

Joined: 2003-02-25
Posts: 14
Posted: Sun, 2005-04-24 10:07

Hi I have exactly the same problem: Firefox shows the urls for Gallery with a \/ added in front of index.php eg:

http://www.sitename.com/\/index.php?option=com_gallery etc etc

And IE simply removes the domain name entirely.

Odd...anyone come up with a solution yet?

 
syn

Joined: 2005-03-10
Posts: 14
Posted: Sun, 2005-04-24 21:00

some more things to try...
In index.php (of gallery) change:

	if (isset($option)) {
		$GALLERY_MODULENAME = $option;
		$mamboDir = getcwd();
		$GALLERY_EMBEDDED_INSIDE = 'mambo';
		$GALLERY_EMBEDDED_INSIDE_TYPE = 'mambo';

to

	if (isset($option)) {
		$GALLERY_MODULENAME = $option;
		$mamboDir = (substr(PHP_OS, 0, 3) == 'WIN') ? strtolower(getcwd()) : getcwd();;
		$GALLERY_EMBEDDED_INSIDE = 'mambo';
		$GALLERY_EMBEDDED_INSIDE_TYPE = 'mambo';

and in session.php

if (empty($gallery->app->sessionVar)) {
	$gSessionVar = "gallery_session_" . md5(getcwd()); 
} else {
	$gSessionVar = $gallery->app->sessionVar . "_" . md5($gallery->app->userDir);
}

to

if (empty($gallery->app->sessionVar)) {
	$gSessionVar = "gallery_session_" . md5((substr(PHP_OS, 0, 3) == 'WIN') ? strtolower(getcwd()) : getcwd()); 
} else {
	$gSessionVar = $gallery->app->sessionVar . "_" . md5($gallery->app->userDir);
}

let me know if that fixes things.
I BELIEVE thats what i had to change to get mine working....

 
brockster

Joined: 2005-04-21
Posts: 6
Posted: Sun, 2005-04-24 22:55

Syn,
I add above to my gallery and still no change....

 
kromm

Joined: 2005-04-21
Posts: 5
Posted: Mon, 2005-04-25 10:38

@syn
Unfortunately it doesn't work for me either..

Removed the Gallery from Mambo. Installed Gallery into Mambo after the fix. Created a new link on the main menu to component 'Gallery'... No change.. :-(

If I knew which part of Mambo or the Gallery is responsible for creating the links, I could try and find a solution. So if somebody could point me in the right direction this would be much appreciated as well..

 
338LM

Joined: 2005-04-26
Posts: 1
Posted: Tue, 2005-04-26 06:42

I have the exact same problem.
Here are my details:
Mambo 4.5.2
Gallery 1.5
NetPBM 1.4
PHP 5.04
Apache 1.3.33

I would love to get this working, please help!

 
Bluesuede
Bluesuede's picture

Joined: 2003-02-25
Posts: 14
Posted: Sat, 2005-04-30 01:22

Anyone able to help?

 
kromm

Joined: 2005-04-21
Posts: 5
Posted: Mon, 2005-05-02 08:10

I'm trying to figure this out myself, but my PHP skills are not that high so it will take some time..

There's also a thread for this at forum.mamboserver.com http://forum.mamboserver.com/showthread.php?t=40743 but no solution either...

:(

 
syn

Joined: 2005-03-10
Posts: 14
Posted: Tue, 2005-05-03 18:34

well.. i can zip up my current gallery dir and up it to whomever wants it...
its sad, i remember fixing it (a long time ago) but i opened and looked over so many files, i forget what i changed.

 
blssdwlf

Joined: 2005-05-04
Posts: 2
Posted: Wed, 2005-05-04 22:42

This is a possible fix.

(This is for Gallery 1.5/Mambo 4.5.2.1 using the contrib/mambo component on Windows 2k/Apache 2/PHP 4.3.11)

Look in your init.php file in your gallery directory.

Starting line 368 you should see:

if (!empty($gallery->session->mambo)) {
				$mosConfig_host		= $gallery->session->mambo->mosConfig_host;
				$mosConfig_user		= $gallery->session->mambo->mosConfig_user;
				$mosConfig_password	= $gallery->session->mambo->mosConfig_password;
				$mosConfig_db		= $gallery->session->mambo->mosConfig_db;
				$mosConfig_dbprefix	= $gallery->session->mambo->mosConfig_dbprefix;
				$MOS_GALLERY_PARAMS	= $gallery->session->mambo->MOS_GALLERY_PARAMS;

add

$gallery->session->mambo->mosRoot = dirname($_SERVER['PHP_SELF']);

before

} elseif (!empty($mosConfig_db)) {
				$gallery->session->mambo->mosRoot = dirname($_SERVER['PHP_SELF']);
				if (substr($gallery->session->mambo->mosRoot, -1) != '/') {
					$gallery->session->mambo->mosRoot .= '/';
				}

Somehow the mosroot variable wasn't getting set and ended up with a \ which threw off the makeGalleryUrl function in url.php

Fun tracing through :)

Hope that works for others that might be having this problem.

 
blssdwlf

Joined: 2005-05-04
Posts: 2
Posted: Wed, 2005-05-04 22:58

Ok, upon further testing, the above fix works for IE but not Firefox. Not entirely sure if thats because of dirname()'s behavior was changed recently to have \ on windows platforms... soo here is a fix for that:

In the same file, replace the added line:

$gallery->session->mambo->mosRoot = dirname($_SERVER['PHP_SELF']);

with

$gallery->session->mambo->mosRoot = str_replace("\\","/",dirname($_SERVER['PHP_SELF']));

there is also an identical line below it in the elseif code block - feel free to replace that one too.

 
Bluesuede
Bluesuede's picture

Joined: 2003-02-25
Posts: 14
Posted: Thu, 2005-05-05 00:19

Many thanks - I'll give it a try later on and let you know how it turns out! :D

 
Bluesuede
Bluesuede's picture

Joined: 2003-02-25
Posts: 14
Posted: Thu, 2005-05-05 01:34

Fantastic! Thanks a bunch - it worked like a charm - my gallery component now works properly in both Firefox and IE :D

 
kromm

Joined: 2005-04-21
Posts: 5
Posted: Thu, 2005-05-05 13:13

Yahooooooooo..... I feel like wanting to run around the room for a mile or two with my hands in the air...

This is absolutely great... the long awaited solution...

Thank you thank you thank you, blssdwlf You made my day... !!!

And thank you Bluesuede for adding a link to this solution at forum.mamboserver.com

 
brockster

Joined: 2005-04-21
Posts: 6
Posted: Fri, 2005-05-13 03:54

Thank's blssdwlf, it worked

 
albrown

Joined: 2005-07-11
Posts: 4
Posted: Wed, 2005-07-13 16:17

I have noticed the same problem and I am linking to another thread that has more information. For me this did not totally resolve the problem and it does not address the same problem for the random imgae block producing the same problem.

http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=152338#152338

From that thread:

albrown wrote:
I applied the patch and all seemed well at that time. A few hours later I was checking some things out using firefox (my normal browser) and the "\" was back. As an experiment I tried the site with IE and the URL was ok. I couldn't believe it but I could see it both were on the screen at the same time. Pages generated within a second or so of each other. A short while later it is back to being right in firefox again and IE was still ok. Since while looking into this on ocassion I have seen it do "//\" only on firefox.

Is there some kind of browser specific caching going on in gallery or mambo? I've had other people try this with simular results. I have been able to reproduce this from other computers in the same network and computers outside the same network.

The site is: http://knoxcountyartleague.org/

I also have disabled the random image block (mambo module) as this consistantly produced the same problem for the link on the image in the image block.

Any help appreciated.
Al

 
pine

Joined: 2004-11-14
Posts: 2
Posted: Thu, 2005-07-21 12:07

I have the same problem also with random block like albrown said.
i solve it with small modification of this solution :wink:

i put this code: $gallery->session->mambo->mosRoot = str_replace("\\","/",dirname($_SERVER['PHP_SELF'])); before the if statement and now it works for everything, even for random block. I also didn't notice any other problems with that. so it work's for me :wink:

 
maximus007

Joined: 2004-10-08
Posts: 6
Posted: Thu, 2005-07-28 09:46

thanks for the help, this worked

You should make sure this is added into 1.51