New Wordpress Plugin: WP-Gallery-Remote

cb2206

Joined: 2004-09-30
Posts: 19
Posted: Sun, 2007-08-05 07:00

Hi,

I wrote a wordpress plugin, that accesses Gallery installations to include images and albums into wordpress pages and posts.

Some of its features:
* displays images and albums of Gallery installation
* Lightbox integration
* supports caching of fetched album and image meta data (can be enabled/disabled globally and per post/page)
* include/exclude filter to only show some images from an album
* global and per post/page options to display album title and subalbums
* uses Gallery’s image captions

I would be glad to get any feedback!

http://blog.thebartels.de/projects/wp-gallery-remote/

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2007-08-09 22:56

Cb2206,

Not sure if you know about the (existing) G2Image Plugin that is a tinymce plugin which actually does the majority of what you have already done which is included in the WPG2 Plugin. I know Capt_Kirk would love to see your plugin and I hope the pair of you could work together maybe to create a new version of the image selector that would work for many of the embedded G2 applications, not just wordpress (G2image does this already).

Capt_Kirk should be online into this forum soonish we are just moving the forums across in the next week or two..

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Thu, 2007-08-09 23:22

Hi ozgreg,

thanks for your comment. Yes, I know G2image and had a look at it. The difference is, that my plugin uses the Gallery Remote Protocol to access Gallery. This allows using images from Gallery installations you do not own, but are accessible remotely. Furthermore I plan to support for multiple Gallery installation in parallel.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2007-08-09 23:57

Very Interesting Concept. I suspect you post URL Links then, unlike G2 Image which posts WPG2 Tags?

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Fri, 2007-08-10 00:47

The tinymce plugin for selecting an album from Gallery produces tags like these:
{wp-gallery-remote:rootalbum=12396;showalbumtitle=false;showsubalbums=false;showimagesheader=false;thumbsize=90;nocaching=false;}

These tags are then converted by the gallery plugin on the fly during post/page rendering. The album and image meta data is cached is wordpress' db, so that rendering the output is pretty fast (between 1 and 5 milliseconds on my intel mac mini). The output contains the links which are returned via the Gallery Remote Protocol.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Fri, 2007-08-10 01:03

Nods, I see what you are driving at.. You be interested in adding hooks into WPG2?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2007-08-10 02:14
cb2206 wrote:
....This allows using images from Gallery installations you do not own, but are accessible remotely. ....

I would like to see a configuration section where you add various galleries and then the UI could have a dropdown where you can select the "remote" galleries.

Another feature request: add some formating ( align=right, align=left, float, etc ) similar to the G2Image Plugin.

Other than that; I like it.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Fri, 2007-08-10 04:04

Hooks in what kind of way?

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Fri, 2007-08-10 04:06

The support for multiple galleries is not yet implemented, but will be one of the next features.
I added the formatting request to my todos list.

Thanks a lot for your feedback!

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Fri, 2007-08-10 18:52

Hi cb2206,

This looks very cool! Looks very similar to the Crossroads plugin
I use for Flickr. Since your plugin can also include Albums what if the album had say 100 pictures or more.?
Does only the album highlight thumb display or would all 100 thumbs display in a post or could your plugin set a user definable limit?

EDIT: "include/exclude filter to only show some images from an album". Guess that answers my question.

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Fri, 2007-08-10 19:17

Hi swordfish,

thanks a lot.

yes, the include/exclude filter allows to pick only some photos of an album.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Tue, 2007-08-14 15:53

Very cool plugin! I'm looking at it now for the first time. I really like the G2 remote implementation. This would also be cool as a FireFox plugin to allow you to insert links into e-mails, forum postings, etc.

I think what Ozgreg meant about hooks into WPG2 is to output a tag that looks like <wpg2>27</wpg2>.

I'll install the plugin on my testbed later today. I'm currently refactoring the backend of G2Image to make it less of a hack. Once I'm done with that, I'll probably take a look at the way you allow selection of multiple images at once. It looks like it might solve the same problem for me.

Thanks for the acknowledgement! I'll be sure to return the favor after I get the inspiration I'm sure to get when I look at your code.

Cheers,
Kirk

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Sat, 2007-08-18 01:04

The idea for a firefox extension is very interesting. Perhaps I will have a look into it in the next weeks.

Currently WP-Gallery-Remote does not output tags, because the tag implementation looked a little bit confusing to me (just had a quicklook) and therefore just outputs something like {wp-gallery-remote: param1=foo; param2=bar;}.

BTW...last weekend I implemented support for multiple galleries and an alternative carousel output which does not bloat up posts so much, if you want to include many pictures.

I still need to fix some minor issues. The next version will probably be released next weekend.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Tue, 2007-08-14 16:26

Very cool carousel!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-08-14 23:59

The carousel is indeed cool! It would be nice to have some external ( not WP ) bit of code that you could include it on an external page like the imageblock.
Come to think of it... making it a block would bee cool as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Wed, 2007-08-15 00:19
floridave wrote:
The carousel is indeed cool! It would be nice to have some external ( not WP ) bit of code that you could include it on an external page like the imageblock.
Come to think of it... making it a block would bee cool as well.

Do you want to have only the carousel itself as an external bit of code or the complete "output Gallery images via Gallery Remote Protocol in a carousel" stuff?

If it's the first case, then you can have a look at http://prototype-carousel.xilinus.com/. This is the carousel component based on prototype and script.aculo.us, which I am using.

For the second case: Might be possible, but there is probably a lot of refactoring necessary to have only one codebase for standalone and wp plugin.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Wed, 2007-08-15 04:03

Yeah I see you are turning (Downloadable) links to Gallery2. The G2Image returns a WPG2 Tag directly into WP Post (rather than the URL) the tag is along the lines of <wpg2>id|size</wpg2>

ID=G2Entity id so it is very simple to return it.. (it is usually &g2_itemId=10465)

So rather than returning the URL, if you insert the posts into WP as a WPG2 tag then the WPG2 plugin will pickup those links and run with them..

As I said like what you have done, and love for you to link your functionality into WPG2 plugin..

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Wed, 2007-08-15 04:38
ozgreg wrote:
Yeah I see you are turning (Downloadable) links to Gallery2. The G2Image returns a WPG2 Tag directly into WP Post (rather than the URL) the tag is along the lines of <wpg2>id|size</wpg2>

ID=G2Entity id so it is very simple to return it.. (it is usually &g2_itemId=10465)

So rather than returning the URL, if you insert the posts into WP as a WPG2 tag then the WPG2 plugin will pickup those links and run with them..

As I said like what you have done, and love for you to link your functionality into WPG2 plugin..

I am not sure whether I got what you wrote. :-)

WP-Gallery-Remote is like a combination of G2Image and WPG2. You can browse and select Gallery's albums and images in a Album Chooser Window. The selection is then put as a kind of tag into a WP post/page. (That's what is G2Image doing from my understanding)
Real life example: {wp-gallery-remote: rootalbum=12572; showalbumtitle=false; showsubalbums=false; showimagesheader=false; thumbsize=90; nocaching=false;}
This "tag" is then converted on the fly during page generation to <a title="" href=""><img src=""></a>. (Thats what WPG2 is doing from my understanding.)

If WP-Gallery-Remote would create WPG2 tags to let WPG2 to the work during page rendering, it seems to have the following limitations:
- only one blog per gallery
- only one gallery per blog (because WPG2 only supports one gallery)
- WP & Gallery have to be installed on the same server
- The result would be the same as using G2Image and WPG2

Advantages:
- it would support user authentication

...or am I totally wrong?

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-08-15 18:50

I played with WP-Gallery-Remote some last night. Great job! I've already hacked your code to make the Gallery selector work in G2Image, and I'm looking at how I can make the select box/magnifier combination work there, too.

The biggest reasons that I see to use WP-Gallery-Remote are 1) it's very simple to set up, so if someone doesn't need sidebar widgets and user authentication, it's very straight forward to set up, 2) if you need to photoblog from a Gallery that you do not own, or from multiple Gallerys.

The reasons someone would want to use WPG2 instead is if they want a truly integrated photoblog, where the full Gallery presentation is wrapped in a WP wrapper. e.g., www.steffensenfamily.com, or www.ozgreg.com. You also get the advantages of user authentication, allowing site admin from one login instead of two.

So, as I see it, they're not competing ideas, but complementary ones. The key to avoiding confusion on the users' part is to lay out something like this so that they'll understand how each tool can best be used.

Also, as far as I can tell, they're not mutually exclusive. I have both installed on my testbed, and they seem to be playing well together. So, you could use WPGR to make that cool carousel/lightbox thing, and still use WPG2 to make the sidebar images and links to a fully embedded album.

Does that sum it up pretty well?

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Wed, 2007-08-15 23:27

Yes! That's exactly how I am thinking about it. If you don't mind, I will take your explanation as an item in the FAQ, which I am planning for the next WPGR release.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-08-15 23:36

Sounds great! I'm looking forward to seeing it.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2007-08-16 03:42
cb2206 wrote:
If WP-Gallery-Remote would create WPG2 tags to let WPG2 to the work during page rendering, it seems to have the following limitations:
- only one blog per gallery
- only one gallery per blog (because WPG2 only supports one gallery)
- WP & Gallery have to be installed on the same server
- The result would be the same as using G2Image and WPG2

Advantages:
- it would support user authentication

...or am I totally wrong?

No you hit the nail right on the head, the way the embedding API works limits us a fair degree on user syncing etc which is why we only support one G2 (to be honest I am not 100% happy with this limitation and like your concept using G2 remote which is a much better way of inserting) and the one server is again a limitation of the API which I would love to be more truly remote.

I like your solution because it over comes the one last real limitation we are dealing with (which Capt Kirk is working around and so will I) which is removing the imageblock module which was great back in WPG2 1.0 days but we really really need to get away from it as it is becoming our Achilles Heel and your tool piped my attention because it has a number of ways to remove a few limitations of this module..

I do like your tool, I added links to it in the wordpress G2 Wiki page and you should also get it up and running in the Wordpress -> Extend :)

http://codex.gallery2.org/Category:Integration:Wordpress

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Thu, 2007-08-16 04:32
ozgreg wrote:
... and you should also get it up and running in the Wordpress -> Extend :)

I requested hosting on wordpress.org before WPGR 1.0, but unfortunately it took two weeks until my account was activated. From the next release on, it will be on wordpress.org as well.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-08-16 08:05

Some background information:

The 1 Blog per Gallery limitation stems from merging and mapping the userbase of the two applications.
We discussed this previously. A workaround would be to add your own prefix to the externalId, a different prefix for each blog.

By the way:
The Gallery Remote protocol is slated for deprecation since over a year. We have a XML-RPC protocol / module in the pipeline similar to the Flickr API and it should replace the GR protocol. Of course we won't remove the GR protocol anytime soon since it's so wildly supported.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Thu, 2007-08-16 09:15

Hi valiant,

I read somewhere about that module. It is planned for Gallery 2.3, right? Is there a project page about it somewhere or do I just get it from SVN?

Thanks,
Christian

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Sun, 2007-08-19 13:46

Hi all,

v1.2 is available.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2007-08-19 15:56

Christian,
Updated the plugin from I belive version 0.1
Went to the admin section to add another site. It promted me to save the second site first before "test Connection".
Saved it and then processed to "test Connection". It says it was successfull but I got this error:

Quote:
Warning: array_search() [function.array-search]: Wrong datatype for second argument in /home/.carl/gallery2ca/gallery2.ca/wp-content/plugins/wp-gallery-remote/wp-gallery-remote.php on line 984

Warning: array_search() [function.array-search]: Wrong datatype for second argument in /home/.carl/gallery2ca/gallery2.ca/wp-content/plugins/wp-gallery-remote/wp-gallery-remote.php on line 997

It also said "Connection to Gallery "Langleyc" successful. " so I figured I was OK.
I then opened WP-GR and got the attached when trying the remote site.

I suspect that the "remote" Gallery must be running PHP5 as well.

I also get a Javascript error about tiny MCE. I am not running tiny MCE but it still functions properly.

Great work!

Seems you get a similar error on:
http://blog.thebartels.de/gallery/?current_album=305

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Mon, 2007-08-20 14:05

Hi floridave,

thanks for the bug report.
I fixed the first two bugs in version 1.2.1 (available now).

Unfortunately, I could not reproduce the Javascript error in tiny MCE. Do you use Firefox and the Firebug extension, so that you could send me the exact error message and the file in which the error ocurrs?

Thanks,
Christian

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-08-21 03:58

2 bugs confirmed fixed. Thanks.
JS error; I don't use the tiney mce editor. WP admin -> users, edit user, uncheck 'Use the visual editor when writing'.
Then you should be able to reproduce the error. Not a big deal as I bet I am a one in a thousand users that don't use tiny mce.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
cb2206

Joined: 2004-09-30
Posts: 19
Posted: Tue, 2007-08-21 14:50

Ah, sorry, I somehow understood, that the JS error occurs when using tinyMCE, but you don't care, as you do not use it.

Anyway, I fixed the bug in my development version. But I think it is not that an urgent problem, which makes a new release necessary.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-08-21 15:19

Not a urgent issue. It does not effect operation.

Cheers!
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team