I’m not sure where to look for this one but I have a small issue with a website whilst using two maxigallery instances on the same page.
The main content of the website shows a users maxigallery but on the side bar there is another maxigallery call to pull a random picture from all the gallery images. The problem occurs when a users goes into the gallery Manager. Both the users gallery and the random shot picture shows the manager. Apart from looking awful I think a further issue happens when the user is managing his gallery whilst at the same time the random gallery shot is showing a picture from his gallery. That instances causes duplicates and data mismatching when the pictures are saved.
Have I missed something in the documentation to prevent this duplicate managing galleries from happening or is there a way I can stop the random shot gallery from bringing up the manager?
I think I can write a snippet that looks for the $_POST code and prevent the random shot snippet call but I’m hoping for a built in fix if possible.
Thanks all,
BBloke
EDIT: As a quick fix I made this snippet to check for the Maxigallery Manager. Crude but effective:
<?php
/********
// PreventGallery.snippet.php
// Created by BBloke
// Date: 3/2/09
//
// Run a snippet if manager code is seen
//
// Change the $params as necessary to suit your maxigallery params
// Remove the MaxiGallery snippet call in the place where you dont want the manager
// Use your snippet code in its place
********/
$runSnippet = "MaxiGallery";
$params = array();
$params['gal_query_ids'] = 'all' ;
$params['order_by'] ='random';
$params['limit']='1';
$params['keep_bigimg']='1';
$params['big_img_linkstyle']='external';
$params['picture_target']='57';
$params['display']='embedded';
$params['galleryOuterTpl']='RandomShot';
$params['galleryPictureTpl']='galRandomShot';
$params['childgalleryTpl']='galRandomShotChild';
if (!$_POST['mode'] == 'admin') {
$output .= $modx->runSnippet($runSnippet, $params);
}
return $output;
/*
[!MaxiGallery?
&gal_query_ids=`all`
&order_by=`random`
&limit=`1`
&keep_bigimg=`1`
&big_img_linkstyle=`external`
&picture_target=`57`
&display=`embedded`
&embedtype=`slimbox`
&galleryOuterTpl=`RandomShot`
&galleryPictureTpl=`galRandomShot`
&childgalleryTpl=`galRandomShotChild`!]
*/
?>
Change the $params as necessary to suit your maxigallery params
Remove the MaxiGallery snippet call in the place where you dont want the manager
Use your snippet code in its place