Embed specific subgallery.
|
brycekmartin
Joined: 2009-10-30
Posts: 6 |
Posted: Sun, 2009-11-01 12:58
|
|
I want to be able to embed a specific subgallery on a specific page on a website. Something like the following explanation. I have www.example.com. The gallery is www.example.com/gallery2. But I have two pages already set up that are... www.example.com/custom.html and www.example.com/pictures.html What I want is to be able to use the www.example.com/gallery2 as an admin login which does not give you an entry point to the gallery until you log in, but have the custom.html and pictures.html each have a different subgallery embedded on them that are styled like the website. These subgalleries should also not be able to link upwards to the main gallery entry point. I'm trying to get some segregation at the subgallery level so that they are viewable only. Is this possible? And if so, how would I go about doing it? Thanks |
|
| Login or register to post comments |

Posts: 2670
http://www.flashyourweb.com/staticpages/index.php?page=mediaBlock
or to actually embed the gallery in a page(you can specify which album)
http://www.flashyourweb.com/staticpages/index.php?page=gallery2_embed-o-rator
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 6
I had used the embed-o-rator, but I think I overlooked the album ID box. I'll try again this afternoon with that and see if I can get my desired result. Thanks again. Great tool by the way. :D
Posts: 6
Ok, So I tried to get this working and I'm getting a T_STRING error. I specified all the paths I think. Is the album id that long string of gumbeledness? Mine looks like 8d9d3226b5982f62be5bccbd1410a059.
Here is the exact error string...
Parse error: syntax error, unexpected T_STRING in /var/www/inaglaze/custom/gallery2Embedded.php on line 9
Here is the code...
<?php require_once ('http://localhost/inaglaze/gallery2/embed.php'); $ret = GalleryEmbed::init( array ('g2Uri'=>'http://localhost/inaglaze/gallery2/main.php', 'embedUri'=>'http://localhost/inaglaze/custom/gallery2Embedded.php', 'fullInit'=>'false')); if ($ret) { print 'G2 init error: '.$ret->getAsHtml(); } $gallery->setConfig('showSidebarBlocks', false); $gallery->setConfig('login', false); $gallery->setConfig('defaultAlbumId', 8d9d3226b5982f62be5bccbd1410a059); $gallery->setConfig('breadcrumbRootId', 8d9d3226b5982f62be5bccbd1410a059); $g2data = GalleryEmbed::handleRequest(); if ($g2data['isDone']) { exit; } GalleryEmbed::done(); ?> <!-- Your Html Head --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title>Custom Work</title> <link href="http://localhost/inaglaze/CSS/site.css" rel="stylesheet" type="text/css" /> <!-- Gallery's Head --> <?php echo $g2data['headHtml']; ?> <!-- End Gallery's Head --> </head> <!-- End Your Html Head --> <!-- Your Html Body --> <body> <html> <head> <title>In A Glaze - Custom Work</title> <link rel="stylesheet" type="text/css" href="CSS/site.css" /> </head> <body> <div class="tabHeader"> <div id="tab1"><span id="tabHome" class="tabs"><a class="tabLinks" href="index.html">home</a></span></div> <div id="tab2"><span id="tabCustom_Active" class="tabs">custom works</span></div> <div id="tab3"><span id="tabGallery" class="tabs"><a class="tabLinks" href="gallery.html">gallery</a></span></div> <!--<img src="tabheader.jpg" width="900px" height="70px" />--> </div> <div id="wrapper2"> <div id="head"> <!-- End Your Html Body --> <!-- Gallery's Body --> <?php echo $g2data['bodyHtml']; ?> <!-- End Gallery's Body --> <!-- Your Html Footer --> </div> <!--<div id="main"> </div>--> </div> </body> </html> </body> </html> <!-- End Your Html Footer -->what am I missing? What could be causing this?
Posts: 2670
this is a path, not a url.
it would be more like /var/www/inaglaze/custom/gallery2/embed.php
and no, that would not be your default albumId.
when you navigate your gallery http://www.yoursite.com/gallery2/main.php?g2_itemId=30
or if you have rewrite obscuring the itemId try editing the album you should see it in that url.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 6
If I want to have a gallery2Embedded.php for each subalbum, can I have more than one gallery2Embedded.php files? I realize they would all have to be named different. Basically, does it HAVE to be named gallery2Embedded.php to work, or could it be anything.php?
Posts: 3371
You can call it anything you want and have as many as you like. But don't overwrite any of the existing php files (like embed.php or main.php) by mistake.
As supersidr says, the defaultAlbumId and breadcrumbRootId should both be nice small integers that are the itemIds of whichever albums you want to show (I think) and be the root of the breadcrumb trail respectively. The root album is usually itemId=7, I believe. (If you pick a wrong number you'll get an error message on screen.)