...embedding G2 into a smarty website.

Rocketeer

Joined: 2005-06-15
Posts: 15
Posted: Mon, 2006-01-23 23:35

It seems... embedding is not very simple for me.

Here's the situation:
I followed the guide to embed G2 into whatever....correct path (I think) etc...
Calling the script file, where G2 is embedded I get a following error:

Warning: main(SMARTY_CORE_DIRcore.load_plugins.php) [function.main]: failed to open stream: Datei oder Verzeichnis nicht gefunden in /xxx/gallerydata/smarty/templates_c/%%108485208/%%B0^B07^B07373BD%%theme.tpl.php on line 3

Fatal error: main() [function.require]: Failed opening required 'SMARTY_CORE_DIRcore.load_plugins.php' (include_path='.:/usr/local/lib/php:.') in /xxx/gallerydata/smarty/templates_c/%%108485208/%%B0^B07^B07373BD%%theme.tpl.php on line 3

Some details:

-G2 works standalone...(newest download)
-The smarty-app works standalone...
-As you can see, the application does not the right path....'SMARTY_CORE_DIRcore.load_plugins.php' ... SMARTY_CORE_DIR should be a constant, but it's not there....strange huh?
-The smarty-app is running 2.6.5-dev

Facts:
- I can't install a newer smarty-app or I get really a lot of errors and the errors produce other errors.

Thats it...please G2-Forum.... pimp...erm....fix my application.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-24 02:21
 
Rocketeer

Joined: 2005-06-15
Posts: 15
Posted: Tue, 2006-01-24 12:49

Hi valiant, thanks for the reply.

I checked the two threads you gave me and it was the constant. Maybe it was just too late and I was searching in a total different directions. However, I defined the constant manually and it seemed to work....
Strange thing, if you click a little bit arround, you will get soon an error. I also found the problem: it's about the g2_highlightId=xyz in the called url, if I remove this part, it works. Strange.

See here:
http://www.swing.de/index.php?main=gallery&sub=swing&lang=de

 
Rocketeer

Joined: 2005-06-15
Posts: 15
Posted: Tue, 2006-01-24 13:12

oh...i forgot. I am currently checking everything in the forum i can find...the error is:
"Cannot modify header information - headers already sent by"

I searched all the files, which are being called, but no luck...

 
Rocketeer

Joined: 2005-06-15
Posts: 15
Posted: Tue, 2006-01-24 13:25

This is the "embedding-file" on the bottom it will define two "smarty" variables with the content...

<?
   define('SMARTY_CORE_DIR', 'xyz/inc/smarty/core/'); // Added.

   require_once('gallery/embed.php');

    // initiate G2 
    $ret = GalleryEmbed::init(array('embedUri' => 'index.php?main=gallery&sub=swing&lang=de',
					'embedPath' => '../',
				    'relativeG2Path' => '../gallery',
				    'loginRedirect' => '../',
				    'activeUserId' => $uid));
  if ($ret->isError()) {
    // $ret->getAsHtml() has error details..
    exit;
  }

  $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']);
  }
  
	// SMARTY ACTIONS	
	$this->assign("g2Head",$g2data['headHtml']);
	$this->assign("g2Body",$g2data['bodyHtml']);
?>

This is the page the users will call:

<!-- { include_php file="exe/load.gallery2integration.php" once="true" assign=smarty.get.lang } -->
<!-- {* -->
<HTML>
<HEAD>
<TITLE>XYZ</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK rel="stylesheet" href="../inc/css/xyz.css" type="text/css">
<script language="JavaScript" src="../_php/navi.js">

</script>
</HEAD>
<BODY onLoad="setservice()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../gfx/backgrounds/bg_display_126_139_158.gif">
<!-- *} -->
<!-- {*strip*} -->
<TABLE width="700" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="18" height="18" valign="top"><IMG src="../gfx/sonstige/spacer.gif" name="{#spacer1Name#}" id="{#spacer1Name#}" width="{#spacer1Width#}" height="{#spacer1Height#}"></td>
    <td height="18" valign="top"><IMG src="../gfx/sonstige/spacer.gif" name="{#spacer2Name#}" id="{#spacer2Name#}" width="{#spacer2Width#}" height="{#spacer2Height#}"><IMG src="../gfx/sonstige/spacer.gif" name="{#spacer3Name#}" id="{#spacer3Name#}" width="{#spacer3Width#}" height="{#spacer3Height#}"><IMG src="../gfx/sonstige/spacer.gif" name="{#spacer4Name#}" id="{#spacer4Name#}" width="{#spacer4Width#}" height="{#spacer4Height#}"></td>
  </tr>
  <TR>
    <TD height="30"></TD>
    <TD height="30" align="left" valign="top" class="Standardhead">
      <!-- {if $language eq "de" || $language eq "DE"}  -->
      Gallerie <!-- {/if}  -->
      <!-- {if $language eq "en" || $language eq "EN"}  -->
      gallery <!-- {/if}  -->
      <!-- {if $language eq "fr" || $language eq "FR"}  -->
      gallerie<!-- {/if}  -->
      <!-- {if $language eq "es" || $language eq "ES"}  -->
      gallery <!-- {/if}  -->
    </TD>
  </TR>
  <TR>
    <TD></TD>
    <TD height="300" align="left" valign="top" class="Standard" style="padding-right:40px">
	{$g2Head}
	{$g2Body}
</TD>
  </TR>
  <TR>
    <TD></TD>
    <TD></TD>
  </TR>
</TABLE>
<!-- {*/strip*} -->
<!-- {* -->

</BODY>
</HTML><!-- *} -->
 
Rocketeer

Joined: 2005-06-15
Posts: 15
Posted: Tue, 2006-01-24 13:33

Solved :-) It's a hack, but I want to sell the company a new website anyway.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-24 15:49

highlightId -> if that's a problem for you, you'll have a lot of other problems too and it's not solved by removing the highlightId feature of g2.
g2 works a lot with HTTP redirects. highlightId triggers one.
if you start outputting html / anything before calling GalleryEmbed::handleRequest(), then you'll run into this problem.

you haven't fixed it yet.
example: try editing an album name in your embedded g2.