Hi, when i try to login into my gallery or click back to the root picture, it takes me to a blank page. For the root "Gallery", it shows the link http://calhksa.com/gallery2/gallery2embedded.php?g2_highlightId=16 but it's a blank page. Everything works fine on the unembedded gallery.
My gallery2embedded.php is as follow:
Any help will be greatly appreciated. Thank you.
<?php
include("http://www.calhksa.com/include_files/header.php");
?>
<?php
$g2_Config['path'] = dirname(__FILE__) . '/';
$g2_Config['g2Uri'] = '/gallery2/main.php';
$g2_Config['embedUri'] = '/gallery2/gallery2embedded.php';
//print_r($g2_Config);
require_once( $g2_Config['path'] . 'embed.php');
if (!headers_sent()) {
header('Content-Type: text/html; charset=UTF-8');
}
$ret = GalleryEmbed::init(array(
'g2Uri' => $g2_Config['g2Uri'],
'embedUri' => $g2_Config['embedUri'],
'fullInit' => 'false',
'apiVersion' => array(1,0)
));
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)
{
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
list($title, $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
echo "<title>" . $title . " -- MySite</title>\n";
foreach ($css as $item) {
echo $item . "\n";
}
foreach ($javascript as $item) {
echo $item . "\n";
}
?>
<style type="text/css"> <!-- /*#gsHeader { display : none; } #gsFooter { display: none; }*/ --> </style>
</head>
<body class="gallery">
<?php
echo $g2moddata['bodyHtml'];
?>
<?php
include("http://www.calhksa.com/include_files/footer.php");
?>
</body>
</html>
Gallery version : 2.2.3
PHP version : 5.1.6
PHPInfo Link (see FAQ):
Webserver : Apache 1.3.37
Database : MySql 5.0.27
Activated toolkits (e.g. NetPbm, GD):
Operating system : XP
Browser :Firefox 2.0
Posts: 7
I have this problem too. I know we are supposed to search the forums for an answer to our already existing problem but what happens when I have found 5 posts with the same problem but support hasn't answered them? C'mon!!!
Posts: 31891
don't print / output anything before calling GalleryEmbed::handleRequest(). g2 might need to redirect and if you just print stuff on a HTTP redirect, it won't work.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 1
I look solution, but i put
unset($_GET['g2_highlightId']);
in top of my module for embedded gallery2
(before $data = runGallery(); )
it's work
but must be tested