Embed into existing page

elkiwi

Joined: 2005-04-06
Posts: 1
Posted: Wed, 2005-04-06 18:16

Hi I realise this is a much disscussed topic and I have read instructions. I have this code on an existing page inside a table.

<?php 
require_once(dirname(__FILE__) . '/gallery/embed.php');
  $ret = GalleryEmbed::init(array(
           'embedUri' => 'people.php', 'relativeG2Path' => 'gallery', 'loginRedirect' => 'gallery/main.php',
           'activeUserId' => ''));
  if ($ret->isError()) {
    $ret->getAsHtml() 
    exit;
  }

  $g2data = GalleryEmbed::handleRequest();
  if ($g2data['isDone']) {
    exit; // G2 has already sent output (redirect or binary data)
  }

?>

The page produces no errors but also no gallery.

http://www.kiwi-designed.com/whatsup/people.php

Am I doing something wrong?

Thanks

Peter

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-04-06 18:49
Quote:
$g2data = GalleryEmbed::handleRequest();
if ($g2data['isDone']) {
exit; // G2 has already sent output (redirect or binary data)
}

// Use $g2data['headHtml'] and $g2data['bodyHtml']
// to display G2 content inside embedding application
// if you don't want to use $g2data['headHtml'] directly, you can get the css,
// javascript and page title separately by calling...

if (isset($g2moddata['headHtml'])) {
list($title, $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
}

i.e.
add
print $g2data['bodyHtml'];
to your script.