Simple PHP integration for dummies
Pigman
Joined: 2005-07-08
Posts: 4 |
Posted: Fri, 2005-07-08 12:13 |
Hi all, Apologies for starting another thread, but I've read all I can and I'm drawing a blank. All other explanations on this I've found are related to CMS systems, or go in to too much detail with user accounts etc. :oops: I have a really simple PHP page and I want to embed my gallery in it. I dont want to use templates as this would get too messy for me to try and rebuild my pages from the inside out. Therefore I want to do a proper embed. I have one test page (test.php) in the root of my site which drives my entire site. This will be the page that has the gallery embedded within it. The gallery lives in a folder in the root ie. /gallery I have no care for syncronising security accounts etc, admin (ie. me) is the only person that will ever login. I've studied the readme file but it just confuses the hell out of me. http://cvs.sourceforge.net/viewcvs.py/gallery/gallery2/docs/EMBEDDING?rev=1.6 Any chance on someone giving me some simple code to paste, I should be able to take it from there once I have something! At the moment I just get a blank page when I call test.php. I dont really understand those variables that need to be set at the start. Here is the code... <body> <?PHP require_once(dirname(__FILE__) . '/gallery/embed.php'); $ret = GalleryEmbed::init(array( 'embedUri' => {value}, embedPath => {value}, 'relativeG2Path' => {value}, 'loginRedirect' => {value}, 'activeUserId' => {value})); 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']); } ?> </body> |
|
Posts: 32509
1. you understand that you have to replace the {value} stuff in the GalleryEmbed::init call with real values, right?
2. here's something that should work, based on your file:
Posts: 4
Thanks for that.
But I still get a blank page returned as you can see here...
http://www.filthclub.com.au/test.php
Here is the entire contents of test.php...
Posts: 4
Using your wrapper code I got that working as...
http://www.filthclub.com.au/test2.php
Posts: 4
Okay, brilliant. I appear to have got most of it working.
http://www.filthclub.com.au/main.php?subaction=photos
However, if I drill down in to a gallery, then try to use the "Gallery >>" quick links at the top, I just get a blank page.
:cry:
Posts: 32509
Pigman, if your using the script from here:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=122603&highlight=#122603
then it should work.
note:
you are not allowed to output anything, no html, if isDone is true.
Posts: 7
nm