blank page on my embedded G2 when logging in/out or clicking back to root picture.

coolerr

Joined: 2007-11-07
Posts: 1
Posted: Wed, 2007-11-07 03:41

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

Login or register to post comments
anexemines

Joined: 2008-01-14
Posts: 7
Posted: Thu, 2008-01-17 03:02

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!!!

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 31891
Posted: Sun, 2008-01-20 03:04

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

Login or register to post comments
romanmd

Joined: 2005-01-21
Posts: 1
Posted: Wed, 2008-02-06 10:49

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

Login or register to post comments