I can get the first page of my gallery to embed, but when I click on an album, it is no longer embedded in the php page any longer. My gallery is installed at studio333.com/gallery2 and my website is studio333.com/secure. The page where the gallery should be embedded is: https://www.studio333.com/secure/index.php?main_page=page_8
Here is my gallery2embedded.php file:
<?php
$g2_Config['path'] = dirname(__FILE__) . '/';
$g2_Config['embedPath'] = '/';
$g2_Config['relativeG2Path'] = '/gallery2/';
$g2_Config['embedUri'] = 'gallery2/gallery2embedded.php';
//print_r($g2_Config);
require_once( $g2_Config['path'] . 'embed.php');
$ret = GalleryEmbed::init(array(
'embedPath' => $g2_Config['embedPath'],
'relativeG2Path' => $g2_Config['relativeG2Path'],
'embedUri' => $g2_Config['embedUri'],
'fullInit' => 'false',
'gallerySessionId' => $_COOKIE['PHPSESSID']
));
GalleryCapabilities::set('login',true);
// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();
// show error message if isDone is not defined
if (!isset($g2moddata['isDone']))
{
print 'isDone is not defined, something very bad must have happened.';
exit;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone'])
{
exit; /* uploads module does this too */
}
if ($ret->isError())
{
print $ret->getAsHtml();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<?php
$headHtml = $g2moddata['headHtml'];
//$headHtml = str_ireplace('</title>', ' -- ' . 'My Site' . '</title>', $headHtml);
echo $headHtml;
?>
<style type="text/css"> </style>
</head>
<body class="gallery">
<?php
echo $g2moddata['bodyHtml'];
?>
</body>
Posts: 32509
you should put your gallery2embedded.php in / and not in /gallery2/
also, change then your embedUri to 'gallery2embedded.php'
Posts: 8
Thank you very much Valiant, it is now embedded. But the login still goes to the Gallery 2 login. It is sitting inside of Zencart and the users will log into Zencart. Do I need to add the "login" pieces of code that I see out on the forums. Otherwise people can copy and paste URL's.