Gallery page on Geeklog homepage

julianna

Joined: 2004-05-23
Posts: 21
Posted: Sat, 2006-12-09 01:01

Hi.

I have successfully embedded Gallery2 into Geeklog, but am wondering whether it is possible to have the main gallery page as a centerblock on the homepage. Does anyone have code for that? I searched the forum and it seems like someone was able to do this back in 2004, but the code hasn't been posted.

What I've done now is link to a few of the albums in a static page and set it as a centerblock. What I would like is for the homepage (www.transientwaters.net) to look like the gallery page (www.transientwaters.net/gallery) but with the stories etc below the gallery.

Any help would be appreciated.

Thanks.

Julianna

 
julianna

Joined: 2004-05-23
Posts: 21
Posted: Sat, 2006-12-09 18:46

I found a better way to do it, but it's still not ideal:

1. Go to the gallery page (as an anon. visitor)
2. View the page source
3. Pull the link to the CSS file and the code for the gallery
4. Paste the link to the CSS file and the code for the gallery into a static page and set as a centerblock

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2006-12-10 17:38

Try this:

require_once( '/usr/local/www/public_html/gallery2/embed.php'); // full system path to gallery2/embed.php
$ret = GalleryEmbed::init(array('fullInit' => true, 'embedUri' => '/G2Bridge/index.php?', 'g2Uri' => '/gallery2/'));
	 if ( $ret )
    {
	    echo( '   Here is the error message from G2:' );
	    echo( $ret->getAsHtml() );
	    return false;
     }
GalleryCapabilities::set('showSidebarBlocks', false);
GalleryCapabilities::set('login',false);
$g2moddata = GalleryEmbed::handleRequest();
    if (!isset($g2moddata['isDone'])) { 
        echo ('isDone is not defined, something very bad must have happened.'); 
		exit; 
	}
    if ($g2moddata['isDone']) { 
		exit; 
	}
	if ($ret) { 
		print $ret->getAsHtml(); 
	} 
GalleryEmbed::done();

echo $g2moddata['headHtml'];
echo $g2moddata['bodyHtml'];

set your staticpage to execute php.
you may also (if you wish) add activeUserId.

-s

 
julianna

Joined: 2004-05-23
Posts: 21
Posted: Mon, 2006-12-11 11:44

It works. Thanks!

Note to anyone who wants to use the code: if you have the advanced text editor set to "true", you'll have to switch it to "false" while you setup the page. Otherwise, you'll get syntax errors. Using the "source" option won't solve it (I got a blank page).

 
julianna

Joined: 2004-05-23
Posts: 21
Posted: Thu, 2006-12-14 21:54

I spoke too soon.

Although it looks great, the links the code generates are for a path to .../G2Bridge/v/... instead of .../gallery/v/...

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2006-12-14 22:04

change 'embedUri' => '/G2Bridge/index.php?' to whatever you need. ? required

-s

p.s gl 1.4.1 has a great new feature, you can post in plain text, html, or advanced editor. Eliminates the need to manually disable the advanced editor - sweet :)

 
julianna

Joined: 2004-05-23
Posts: 21
Posted: Thu, 2006-12-14 22:11

Thanks! It works (and I even checked it this time).

Thanks, too, for the tip on gl 1.4.1. Sweet indeed!