CMSMadeSimple + G2

axman

Joined: 2002-09-07
Posts: 57
Posted: Fri, 2006-07-28 04:56

I am having trouble trying to embed g2 into cmsms. The php error I get is:

PHP Fatal error: Call to undefined method mysql_driver_ResultSet::FetchRow() in /usr/local/lib/gallery2/modules/core/classes/GalleryStorage.class on line 1279

This is a multi install setup of gallery2. However, i downloaded the sample embed zip file and tried that stand alone, in the cmsms directory and that worked fine. The file was run from /site/test.php. So something weird is happening.

The install of cmsms resides in /site and the gallery install is in /gallery2.

Here is the snippet of code im currently playing with while attempting to embed it:

                $g2_embedding = "/home/path/to/gallery2/embed.php";

                require_once($g2_embedding);

                // if anonymous user, set g2 activeUser to ''
                $uid = '';

                // initiate G2
                $ret = GalleryEmbed::init(array('g2Uri' => '/gallery2/',
                                    'embedUri' => '/site/index.php?page=gallery2',
                                    'activeUserId' => $uid));

                $g2data = GalleryEmbed::handleRequest();

                // show error message if isDone is not defined
                if (!isset($g2data['isDone'])) {
                        print 'isDone is not defined, something very bad must have happened.';
                        return false;
                } else 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
                // if you don't want to use $g2data['headHtml'] directly, you can get the css,
                // javascript and page title separately by calling...
                $this->g2data = $g2data;
                return true;

Any suggestions as to what may be going on?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2006-07-28 05:10

> PHP Fatal error: Call to undefined method mysql_driver_ResultSet::FetchRow() in /usr/local/lib/gallery2/modules/core/classes/GalleryStorage.class on line 1279

does your integration replace / change GalleryStorage.class ???

there's no mysql specific code in that file.

 
axman

Joined: 2002-09-07
Posts: 57
Posted: Fri, 2006-07-28 12:22

Nope, it doesnt change or replace GalleryStorage.class.

The error appears to be thrown above when the GalleryEmbed::handleRequest() function is called. I'm rather confused as to whats happened

 
axman

Joined: 2002-09-07
Posts: 57
Posted: Sat, 2006-07-29 05:08

I have changes things around a bit, and now I am getting:

Fatal error: Call to a member function isError() on a non-object in /home/user/mydomain.org/docs/site/modules/G2Mod/G2Mod.module.php on line 99

The variables i'm passing are:

[embedUri] => /site/index.php?page=gallery
[g2Uri] => /gallery2/

The G2 Embed Code is:

        function openGallery2($page)
        {
                require($this->GetPreference('g2_embed_php'));

                error_reporting(E_ALL);
                ini_set('display_errors', 1);
                $g2_relative = $this->GetPreference('g2_relative'); // '/../../../gallery2/'
                $g2_embedding = $this->GetPreference('g2_embedding'); // '/cms'

                $ret = GalleryEmbed::init(array('embedUri' => $g2_embedding,
                                                'g2Uri' => $g2_relative,
                                                'loginRedirect' => null,
                                                'activeUserId' => null));
                if($ret->isError())
                {
                        $ret->getAsHtml();
                        exit;
                }

                $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
                // if you don't want to use $g2data['headHtml'] directly, you can get the css,
                // javascript and page title separately by calling...
                $this->g2data= $g2data;

                return true;
        }

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2006-07-30 02:59

isError() is from gallery 2.0, there are several other simple embed examples for Gallery 2.1 or greater.
Try here.

-s

 
axman

Joined: 2002-09-07
Posts: 57
Posted: Sun, 2006-07-30 03:53

Now i'm back to the same orginional error:

PHP Fatal error: Call to undefined method mysql_driver_ResultSet::FetchRow() in /usr/local/lib/gallery2/modules/core/classes/GalleryStorage.class on line 1279

 
rudolfpietersma

Joined: 2003-01-09
Posts: 45
Posted: Fri, 2006-08-25 11:10

I'm curious how to get Gallery 2 into CMSMS.
I'm allready using Gallery for some time now but I'm very new in CMSMS.

Can somebody help me and tell me what exactly to do.
I looked around in the forums but could not really find any helpfull things. The only thing that I did was creating the gallery2embedded.php file.

Cheers,
Rudolf.

 
axman

Joined: 2002-09-07
Posts: 57
Posted: Tue, 2006-08-29 16:31

I am currently working on a module for CMSMS that will do all the grunt work for you. The project page is here: http://dev.cmsmadesimple.org/projects/gallery2embed/

 
rudolfpietersma

Joined: 2003-01-09
Posts: 45
Posted: Tue, 2006-08-29 16:49

Great! Really looking forward to the stuff...!!

Rudolf.