Embedding G2

artooro

Joined: 2004-10-18
Posts: 2
Posted: Mon, 2004-10-18 15:55

I want to embed G2 into a PHP app but am having some problem. The documentation is rather hard to understand with not a whole lot of information.

I'm trying to use this code to embed G2 into a PHP file which in included by a root level PHP file.

<?php
  require_once(dirname(__FILE__) . '/gallery2/embed.php');
  $ret = GalleryEmbed::init(array(
           'embedUri' => '?view=gallery', 'relativeG2Path' => 'modules/gallery/gallery2', 'loginRedirect' => '?view=gallery'));
  if ($ret->isError()) {
    // $ret->getAsHtml() has error details..
    exit;
  }

  list ($ret, $g2data) = GalleryEmbed::handleRequest();
  if ($ret->isError()) {
    // $ret->getAsHtml() has error details..
    exit;
  }

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

But I get the following notice and nothing shows up:
[The whole date] PHP Notice: Undefined index: itemLink in /web/documents/path/machcms/modules/gallery/gallery2/modules/panorama/module.inc on line 150

I'm working on a module system for a CMS I'm working on.

I'm sure there is something wrong with what I did. Can anyone give me a hint or is embedding not yet working? I'm using CVS.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2004-10-18 16:04

artooro, take a look at the file xaruser/main.php from the archive gallery2.zip in my signature below.
'embedUri' => '?view=gallery'
-> wrong, i guess.
it should be something like 'index.php?view=gallery'
same fore 'loginRedirect'

take a look at the newest posts of the CMS topic.

and last but not least, what php app is your module for?

 
artooro

Joined: 2004-10-18
Posts: 2
Posted: Mon, 2004-10-18 16:25
valiant wrote:
artooro, take a look at the file xaruser/main.php from the archive gallery2.zip in my signature below.
'embedUri' => '?view=gallery'
-> wrong, i guess.
it should be something like 'index.php?view=gallery'
same fore 'loginRedirect'

take a look at the newest posts of the CMS topic.

and last but not least, what php app is your module for?

I'll take a look at the xaruser module.

There is nothing wrong with embedUri or loginRedirect because adding index.php to it or changing it doesn't make a difference.

I looked at the CMS topic a little but didn't take the time to go through the whole thing.

The module is for a CMS I am working on called MachCMS. It's in the pre-alpha stage right now and there is no public release yet. Still working on the module and template system.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2004-10-18 16:55

artooro, first deactivate the panorama module.. if it can't find the itemLink parameter then it is not installed correctly.
Next, try 'gallery2/' for your relativeG2Path value.

Anything in particular you found lacking in the documentation? I hope you noticed the document is only 5 days old... obviously still room for improvement.