Version 2.2 of G2Image, the Gallery2 Image Chooser, is out. Please download it here.
Changes:
-Eliminated use of G2 ImageBlock call in the backend. This eases getting information about a Gallery2 item.
-Updated the Album selection so that it loads all albums in a tree and automatically reload the page on album selection.
-Added support for a LightBox HTML tag and fullsized image HTML tags.
-FCKEditor integration
-Cleaned up the GUI a little (made the "sort by" and "images per page" select boxes force a redraw automatically instead of requiring another button press.)
Notes:
-G2Image 2.2 requires Gallery2 2.2
-Wordpress users should download the WPG2 v3.0 SVN snapshot, which includes G2Image 2.2 in its entirety. G2Image 2.2 is not backwards compatible with WPG2 2.1 or earlier.
-Joomla JCE users should leave the file zipped and install it using the plugins manager under the JCE component.
Demos:
TinyMCE
Standalone
Chinese Translation
Thanks to all who contributed ideas, language files, and beta testing,
Kirk
Posts: 8339
Great!
Added my Geeklog configs, and it seems to be working fine
A little more testing and I'll release it to the Geeklog community.
Was wondering which changes make it incompatible with Gallery 2.1?
-s
FlashYourWeb and Your Gallery
Posts: 492
It's really just the two calls to GalleryCoreApi::getDefaultAlbumId in g2image.php
If you know another way to get the root album easily in G2 2.1, I'd be happy to switch it.
FYI, I'm also working on 3.0, which will have the ability to add multiple images at one time. I should have a beta out in a week or two, with final release in about a month.
Posts: 8339
perhaps something like:
list ($ret, $albums) = GalleryCoreApi::fetchAlbumTree();
list ($ret, $albums) = GalleryCoreApi::loadEntitiesById(GalleryUtilities::arrayKeysRecursive($albums));
$albums[0] should be root.
I'm sure GalleryCoreApi::getDefaultAlbumId was added for more than convenience.
Maybe first check to see if the function exists before trying the other.
-s
FlashYourWeb and Your Gallery
Posts: 492
Thanks. I didn't know about that recursive galleryutilities call. That should do the trick. I'll give it a shot tonight. Assuming it's good to go, I'll release a 2.2.1 with the requirement relaxed to G2 2.1.x.
Cheers,
Kirk
Posts: 492
$albums[0] turns out to be the first subalbum in the root album, so you can get the root album id with $albums[0]->getParentId().
I just need to finish modifying the code and do testing on several platforms to make sure that it works, and then I'll package it as 2.2.1.
I think the other thing that GalleryCoreApi::getDefaultAlbumId does is lets you get the default album for that user, which could be different than root. But it's worth opening it to G2 2.1 to get to the root in 2.1 and default in 2.2.
Thanks,
Kirk
Posts: 8339
Speaking of active user - are you checking the session for active user?(sorry I haven't looked over your code)
Something I do in my embed, is check to see if we are using the userAlbum module. If so, I give the active user a link to his/her album on the user menu.
Something that may be nice for 3.0 is to give the active user access only to albums owned by himself or he has permission to view. Of course root user would have access to all.
Also it would be nice to be able to actually embed audio/video items in stories/comments via G2Image not just link to them.
I noticed your wp demo seems to have styles in the G2Image popup, is there a place where we could attach our own style sheet? The standalone and my embed seems a little plain.
I really like the functionality better over 1.0
-s
FlashYourWeb and Your Gallery
Posts: 492
Hmm, neither of these work to test if the function exists:
It seems like one of them should work.
Any ideas?
Posts: 8339
Couldn't you try executing GalleryCoreApi::getDefaultAlbumId and if it returns an error...
-s
FlashYourWeb and Your Gallery
Posts: 8339
Ah! http://www.php.net/manual/en/function.method-exists.php
-s
FlashYourWeb and Your Gallery
Posts: 492
Thanks. It didn't like method_exists, either. But now I know about that function!
Valiant told me to use
where the 7,5 is from the API change for the function. API version 7.5 is where getDefaultAlbumId was added as documented here.
So, what I ended up with was
I'm not checking the active user now. But it is a good idea for 3.0.
Posts: 32509
the else case should be:
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 492
Thanks, Valiant!