Hi-I've got a (sort of) working embedded site (http://www.dpht.co.uk/gallery/gallery2embedded.php) but when I try to perform any action such as Save changes, or Cancel, Logout etc, I am presented with a blank screen - clearly an error has occurred somewhere (no HTML source returned).
If I click 'Back' on the browser I find that the action I performed has taken (i.e. DB must have been updated) and I can then proceed, but this is not much use for my users.
I am sure that this was working and now is not.
I have tried various changes to the embedded file but to no avail. the file is reproduced below.
If anyone can help I would really appreciate it.
Many thanks in advance.
Source of gallery2embedded file:
<?php
require_once('../session_fns.php');
set_session_vars();
require_once('../bookmark_fns.php');
$g2_Config['path'] = dirname(__FILE__) . '/';
$g2_Config['embedPath'] = '/gallery/';
$g2_Config['g2Uri'] = '/gallery/';
$g2_Config['loginredirect'] = '/';
$g2_Config['embedUri'] = 'gallery2embedded.php';
//print_r($g2_Config);
require_once( $g2_Config['path'] . 'embed.php');
$ret = GalleryEmbed::init(array(
'g2Uri' => $g2_Config['g2Uri'],
'loginRedirect' => $g2_Config['loginredirect'],
'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>
<?php
$headHtml = $g2moddata['headHtml'];
do_html_gallery_header('Dartmoor Pony Heritage Trust Gallery Page',1,$headHtml);
do_html_page_heading('DPHT Gallery Pages','');
// <head>
// $headHtml = $g2moddata['headHtml'];
// //$headHtml = str_ireplace('</title>', ' -- ' . 'My Site' . '</title>', $headHtml);
// echo $headHtml;
// <style type="text/css"> </style>
// </head>
// <body class="gallery">
?>
<table border="0" cellspacing="1" bgcolor="#CBC8AB" width="100%">
<tr><td valign="top" width="16%">
<?php
do_html_left_panel();
?>
</td><td valign="top"><font size="2" face="Arial">
<?php
echo $g2moddata['bodyHtml'];
?>
</td></tr></table>
<?php
// </body>
do_html_footer(0);
?>
</html>
NOTE: $ret output commented out because ALWAYS returns text
Posts: 5
I should add that if you access the gallery in non-embedded mode through http://www.dpht.co.uk/gallery/main.php then everything works fine, so it is definitely the embedding that is causing the problem.
I have also noticed that the captcha picture also does not display in embedded mode but works fine in non-embedded mode.
Thanks
Posts: 5
System Information is as followsa:
Gallery version = 2.0.2 core 1.0.0.2
PHP version = 5.0.5 cgi
Webserver = Apache
Database = mysql 4.1.19-standard
Toolkits = ArchiveUpload, Exif, ImageMagick, NetPBM, SquareThumb, Thumbnail, Gd
Operating system = Linux weshsrv038.weshsrv038.co.uk 2.6.17.7 #2 SMP Tue Jul 25 19:02:31 BST 2006 i686
Browser = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser; Avant Browser; .NET CLR 1.1.4322; InfoPath.1)
To simply reproduce the problem go to http://www.dpht.co.uk/gallery/gallery2embedded.php, click on the gallery 'Register' button and then press 'Cancel' on the Register page.
Posts: 32509
I suspect that you start outputting HTML before the GalleryEmbed::handleRequest() call.
first call GalleryEmbed::handleRequest(),
then start outputting the head / title / menu of your page along with the html from G2.
Posts: 5
Hi Valiant
In doing some other work I spotted some stray HTML which seemed to be preceding my <html> statement. Fixed that then read your reply, checked again and it seems to work.
Many thanks for your input, it is greatly valued by a relative newcomer to Gallery.
Thanks again
torwalker
Posts: 1
I had the same problem. One of my own php include files I added at the top of gallery2embedded.php had two blank lines at the end of the file. After deleting the blank lines, the problem went away.