Mambo 4.5.1 + Gallery 1.5 CVS + random block
jefman
Joined: 2004-05-07
Posts: 6 |
Posted: Wed, 2005-01-26 13:22 |
I have installed mambo 4.5.1a and gallery 1.5 cvs on a pc with Wamp5 1.4.3 server (apache + php + mysql packages). in mambo component I have set path to gallery as "c:\wwwroot\gallery\". I have Published the random_block on my right and I can see an image but when I click the image I get the large one but on the right side I get: Fatal error: Cannot redeclare getrequestvar() (previously declared in c:\wwwroot\gallery\util.php:29) in c:\wwwroot\gallery\util.php on line 46 and if I go to the top level also get this: Warning: Invalid argument supplied for foreach() in c:\wwwroot\gallery\util.php on line 3591 My Mambo/gallery URL: http://machome.mine.nu/mambo/index.php?option=com_gallery Any ideas on this problem ? /Jefman |
|
Posts: 2322
The random block is being incorrectly included.
You either need to make sure that the random block is not loaded when viewing Gallery pages, or correct the include according to the instructions located in the sticky post at the top of the Random Block forum.
Posts: 6
I reinstalled the component from the contrib folder and downloaded the mod_block_random.zip from http://www.gallery-addons.com/content/view/30/68/.
I get a random block in mambo but as soon as i klick the image I get
Fatal error: Cannot redeclare getrequestvar() (previously declared in c:\wwwroot\gallery\util.php:29) in c:\wwwroot\gallery\util.php on line 46
I have no idea on what I do wrong, I have done just as it say....
I use gallery 1.5-cvs-b327.
/Jefman
Posts: 36
Every mod_block_gallery.zip, that I have found, is including the block-random.php in a incorrect way.
Here is the code:
In my copy I have rebuilded the hole component for mambo so it's a option in the admin backend to specify the gallery URL also. Not just the server path. That way, the module above is including block-random.php with the URL instead. (I have rebuilded the code above, yes...)
Maybe the author of this module should change this so not everyone is complaining about problems here? :wink:
Posts: 2322
Blinkiz, that code is completely incorrect.
This loads a physical path (/home/you/gallery). If you read the Random Block documentation, it is *required* that you load it via HTTP, or you will see the errors that are currently being reported. (Duplicate declarations)
Posts: 36
Yeah, I know.
I have added a column in the database, "pathurl" that will store the absolute URL. And then coded the line you prompted with \'pathurl\' instead of \'path\'
Maybe I should publish my version of the component/module? ;)
Posts: 36
I can get the serverpath to gallery, then I should be able to retrive the absolute path from the config.php, right?
Maybe someone could help me with that line?
The serverpath is located here:
Then if someone just can help me retrive the absolute URL path from "$GALLERY_URL."/config.php" everything will be solved :D
Posts: 36
I get the error
Why? ;)
If I type the above absolute URL path in my browser, a random picture is coming up. So the path is correct.
Posts: 2322
Well, you actually want to be including
"/modules/gallery/block-random.php" (or appropriate path), not the mambo index.
Posts: 36
jehupp.... :-?
Can I do this then?
It works, but I don't know if it's a secure and effective way.
Posts: 347
Hi,
with this code I can show the random module together with Gallery, but when I click on the random image Gallery jumps out of Mambo and open standalone.
Gallery 1.5-cvs-b330
Mambo 4.5.1
Kai
Posts: 36
You can probably include config.php higher up in the script and get it to work.
Anyway, am giving up. Random picture from gallery dosn't work for me. If it's not this problem, is "no photo choosen" problem because my gallery is for registreted only.
See ya when G2 is launched!
Posts: 43
I tried this code:
<?php
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',"/path/to/your/gallerybasedir");
$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 . "/config.php");
include($gallery->app->photoAlbumURL. "/$include");
?>
And as someone mentioned earlier in this thread,when you click on the random image it jumps out of mambo to the gallery stand alone. Did anyone resolve this problem?
Posts: 43
I tried moving Blinkiz suggestion; "You can probably include config.php higher up in the script and get it to work" but that did not work. I have contact the author and sent him this thread and hope he can help us.
Posts: 2322
muskiediver, I say this so often on so many threads...
You can't successfully load the random block directly by file. You must include it via http.
Navigate to a Gallery URL, then replace the active filename with block-random.php. (I don't have Mambo installed right now, or I'd give a more accurate example.)
Something similar to:
include('http://yoursite/mambo/index.php?option=com_gallery&include=block-random.php');