<?php
// change this for the relative path to embed.php
require_once( 'embed.php');
$ret = GalleryEmbed::init(
array(
'embedUri' => '/index.php?module=gallery',
'g2Uri' => '/main.php',
'loginRedirect' => 'index.php?module=Login',
'activeUserId' => ''
)
);
if ($ret->isError()) {
// $ret->getAsHtml() has error details..
exit;
}
GalleryCapabilities::set('showSidebar', false);
$g2data = GalleryEmbed::handleRequest();
if ($g2data['isDone'])
// Gallery 2 has already sent output (redirect or binary data)
exit;
list ($ret, $bodyHtml, $headHtml) = GalleryEmbed::getImageBlock(array('blocks' => 'randomImage',
'show' => 'title|date'));
if ($ret) {
print 'GalleryEmbed::getImageBlock failed, here is the error message: ' . $ret->getAsHtml();
exit;
}
// Checking if $bodyHtml got anything and print it
print $bodyHtml;
?>
Posts: 5
I get blank page.. nothing printed out ..
can anyone suggest me y ?
Posts: 32509
> $ret->isError()
that method doesn't exist anymore. where did you see that code?
please use the sample wrapper script.
http://codex.gallery2.org/Gallery2:Embedding:Integration#An_entry_point
> 'embedUri' => '/index.php?module=gallery',
> 'g2Uri' => '/main.php',
the g2Uri looks wrong. i guess it's /modules/gallery2/main.php in your case.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 5
tHANKX valiant .. tHat solved the problem .. i was using wrong parameters for embed uri and g2uri
My gallery is running fine now but
But i still have some questions..
(1) when i open an image by visiting Gallery => wallpepers ==> some image .. image opens fine
but when i click Wallpapers(which is an album) or Gallery link.. gives me can not find server page..
here is the link not working
http://xxxxxx/xxxxxx/index.php?op=gallery&g2_highlightId=14
Gallery => wallpepers ==> some image [located under Gallery Logo]
Posts: 5
Also ..
(##) My Folder Tree
root/index.php CMS runs through it.
root/modules/gallery2
root/modules/gallery2/main.php
root/modules/gallery2/embed.php
root/modules/gallery2/index.php
(##) My CMS Theme Path ** i am using smarty too
root/themes/default/ header footer tpls here
root/themes/default/forum/
root/themes/default/news/
no can I put my gallery theme here and force Gallery to use this theme ?
root/themes/default/gallery/
??? is it possible
Posts: 5
Anyone plzzzzzzzzz
Posts: 1378
Generally when working with 404 errors the first trick is to disable the Gallery2 rewrite plugin, this then allows you to examine the underlying URL request to ensure it is actually valid..
I do not believe you can locate Gallery2 themes outside of the standard Gallery2 theme directory..
____________________________________
Wordpress / Gallery2 (WPG2) Author