Gallery module will not work in left position

struesda

Joined: 2004-11-29
Posts: 6
Posted: Tue, 2005-08-02 18:53

I am running gallery 1.4.4-pl4 and Mambo 4.5.1a

Gallery runs fine standalone and I have installed the latest versions of the component and mod_block_random.

If I have a page containing both the gallery component (in the content pane) and the random image (in the right position). The gallery component works fine, but the random image (and any other modules that I have installed after it on the page) is not displayed.

If I switch the random image block to the left position, then the random image displays fine - but anything else after it on the page (login module, content pane with gallery, etc) is not displayed.

If I have a page with the random image block, but not the gallery component - everything works fine.

So the problem seems to be with the random image block and the gallery component being put onto the same page - and this causes the page to stop at the random image module and go no further.

I have not seen a similar thing in the other forum messages - so does anyone have an idea why this would be a problem - or how to fix it?

Thanks,
Steve T.

see this page for an example

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Tue, 2005-08-02 18:56

It's almost assuredly that the module you're using is broken, and is not loading the random block correctly.

The random block can not be loaded with a file path (/foo/bar/block_random.php). It has to be loaded via http (http://site/foo/bar/block_random.php) to operate correctly.

 
struesda

Joined: 2004-11-29
Posts: 6
Posted: Tue, 2005-08-02 19:11
signe wrote:
It's almost assuredly that the module you're using is broken, and is not loading the random block correctly.

The random block can not be loaded with a file path (/foo/bar/block_random.php). It has to be loaded via http (http://site/foo/bar/block_random.php) to operate correctly.

Thanks for the quick response.

How do I determine what file path is being used for loading? Is it in the module code, or from a database field?

Thanks,
Steve T

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Tue, 2005-08-02 19:16

I really couldn't say, since I'm not familiar with the module. If you had to configure the mod and tell it where the file was located, then it's probably in the DB. If you didn't have to, it's likely in the code.

 
struesda

Joined: 2004-11-29
Posts: 6
Posted: Tue, 2005-08-02 19:53

The code gets the path from the gallery component configuration and then tacks a /block-random.php onto the end of it.

When I replace this with hard coding an URL, the random block no longer loads on any of the pages - and neither does the rest of the page.

So that doesn't seem to work either :-?

Here's the module code - anthing else look wrong?

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

global $GALLERY_EMBEDDED_INSIDE;
global $GALLERY_EMBEDDED_INSIDE_TYPE;
global $GALLERY_MODULENAME;
global $include;
global $option;

$option = "com_gallery";          // Tells Gallery that we're inside Mambo
$include = "block-random.php";    // ... and that we want block-random.php.
//define ('GALLERY_URL',"http://www.gracecommunity.ws/gallery");
	
$database->setQuery('SELECT `value` FROM #__gallery WHERE `field` = \'path\'');
define ('GALLERY_URL',$database->loadResult() );

$GALLERY_MODULENAME = $option;
$GALLERY_EMBEDDED_INSIDE = 'mambo';
$GALLERY_EMBEDDED_INSIDE_TYPE = 'mambo';

include(GALLERY_URL . "/$include");

[/code]

 
struesda

Joined: 2004-11-29
Posts: 6
Posted: Tue, 2005-08-02 19:57

Followup thought:

I'm guessing that block-random.php and index.php both end up getting included and interpreted.

Is there anything in these two scripts that would conflict with the other - or with the $GALLERY_EMBEDDED_INSIDE or $GALLERY_MODULENAME variable settings of they were set before index.php started?

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Tue, 2005-08-02 19:58

Well, your define is missing a trailing slash, so that would cause an issue.

 
struesda

Joined: 2004-11-29
Posts: 6
Posted: Tue, 2005-08-02 20:11

Do you mean before the block_random.php ?

I think the bottom include puts the slash in before it adds the $include variable. - unless I am needing more sleep :)

include(GALLERY_URL . "/$include");

So that would result in
"http://www.gracecommunity.ws/gallery" + "/" + "block-random.php"

which would result in a valid url.