Tags: gallery2
Gallery2 plugin with TinyMCE
2008/06/04 @ 18:18I made some changes to the TinyMCE plugin for b2evolution to support some callbacks which will allow other b2evolution plugins to register TinyMCE plugins automatically. This is especially useful for the Gallery2 plugin because it will allow me to add a button that allows users to add photos from Gallery2 to their blog posts to TinyMCE automatically when the Gallery2 plugin is installed. Currently it's a pain to get it to work because the standard gallery2 image chooser button doesn't work with TinyMCE and installing it requires you to copy the g2image directory to another location.
Fortunately these sorts of callbacks are implemented in the b2evolution Plugin API already. I just needed to specify that the TinyMCE plugin has some extra callbacks and then fire the associated events at the right time. The code is a bit awkward but it serves it's purpose.
The first part is specifying the extra events.
| function GetExtraEvents() | |
| { | |
| return array( | |
| "tinymce_before_init" => "Event that is called before tinymce is initialized", | |
| "tinymce_extend_plugins" => "Event called to allow other plugins to extend the plugin list", | |
| "tinymce_extend_buttons" => "Event called to allow other plugins to extend the button list" | |
| ); | |
| } |
Then I fire the events like so. The 'tinymce_extend_plugins' and 'tinymce_extend_buttons' events allow other plugins to modify the plugins list and buttons list via a special "get_trigger_event" call.
| $tmce_plugins_array = | |
| $Plugins->get_trigger_event("tinymce_extend_plugins", | |
| array("tinymce_plugins" => $tmce_plugins_array), | |
| "tinymce_plugins"); |
The plugins list is modified on the Gallery2 plugin side by adding an implementation of the event hook. In this case the 'tinymce_plugins' key in the $params array is a reference that can be modified and passed back to the TinyMCE plugin.
| function tinymce_extend_plugins( &$params ) { | |
| array_push($params["tinymce_plugins"], "-g2image"); | |
| } |
You can view the changes made in the checked in code here.
Gallery2 for wordpress
2008/04/18 @ 11:51I took a look at the Gallery2 plugin for wordpress by ozgreg to get some ideas on how they had integrated Gallery2 with the Wordpress blog engine and how I might be able to bring those features to b2evolution. I felt somewhat bad looking at it as I've worked on by own gallery2 integration plugin for b2evolution for about a year and haven't really taken more than a cursory look at the wordpress counterpart. I felt even worse when I realized how slick it is compared to my, comparitavely, rather simple integration.
The scale and amount of code was the first thing I noticed. My gallery2 plugin is on the bigger end, in terms of lines of code, for a b2evolution plugin but the wordpress gallery2 plugin has a few times as much code. This might be seen as bloat if it wasn't for the number of features that it offers.
Both of our plugins use the Gallery image chooser (g2image) to allow users to add gallery images to posts and offer single sign on between the blog and gallery. But there are a number of things that the wordpress plugin either is done better than my plugin or isn't present at all in my plugin.
- Both of the plugins allow mapping of blog users to gallery but the wordpress plugin goes a step further and allows you to manage each user mapping and create and delete users in gallery manually. This is a cool feature and I think I'm going to create something similar in b2evolution's gallery2 plugin.
- The wordpress plugin also offers a wider range of widgets to place in the sidebar and allows more customization including a customizable template. This is cool but the implementation is questionable as it makes use of gallery's php classes themselves rather than relying on the Embedded API. It also generates the sidebar image block itself instead of letting gallery do it. I need to test it but I'm not sure if this works with say, the gallery2 multi-language plugin. I think this kind of manuvering is what precipitated the need for a release compatibility matrix which I think might be a pain for users, so I plan to add some more options while sticking as much to the embedded api as possible.
- The wordpress plugin adds a button to tinymce automatically. Currently with my plugin you have to jump through some hoops. I would like to work with the author of the tinymce plugin for b2evolution to allow me to integrate seamlessly.
- The wordpress plugin creates a page automatically that puts your gallery inside wordpress. This is pretty cool and allows users to more easily integrate their blog with gallery. I'd like to do something similar in b2evolution.
- The wordpress plugin has some url rewrite options which seem to allow you to create nice permalinks inside your embedded gallery page. This might be used somehow to preserve previous gallery permalinks, or just to make nice new permalinks inside your wordpress blog.
- The wordpress plugin searches some common paths for your gallery2 installation. Simple but a useful feature that I didn't implement into my gallery2 plugin.
That seems like a lot doesn't it? I really need to get to work to close these gaps. The wordpress plugin has predated my plugin by almost 2 years and still makes mine look like child's play in terms of features. The integration into wordpress is pretty slick too. The menus are placed in intuitive locations within the admin. That's something I might not be able to do in b2evolution given it's rather antiquated, plugin interface (essentially a Plugin class you extend overridding any needed "hook" methods).
Anyway, look for some of these improvements in the coming weeks/months. ![]()
Fat Jack recommends my plugins.
2008/03/29 @ 01:57Gallery2 Plugin 1.4 Released!!
2008/03/23 @ 21:38Version 1.4 of the Gallery2 Plugin has been released!!
The Gallery2 Plugin is a full featured plugin that provides integration between your b2evolution blog and gallery2. It supports single sign on, and adding images to posts using the Gallery2 Image Chooser.
This version adds support for gallery2 image block widget that enable you to show a random image, recently viewed image, recently added image etc. to the sidebar or page title, anywhere a widget can be added in b2evolution. See the sidebar of this blog for an example of how this looks. The image block widget works in conjuction with the Image block plugin for Gallery2 so you will need to make sure it is installed and activated in gallery2 before you can use the widget.
The Gallery2 Plugin also offers full compatibility with the Lightbox Plugin for b2evolution as well so you can include your gallery2 photos in your posts and display them using Lightbox1 or Lightbox2.
Check out a couple examples of what you can do with the plugin. Enjoy!!!
You can also make text links to images in your gallery.
Download: gallery2_plugin-1.4.zip
Gallery2 Plugin 1.3 Released!!
2007/12/11 @ 00:51The next version of the Gallery2 Plugin has been released!!
This version fixes a number of problems with different versions of
b2evolution . It should work in b2evolution 1.9.2 and newer. It was
tested in 1.9.2, 1.13.0, and 2.1.0. This version also fixes a number of path issues with previous
versions of the plugin. Paths to your gallery2 installation should be
managed correctly now.
The Gallery2 Plugin offers full compatibility with the Lightbox Plugin for b2evolution as well so you can include your Gallery2 photos in your posts and display them using Lightbox1 or Lightbox2.
Check out a couple examples of what you can do with the plugin. Enjoy!!!
| | ||
| A link to the gallery page for an item. | A lightbox link to the resized image. | A link to the parent album. |
You can also make text links to images in your gallery.
Download: gallery2_plugin-1.3.zip
Gallery2 Plugin 1.2 Released!!
2007/11/07 @ 10:42Version 1.2 of the Gallery2 Plugin for b2evolution has been released!! This release is a simple bugfix from the previous release a couple weeks ago. It fixes a number of bugs in adding images to posts and fixes various messages and improves how the plugin checks for a valid gallery installation.
It offers full compatibility with the Lightbox Plugin for b2evolution as well so you can include your Gallery2 photos in your posts and display them using Lightbox1 or Lightbox2.
Check out a couple examples of what you can do with the plugin. Enjoy!!!
| | ||
| A link to the gallery page for an item. | A lightbox link to the resized image. | A link to the parent album. |
You can also make text links to images in your gallery.
Download: gallery2_plugin-1.2.zip
Gallery2 Plugin 1.1 for b2evolution has been released!!
2007/10/25 @ 02:27Version 1.1 of the Gallery2 Plugin for b2evolution has been released!! This release adds the ability to post gallery2 photos into your b2evo posts using the Gallery2 Image Chooser.
It offers full compatibility with the Lightbox Plugin for b2evolution as well so you can include your Gallery2 photos in your posts and display them using Lightbox1 or Lightbox2.
Check out an example of what you can do with the plugin. Enjoy!!!
Download: gallery2_plugin-1.1.zip
Gallery Single Sign On Released
2007/04/28 @ 16:10Gallery Single Sign On is a b2evolution plugin that enables this site, and any other b2evolution/gallery2 site to have single sign on between the gallery and b2evolution.
More information about the plugin can be found here.
Using this plugin users can register with b2evolution and automatically have a gallery user created for them. And once logging into b2evoulution the session is carried over to gallery2. So the user will not have to log in twice and maintain two users.
When using this plugin, gallery2 admins will need to put their gallery into embedded mode. This is explained some on the gallery website. With the plugin I have included a script that will allow gallery admins to replace their existing standalone gallery installation with an embedded gallery that performs single sign on with b2evolution. If combined with gallery's url rewrite plugin the embedded gallery will work exactly the same as your existing stand alone version.
Here is a initial release: gallery_plugin-1.0.1.zip









