[solved] Errors on GalleryEmbed::getImageBlock

ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sat, 2005-04-30 01:18

I been having trouble with the GalleryEmbed::getImageBlock. I implemented a randomphoto and a get gallery image function but the random function has suddenly failed with the following error...

Input Array does not match ?: SELECT DISTINCT g2_AccessMap.g_accessListId FROM g2_AccessMap WHERE (g2_AccessMap.g_userId = NULL OR g2_AccessMap.g_groupId IN (1)) AND g2_AccessMap.g_permission & 1 =

I recreated the test function (see below) to reproduce the error..

http://devtest.ozgreg.com/galleryphoto.php

require_once(dirname(__FILE__) . '/gallery2/embed.php');

$ret = GalleryEmbed::init(array('embedUri' => 'gallery2.php', 'relativeG2Path' => 'gallery2' ) );
list ($ret, $g2data) = GalleryEmbed::getImageBlock(array ('blocks' => 'randomImage', 'show' => 'none', 'activeUserId' => '', 'maxSize' => ''));

if ($ret->isError()) {
     $ret->getAsHtml();
}

print $g2data;
 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sat, 2005-04-30 02:52

Had a IRC session over this and partly solved the issue by calling a fullinit -> true in the GalleryEmbed::init

		$ret = GalleryEmbed::init(array('embedUri' => '/wp-gallery2.php', 'relativeG2Path' => 'gallery2/', 'activeUserId' => '', 'fullInit' => true ) );

However I have noticed although 'activeUserId' => '' = null when you click on the random photo it is still creating a session ID

(g2_GALLERYSID=78ddd776dcb1961d5c30363d895f0919)

My understanding is it should not be creating sessionID's for guests??

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-04-30 04:31

guests do get sessions. search engines do not.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2005-04-30 21:10

Not entirely true. Search engines share the same session. Ie, we create one session for google (per source server) and all googlebot requests are automatically in that session. This allows us to drop the session id from the url which makes our urls more friendly for search engines.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-04-30 21:42

oh right, I forgot the "Later on we won't even save the session anyway" comment in the code is incorrect...

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2005-05-01 00:24

What do you mean incorrect? It's correct .. uh, now that I updated it. Yeah. :-D