Problem Integrating Gallery2 into my script... Plz help

babablacksheep

Joined: 2007-09-05
Posts: 5
Posted: Wed, 2007-09-05 08:21

Hai..
Here is The Scenario ..
(##) I have designed a CMS that already uses smarty. That means integrating Gallery 2 will run 2 smarty instances but no problem about that .

(##) 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
Installed successfully and added few albums and pics [Standalone]

root/modules/gallery2/test.php for testing Integration..

(##) My Script
I was tring to test if i can get anything using getimageblock but i get nothing except blank page returned

Quote:
<?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;
?>

 
babablacksheep

Joined: 2007-09-05
Posts: 5
Posted: Wed, 2007-09-05 08:25

I get blank page.. nothing printed out ..
can anyone suggest me y ?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2007-09-05 12:06

> $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

 
babablacksheep

Joined: 2007-09-05
Posts: 5
Posted: Sun, 2007-09-09 12:57

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]

 
babablacksheep

Joined: 2007-09-05
Posts: 5
Posted: Sun, 2007-09-09 13:02

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

 
babablacksheep

Joined: 2007-09-05
Posts: 5
Posted: Wed, 2007-09-12 08:00

Anyone plzzzzzzzzz

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Mon, 2007-09-17 00:17

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