Struggling to get integrated

DaFoot

Joined: 2007-04-30
Posts: 15
Posted: Tue, 2007-05-01 19:48

First off, I'm new to G2 so if I 'm missing any basics let me know.Or if there is a man page I might have missed please do point it out ;)

I am trying to create a site with a simple menu bar at the top of the page that links to several pages, one of those links is to g2.

My index.php in my site root:
<?
$task = $_GET['task'];
if($task == 'gal2'){ //want to view gallery
include_once('gallery2/gallery2embedded.php');
} else { //load one of static pages
include_once 'topmenu.php';
switch($task){
case 'other':
include_once('other.php');
break;
default:
echo 'Welcome';
}
include_once 'footer.php';
}
?>
Nothing exciting there.
topmenu.php is a table with links back to the index page above (with appropriate get params).
footer.php just contains text for testing.

Now then, at the url www.frozenbanana.co.uk/ you will see the index page. Click the gallery link to start the gallery - so far so good.
But when I click on login it just redirects to index.php with default content.

I have tried resetting the .htaccess/mod_rewrite.
Tried clearing cookies and even using differant browser(s).
To no avail.

I can get the login form fine if I go direct to www.frozenbanana.co.uk/gallery2/

In my /gallery2/gallery2embedded.php I have the following:
$g2_Config['embedPath'] = '/';
$g2_Config['g2Uri'] = '/gallery2/';
$g2_Config['loginRedirect'] = '/';
//$g2_Config['embedUri'] = '/gallery2/gallery2embedded.php';
$g2_Config['embedUri'] = 'index.php?task=gal2';

I have found docs that tell me what to change these to, but simingly no explanation as to what they are/what they do.
eg. is embedUri the uri for the page that will include the gallery2embedded.php or the uri to the gallery2embedded.php?

given that the site index page lives at:
/index.php
gallery installed at:
/gallery2/
the embed script:
/gallery2/gallery2embedded.php

I suspect it is something in the .htaccess or these mysterious variables, but if someone can help me pin it down a bit more it would be much appreciated!

Long post, thankyou if you made it to the bottom!

 
DaFoot

Joined: 2007-04-30
Posts: 15
Posted: Wed, 2007-05-02 22:30

In case anyone else is struggling...

My gallery2/gallery2embedded.php uri variables ended up like this:

//http://codex.gallery2.org/Gallery2:Integration_Howto#Writing_New_Integration_Code
//$g2_Config['embedPath'] = 'http://www.frozenbanana.co.uk/';
//$g2_Config['loginRedirect'] = '/index.php?task=gal2';
$g2_Config['g2Uri'] = 'http://www.frozenbanana.co.uk/gallery2/';
$g2_Config['embedUri'] = 'http://www.frozenbanana.co.uk/index.php?task=gal2';

Which seems to work.
For what I was after I only needed to configure the g2Uri and embedUri where g2Url is the absolute URL for the installed gallery2 app and embedUri is the URL needed to call/that includes the galleryembedded.php script.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Mon, 2007-05-07 14:38

I've updated the wiki to hopefully help those that are having issues with understanding what the paths are supposed to be.

http://codex.gallery2.org/Gallery2:How_to_visually_embed_G2_in_your_own_website_using_embedded_mode

Steve Lineberry