Gallery 2 Module

Gallery 2 Module

by Mark Nielsen -
Number of replies: 8
I'm currently coding up a Gallery 2 module for moodle but I have run into a big problem that reaches beyond my knowledge/familiarity with Moodle.

I have all of the embedding code working just fine on a basic level, but a call to Gallery 2 embed functions mess up Moodle.

After I call:
GalleryEmbed::init() in 1.5.2+ or
GalleryEmbed::handleRequest() in 1.6+

Moodle SQL functions (eg: get_records) no longer return associative arrays.  The arrays only have the numbered indexes instead of both numbered and associative.

What could Gallery 2 possibly do to cause Moodle to behave like this?  I think it might have to do with adodb, which is used by Moodle and Gallery 2.  Also, Gallery 2 is affecting some global setting because I have tried to functionalize all of my Gallery 2 calls but that did not fix the problem.

More info:  Both Gallery 2 and Moodle have their own directories and databases.

Thanks for any help,
Mark
Average of ratings: -
In reply to Mark Nielsen

Re: Gallery 2 Module

by John Papaioannou -
This is what you are looking for.
In reply to John Papaioannou

Re: Gallery 2 Module

by Mark Nielsen -
Ah-hah!  This looks very promissing.  I'll post back after I played around with it.

Thanks,
Mark
In reply to Mark Nielsen

Re: Gallery 2 Module

by Mark Nielsen -
This did the trick!

I call these lines after the Gallery2 code:

global $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE = ADODB_FETCH_BOTH;

I think I'll change it to the following later on:

global $ADODB_FETCH_MODE;
$adodbfetchbackup = $ADODB_FETCH_MODE;  // backup

// Gallery2 Code

$ADODB_FETCH_MODE = $adodbfetchbackup;  // restore

Thanks for the help!!!
Mark
In reply to Mark Nielsen

Re: Gallery 2 Module

by Paul Daniels -
Here are some scripts I use that create a user in Gallery 2 when a Moodle user is created. Also works with bulk user upload and user password changes. Very rough at this point.
In reply to Paul Daniels

Re: Gallery 2 Module

by Mark Nielsen -
Thanks for this!  I'll check it out when I can.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery 2 Module

by Genner Cerna -
Hope to see Gallery 2 and Moodle together...
In reply to Genner Cerna

Re: Gallery 2 Module

by Mark Nielsen -
Working on it smile  Getting basic implementation down first.  I'll post back to the community when the code is ready.

Cheers,
Mark