Embedding features and code snips

analogrithems

Joined: 2005-03-30
Posts: 1
Posted: Wed, 2005-03-30 02:25

Can some one tell me how to use the embededd code to access things like the admin areas. So I can upload through embed

Also is their a way to call embed and pass it a groupid and make it show that groups albums only?

And for anyone else having trouble, here is a snip from my code on using embed so far.
It's pretty much right from the docs
require_once(_808ROOT_ . '/gallery2/embed.php');
$ret = GalleryEmbed::init(array(
'embedUri' => 'gallery.php', 'relativeG2Path' => 'gallery2/', 'loginRedirect' => 'index.php',
'activeUserId' => $_SESSION['customer_id']));
if ($ret->isError()) {
echo $ret->getAsHtml();
exit();
}

GalleryCapabilities::set('showSidebar', false);
GalleryCapabilities::set('showSidebarGreeting', false);
GalleryCapabilities::set('showPathbar', true);

$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

echo $g2data['bodyHtml'];

Incase anyone is wondering, I'm using CVS currrent. as of 3/29/05 THe session sync code works really well, and it notices I'm logged in, but I don't ever get to see the upload or album manager drop downs. Anyone else have any luck?

-Analogrithems

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-03-30 06:52
Quote:
Can some one tell me how to use the embededd code to access things like the admin areas. So I can upload through embed

there's no difference admin and non admin views. take a look at docs/EMBEDDING.

Quote:
Also is their a way to call embed and pass it a groupid and make it show that groups albums only?

no

you deactived the menus ( GalleryCapabilities::set('showSidebar', false); , GalleryCapabilities::set('showPathbar', true);
), that's why you don't see the admin things.