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

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

 
valiant

Joined: 2003-01-04
Posts: 32509
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

 
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

 
macmeister

Joined: 2005-01-21
Posts: 39
Posted: Sat, 2008-06-07 14:32

I had to post that romanmd's solution appears to have worked for me. Some links that came up empty are working fine now.
I just put that line at the very top of my embedded code, like so:

unset($_GET['g2_highlightId']);
$g2_Config['path'] = dirname(__FILE__) . '/';
$g2_Config['g2Uri'] = '/g2/';
$g2_Config['embedUri'] = '/g2/gallery2embedded.php';
........

 
Bob Weber

Joined: 2008-12-02
Posts: 24
Posted: Fri, 2008-12-05 05:06

having same prob, inserted code in index.php like this:

unset($_GET['g2_highlightId']);
require_once('embed.php'); // Path to Gallery's embed.php
$ret = GalleryEmbed::init(array( 'g2Uri' => '/gallery/', 'embedUri' => '/gallery/index.php', 'fullInit' =>'false'));

fixed directory changes but not login and I also get the blank page switching between user and guest display modes and when in admin mode and clicking new group, new user, save theme, etc. buttons.

Any ideas? Thanks,
BobW

 
Bob Weber

Joined: 2008-12-02
Posts: 24
Posted: Fri, 2008-12-05 19:16

FYI... problem solved. Don't need unset code. user suprsidr was brilliant enough to figure out my editor(s), notepad and/or dreamweaver added code and corrupted the php.