Recently I tried to use the Gallery Multiroot module/plugin to setup a new site based upon an existing Album in our gallery. Since we started sorting albums chronologically, we wanted to sort out the Dachshund photos separately. To do this, I used the Multiroot feature. Unfortunately, I couldn’t get this to work as I’m already using the Multisite plugin to host several Galleries off of my web server. The magic touch was to use the following file, the first line is key and had to be added to make things work in the Multisite configuration.
define('GALLERY_CONFIG_DIR', "/var/virtualwww/gallery.raschnet.com"); //I had to add this line
require('/usr/local/share/gallery2/embed.php');
$ret = GalleryEmbed::init(
array('embedUri' => '/',
'g2Uri' => 'http://gallery.raschnet.com/',
'apiVersion' => array(1, 2)
));
if ($ret) {
print '<body>' . $ret->getAsHtml() . '</body>';
return;
}
$gallery->setConfig('login', true);
$gallery->setConfig('defaultAlbumId', 28426);
$gallery->setConfig('breadcrumbRootId', 28426);
GalleryMain();
Now live: DRNA Gallery
Thanks for posting this. I was having such grief getting multisite & multiroot to play nice.
Any chance you could put this tip into the discussion area at gallery.menalto.com for this module? It’s really important. Thanks
I got it to work but only to display the main page. Any links I click on the display page generates a 404. Not sure if it’s because of the URL rewrite module in use.
If you’re getting a 404 error, then the problem would be in either Apache, the Rewrites, or the URL’s that Gallery’s generating. If you’re using a .htaccess file on your main site, make sure to copy it over and modify it for the new site. If not, make sure the URL’s that are being generated match the pattern of the main URL.
OK, now I’ve got it all working except that when the user is at the item level and clicks on the root breadcrumb that would take them to the thumbnail view, I get a 404.