Before you install a Gallery Modul to your Mambo, download and install the corresponding script from the Gallery addons section.
Test the script by pointing your browser to the new page.
The URL should be something like:
http://www.yoursite.com/gallery/block-random.phpFor security reasons you have to modify Gallery's index.php to tell it that the new script is safe to include.
Edit Gallery's index.php, find the block shown below and add the line in red:
Code:
<?php
/*
* As a security precaution, only allow one of the following files to be included.
* If you want Gallery to allow you to include other files (such as the random photo block)
* then you need to add the name of the file including any relevant path components to this
* array.
*/
$safe_to_include =
"album_list.php"
"block-random.php"
"feature-photo.php"
"add_comment.php",
"add_photos.php",
"add_photos_frame.php",
........);
%3C%3Fphp%0A%2F%2A%0A%20%20%2A%20As%20a%20security%20precaution%2C%20only%20allow%20one%20of%20the%20following%20files%20to%20be%20included.%0A%20%20%2A%20If%20you%20want%20Gallery%20to%20allow%20you%20to%20include%20other%20files%20%28such%20as%20the%20random%20photo%20block%29%0A%20%20%2A%20then%20you%20need%20to%20add%20the%20name%20of%20the%20file%20including%20any%20relevant%20path%20components%20to%20this%0A%20%20%2A%20array.%0A%20%20%2A%2F%0A%20%24safe_to_include%20%3D%0A%20%20array%28%0A%20%20%20%20%20%20%20%20%20%22album_list.php%22%0A%20%20%20%20%20%20%20%20%20%22block-random.php%22%0A%20%20%20%20%20%20%20%20%20%22feature-photo.php%22%0A%20%20%20%20%20%20%20%20%22add_comment.php%22%2C%0A%20%20%20%20%20%20%20%20%20%22add_photos.php%22%2C%0A%20%20%20%20%20%20%20%20%20%22add_photos_frame.php%22%2C%0A%20%20%20%20%20%20%20%20........%29%3B
One issue with the Gallery Module is that it does not work on the Gallery page itself. You need to unselect the Module on your Gallery page.
Hiding right hand Modules:If you want to hide the right hand Modules to give the Gallery more room, you have to edit the index.php of your Template.
Search in your Mambo Template index.php for:
Code:
<?php mosLoadModules ( 'right' ); ?>
%3C%3Fphp%20mosLoadModules%20%28%20%27right%27%20%29%3B%20%3F%3E
and replace it with:
Code:
<?php if ( mosGetParam( $_REQUEST, 'option', '' )<>"com_gallery") {
mosLoadModules ( 'right' );
} ?>
%3C%3Fphp%20if%20%28%20mosGetParam%28%20%24_REQUEST%2C%20%27option%27%2C%20%27%27%20%29%3C%3E%22com_gallery%22%29%20%7B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mosLoadModules%20%28%20%27right%27%20%29%3B%20%0A%20%20%20%20%7D%20%3F%3E
Serveral scripts on the same site:If you want to show serveral scripts on the same site, you could include them in one Module:
Edit the mod_block_random.php for example to show block.random.php, featored-photo.php and newest_album.php in one Module:
Code:
<?php
defined( '_VALID_MOS' ) or
die( 'Direct Access to this location is not allowed.' );
global $GALLERY_EMBEDDED_INSIDE;
global $GALLERY_EMBEDDED_INSIDE_TYPE;
$option = "com_gallery";
$include = "block-random.php";
$include2 = "featured-photo.php";
$include3 = "newest_album.php";
$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");
include(GALLERY_URL . "/$include2");
include(GALLERY_URL . "$include3");
?>
%3C%3Fphp%0A%20%20%20%20defined%28%20%27_VALID_MOS%27%20%29%20or%20die%28%20%27Direct%20Access%20to%20this%20location%20is%20not%20allowed.%27%20%29%3B%0A%20%20%20%20global%20%24GALLERY_EMBEDDED_INSIDE%3B%0A%20%20%20%20global%20%24GALLERY_EMBEDDED_INSIDE_TYPE%3B%0A%20%20%20%20global%20%24GALLERY_MODULENAME%3B%0A%20%20%20%20global%20%24include%3B%0A%20%20%20%20global%20%24include2%3B%0A%20%20%20%20global%20%24include3%3B%0A%20%20%20%20global%20%24option%3B%0A%20%20%20%20%24option%20%3D%20%22com_gallery%22%3B%0A%20%20%20%20%24include%20%3D%20%22block-random.php%22%3B%20%0A%20%20%20%20%24include2%20%3D%20%22featured-photo.php%22%3B%0A%20%20%20%20%24include3%20%3D%20%22newest_album.php%22%3B%0A%0A%20%20%20%20%24database-%3EsetQuery%28%27SELECT%20%60value%60%20FROM%20%23__gallery%20WHERE%20%60field%60%20%3D%20%27path%27%27%29%3B%0A%20%20%20%20define%20%28%27GALLERY_URL%27%2C%24database-%3EloadResult%28%29%20%29%3B%0A%20%20%20%20%24GALLERY_MODULENAME%20%3D%20%24option%3B%0A%20%20%20%20%24GALLERY_EMBEDDED_INSIDE%20%3D%20%27mambo%27%3B%0A%20%20%20%20%24GALLERY_EMBEDDED_INSIDE_TYPE%20%3D%20%27mambo%27%3B%0A%20%20%20%20include%28GALLERY_URL%20.%20%22%2F%24include%22%29%3B%0A%20%20%20%20include%28GALLERY_URL%20.%20%22%2F%24include2%22%29%3B%20%0A%20%20%20%20include%28GALLERY_URL%20.%20%22%24include3%22%29%3B%0A%20%20%20%3F%3E
Be sure that Gallerys init.php only is loaded from the first script, in the following scripts (include2, include3) you have to remark the line:
Code:
//require($GALLERY_BASEDIR . "init.php");
%2F%2Frequire%28%24GALLERY_BASEDIR%20.%20%22init.php%22%29%3B