Plugin WordPress / Gallery 3

The WordPress plugin « WordPress / Gallery 3″ embeds pictures and albums from an installation of Gallery3 in an article or a post.

With this plugin, you will able to :

  • use the insertion tool in your Edit Toolbar to help you select one or more Gallery 3 Images, Albums in your Blog Posts or WordPress Pages,
  • display in the WordPress website the Images and Albums with Smoothgallery.

Examples

If you want to see more Examples : click here.

Licence : GPLv3

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation.

Donate

This plugin is a free program but you can make a donation to thanks for this development.



Requirements

  • Gallery3 installation with restful module enabled
  • PHP 5+
  • PHP Json enabled
  • PHP fopen enabled in order to open distant web pages allow_url_fopen=’on’ in the php.ini

Download

Installation

  1. Extract the zip file and just drop the contents in the `wp-content/plugins/` directory of your WordPress installation
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Configure the plugin (… > …) and set up all options (refer to help on http://www.heiv.fr/projets/plugin-wordpress-gallery-3/#configuration)

Configuration

Gallery 3

First to all, you have to enable the restful plugin of Gallery3.

Admin configuration

Configuration v0.2

  • Fully qualified domain name of the Gallery 3 website : address where you can find the home page of  your Gallery3 website.
    For examples : http://mysite.com/gallery3/index.php or http://myothersite.com/gallery3
  • Guest can query Gallery3 ? : If this checkbox is checked, then the plugin will send query in guest mode. You have to set up this guest access in your Gallery3 configuration.
    In the advanced configuration allow_guest_access must equal to « 1″ : go to Admin » Settings » Advanced and change the « allow_guest_access » parameter of the « rest » module from « 0″ to « 1″ (Source : http://codex.gallery2.org/Gallery3:API:REST#Security_and_Authentication).
  • User for querying Gallery 3 Restful and Password for querying Gallery3 Restful : the login (with password) is used to send query to the Resful Gallery3 interface
  • Default height : the height by default for display a picture or a album (in pixel (px))
  • Default width : the width by default for display a picture or a album (in pixel (px))
  • Text of the Carousel: text used by SmoothGallery to show the carousel
  • Show Carousel : If checked, the carousel is displayed
  • Image information panel : Displaying or not some informations of the current picture
  • Timed Carousel : If checked, the carousel will start automatically
  • Delay for timed Carousel (in milliseconds) : time between images are changed
  • Direct link to gallerys / pictures : option which allow a visitor to go on the Gallery3 site
  • Target for the « Direct link to gallerys / pictures » open picture or album Gallery3 site :
    • _self => in the current page
    • _parent => in the parent page of the current page
    • _blank => in a new page

Usage

select something v0.2

The options of SmoothGallery are hidden by default, of course you can display them.

Add a new post or article. In the editor, click on the Gallery3 button and you will show a popup window which displays :

  • Height : height (in pixels) of the content box which displays the pictures and albums selected. If Height is not set up, the default height will be used, see Admin Configuration
  • Width : width (in pixels) of the content box which displays the pictures and albums selected. If Width is not set up, the default width will be used, see Admin Configuration
  • Text of the Carousel: text used by SmoothGallery to show the carousel. If is not set up, the default option will be used, see Admin Configuration
  • Show Carousel : If checked, the carousel is displayed. If is not set up, the default option will be used, see Admin Configuration
  • Image information panel : Displaying or not some informations of the current picture. If is not set up, the default option will be used, see Admin Configuration
  • Timed Carousel : If checked, the carousel will start automatically. If is not set up, the default option will be used, see Admin Configuration
  • Delay for timed Carousel (in milliseconds) : time between images are changed. If is not set up, the default option will be used, see Admin Configuration
  • Direct link : checkbox which sets up the possibility to go on the picture or album page of Gallery3 installation. If this checkbox is not set up, the default option will be used, see Admin Configuration
  • page x : this popup window displays only 15 pictures on a « page », so you can change for « page x+1″ in order to display more pictures
  • directory pan (on the left side of the popup window) : allows you to browse (with double clicks on) the albums of your Gallery3 installation
  • images pan : displays all images of the current albums

You have just to browse the albums (double click on it – see directory pan) and then single click on :

  • a picture for display only this picture
  • an album for display it

Click on the submit button, the window popup will close and in the editor you will see something like (depends of the options you will set) :

Frequently Asked Questions (FAQ)

Q: Will this plugin work without Gallery3?
A: Sorry No, Gallery3(http://gallery.menalto.com/) is required.

Q:  Can you explain exactely the « Base URL of the restful acces of Gallery 3 ?

The main page of your Gallery3 website is, normally, accessible with an URL like http://my.gallery3.com/index.php/ , if you don’t active any the rewrite rule in the configuration of your Gallery3’s installation.

So, the « Base URL of the restful acces of Gallery 3″ would be http://my.gallery3.com/index.php/rest/item .

Release history

Version 0.2.2 -August, 18, 2010

  • This update will provide the compatibility with WordPress 3.0.1. If you have a compat problem, please write a comment on this page with the encountered error,
  • Directory Browser Changes :
    • simple click : select a directory,
    • double click : go into a directory.

Notice : I will test as soon as possible the usage of WordPress 3 in multisite configuration. So, let me a comment on this page if you encounter problems or not !

Version 0.2.1 – August, 04, 2010

Security update :

  • the password of the uses is no longer store on the WordPress Database.
  • The plugin for query Gallery3 will just sent the RESTFul API ticket.

Version 0.2 – August, 03, 2010

The version 0.2 is no longer available on download and replaced by version 0.2.1.

Used the PEAR package : HTTP_Request instead of file_open. With this change, the plugin requires now the login and password of an authenticated user of Gallery3 ; The « guest access » is still possible too.

The options (autochange pictures, delay for the autochange pictures , carousel’s text, display or not the carousel) of SmoothGallery can be changed.

Version 0.1 – May, 09, 2010

Initial release. Follow this link to read the documentation of this version.

29 Responses to this post.

  1. Posted by Jean on 10.05.10 at 9:52

    Hi

    Very nice project but I have a probleme with Gallery3 configuration. I don’t understand what is the « Base URL of the restful acces of Gallery 3″

    Can you explain me exactely on what I have to link ?

    (Restful is enabled on my Gallery 3 and the plugin is well installed on WP.)

    Thank’s

  2. Posted by HeiV on 10.05.10 at 9:52

    Thanks for your message Jean.

    I updated the « Frequently Asked Questions » (FAQ) with your question.

  3. Posted by Jean on 10.05.10 at 9:52

    Thanks for your help.

    I dont understand what is ITEM.

    My folder REST is under MODULES’Folder and there is some others folders inside but nothing called ITEM.

  4. Posted by Jean on 10.05.10 at 9:52

    The error message:

    Warning: fopen(http://127.0.0.1/gallery3/http://127.0.0.1/gallery3/index.php/modules/rest/item/1) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

    in C:\wamp\www\wordpress\wp-content\plugins\heiv-gallery-3\heiv-gallery_3.php on line 354
    Error :http://127.0.0.1/gallery3/http://127.0.0.1/gallery3/index.php/modules/rest/item is not accessible.

  5. Posted by Jean on 10.05.10 at 9:52

    Sorry, This one:

    Warning: fopen(http://127.0.0.1/gallery3/index.php/modules/rest/item/1) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 404 File Not Found

    in C:\wamp\www\wordpress\wp-content\plugins\heiv-gallery-3\heiv-gallery_3.php on line 354
    Error :http://127.0.0.1/gallery3/index.php/modules/rest/item is not accessible.

  6. Posted by hit_man on 10.05.10 at 9:52

    Well – i have very similar warnings, seams it is not connecting to gallaery3
    Could it be that it is necessary to use REST API KEY from gallery3 config in some place while configuring plugin? Or are there required custom mod rewrite rules?

    Warning: fopen(http://localhost/wp/gallery3/index.php/rest/item/1) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

    in C:\xampp\htdocs\wp\rallijs\wp-content\plugins\heiv-gallery-3\heiv-gallery_3.php on line 354
    Error :http://localhost/wp/gallery3/index.php/rest/item is not accessible.

    thanks!

  7. Posted by hit_man on 10.05.10 at 9:52

    Figured it out – had to set allow_guest_access must equal to « 1″
    Maybe you could mention it in the plugin settings section in wordpress (not only on this page)
    thanks!

  8. Posted by HeiV on 10.05.10 at 9:52

    Hello hit_man.

    The team of Gallery3 had made some changes in the Restful module and added the « allow_guest_access » in order to keep the guest option.

    I’m writing the v0.2 of my plugin and I will make some changes in order to handle the changes of Restful module G3.

  9. Posted by Avery on 10.05.10 at 9:52

    Hi,

    Thanks for putting this together. I have it working now.

    A few comments to further the project:

    - Base URL of the restful acces of Gallery 3: If this field is left blank while allow_guest_access=0, then the settings test passes (incorrectly)
    - The help text for that item reads « by default it is « /index/rest/item »", when I think you mean « by default it is « /index.php/rest/item »  »
    - Definitely want to include within the instruction the need to change the allow_guest_access within G3
    - The field titles and examples are a bit confusing with the written English. I’m glad to help you wordsmith this, if you’d like to e-mail me. For instance, the first field might read « Fully qualified domain name, beginning with http:// » and have an example like « http://gallery.example.com ».

    Cheers,
    Avery

  10. Posted by HeiV on 10.05.10 at 9:52

    Hello Avery,

    Thanks a lot for yours feedbacks and I will change a lot of things, including the help text, etc.

    If you are still OK, I will send you a mail when the version 0.2 will be out.

  11. Posted by allQoo Facebook Services on 10.05.10 at 9:52

    Hi Avery,

    I am planning to deploy your plugin on multiple sites. Any hints on when your v0.2 will be available?

    On the other hand, your plugin allows a gallery be installed in a remote server, doesn’t it? So my wordpress sites and gallery sites can be serving from different servers on different IPs.

  12. Posted by HeiV on 10.05.10 at 9:52

    Hello allQoo,

    Hi Avery,

    I, HeiV, am the developer of this plugin :)

    Any hints on when your v0.2 will be available?

    I am currently writing the v0.2 and I have to implement a last feature before release the v0.2 and beta-test it.

    On the other hand, your plugin allows a gallery be installed in a remote server, doesn’t it? So my wordpress sites and gallery sites can be serving from different servers on different IPs.

    Yes, you can make this configuration.
    Can you give us you feedback on yours differents tests ?

  13. Posted by jagadish on 10.05.10 at 9:52

    Hi,

    i am getting the following error

    error: Are you sure that the user « username » can make restful query on

    what type of user name and password i have to provide. i provided my gallery admin user name and password. but its not accepting. i enabled rest plugin in gallery.

    but still having the error.

    please suggest.

  14. Posted by HeiV on 10.05.10 at 9:52

    Hi jagadish,

    If you provided the username and password of an user of Gallery3, the plugin would work fine.

    Do you have the Gallery3 RC2 ?

  15. Posted by blindzero on 10.05.10 at 9:52

    Hi HeiV,
    I’ve just installed Gallery3 RC2 and 0.2.1 of your module in WP3.0.1.
    Unfortunately I cant get your plugin configured well…I have the following problems:

    - with allow_guest_access = 1 or
    - with allow_guest_access = 0 and username and password provided
    I get in « test settings »:

    Warning: fopen(http://www.fleschuetz.de/gallery3/index.php) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 404 File Not Found

    in /var/www/fleschuetz.de/html-data/blog/wp-content/plugins/heiv-gallery-3/heiv-gallery_3.php on line 611
    Error : http://www.fleschuetz.de/gallery3/index.php is not accessible

    Yes, I have fopen active and php5-common (for json) installed and active.

    The strange thing:
    in a blog article I can browse through my G3, but not select anything (the button send data has no reaction)

    Thanks,

    Matthias

  16. Posted by HeiV on 10.05.10 at 9:52

    Hello blindzero,

    For the moment, WP 3.0.1 isn’t yet supported by this plugin. The plugin will be soon compatible with WP 3.0.1 soon.

    I get in « test settings »:

    Warning: fopen(http://www.fleschuetz.de/gallery3/index.php) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 404 File Not Found

    in /var/www/fleschuetz.de/html-data/blog/wp-content/plugins/heiv-gallery-3/heiv-gallery_3.php on line 611
    Error : http://www.fleschuetz.de/gallery3/index.php is not accessible

    Hum, you find a bug in the « test settings » function and I will look for why it happends and fix it.

    The strange thing:
    in a blog article I can browse through my G3, but not select anything (the button send data has no reaction)

    Have you click on a picture or one ‘<-' on the right of a folder in the browser ?
    If you selected some pictures or folder, the selected item will be pinky.

  17. Posted by Rudy Engels on 10.05.10 at 9:52

    Hi,

    When I want to activate the plugin I received following error. Requirements are checked and ok (I think). WordPress version is 3.0.1 and Gallery3 version is RC2. Thanks!

    Warning: require_once(HTTP/Request.php) [function.require-once]: failed to open stream: No such file or directory in /home/b5623bad/public_html/belgian-international/wp-content/plugins/heiv-gallery-3/heiv-gallery_3.php on line 39

    Fatal error: require_once() [function.require]: Failed opening required ‘HTTP/Request.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/b5623bad/public_html/belgian-international/wp-content/plugins/heiv-gallery-3/heiv-gallery_3.php on line 39

  18. Posted by HeiV on 10.05.10 at 9:52

    Thx Rudy Engels for the reported bug.
    I will try to fix it.

  19. Posted by blindzero on 10.05.10 at 9:52

    Hi HeiV,
    about the picture-picker:
    it seems that this is a usability-bug for me…;) The plugin has different behaviour if I click on a folder name or on <-. You're right, it gets pink when I click on a picture or on a folders <-.

    Then I am waiting for some update for 3.0.1 compat.

    Greetz,
    Matthias

  20. Posted by HeiV on 10.05.10 at 9:52

    Hi blindzero.

    I will make an update for the usability of the browser and compat with WP3 ; if you could give me a feedback here it would be cool.

    What do you think about

    - single click => select the item
    - double click => enter into the double clicked folder

  21. Posted by Jhoan Gonzalez on 10.05.10 at 9:52

    I added a item into a post but nothing shows up on the post when it is publish. WHen I click on edit I see the following [hgallery3 id="21660" show_caroussel="true" direct_link="true" timed="true"].

    Running latest update from today and WP3.0.1 Multisite

  22. Posted by HeiV on 10.05.10 at 9:52

    Hi Jhoan Gonzalez,

    I click on edit I see the following [hgallery3 id="21660" show_caroussel="true" direct_link="true" timed="true"].

    If you see this code in the post, it is a good news because you can browse your Gallery3 for finding albums or pictures to show.

    I added a item into a post but nothing shows up on the post when it is publish.

    Can you give me the URL of this post (by email if you want : moi [ at ] heiv.fr ) ?

    Running latest update from today and WP3.0.1 Multisite

    Did you use this plugin before the update to v0.2.2 ? With WP3.0.1 Multisite ?

  23. Posted by Jhoan Gonzalez on 10.05.10 at 9:52

    The link to the post is http://canafistol.net/blog/2010/08/18/prueba-de-entrada-con-la-nueva-galeria and I did not use the plugin prior to this update as it gave me an error when activating it. I belive I wrote to you about that on the gallery3 forum.

    Thanks,

  24. Posted by blindzero on 10.05.10 at 9:52

    Hi HeiV,

    the usability works fine for, I already tried it.
    But it seems that I still have some kind of « connectivity problem » here:
    - the anonymous test in the plugin config is working and says ok
    - the authenticated test says: « Error :
    Are you sure that the user with the username « wp » can make restful query on http://www.fleschuetz.de/gallery3/index.php/ ?

    Check the username and the password please and retry this test. »
    - the account I’ve used is set up as Admin and also member in all groups to have access.

    Maybe this is also the reason why I can insert the link-code to the gallery in an article but nothing is displayed in the article then?

    Thanks a lot,

    Matthias

  25. Posted by HeiV on 10.05.10 at 9:52

    Hi blindzero,

    - the authenticated test says: « Error :
    Are you sure that the user with the username « wp » can make restful query on http://www.fleschuetz.de/gallery3/index.php/ ?
    Check the username and the password please and retry this test. »

    I think there is a bug in the test method in the submit parameters. If you already have saved the configuration with an username and a password, you would see after the reload of the configuration page the username and a provided ticket by Gallery3. Then, If you click on the test configuration button, without enter the password, you will have the ahead quoted error message because the username will be send with a password equals to null.
    So I will put a help section for the test configuration.

    - the account I’ve used is set up as Admin and also member in all groups to have access.
    Maybe this is also the reason why I can insert the link-code to the gallery in an article but nothing is displayed in the article then?

    Hum … you can make a quick test. On the post or page on the Front End of you website, read the source code and search this sort of html and javascript codes :

    function startGallery_gallery_a3c3e7() {
    var myGallery = new gallery($('gallery_a3c3e7'), {
    timed: true,
    delay: 5000,
    showCarousel: true,
    textShowCarousel: 'Pictures',
    showInfopane: true
    });
    $('gallery_a3c3e7').style.height='300px';
    $('gallery_a3c3e7').style.width='500px';
    }
    window.addEvent('domready', startGallery_gallery_a3c3e7);

     alb1
    ...


    This codes are generated by the plugin and if you have this sort of code, you will see on the website an album or a picture.

    If you don’t have this html and javascript codes, there is a php bug and you have to check on the apache log to find what is going wrong.

  26. Posted by HeiV on 10.05.10 at 9:52

    In my last comment to blindzero, you can see the generated HTML & javascript codes the plugin when all things are OK.

    I take a tour on your blog post and I only see :

    I can’t explain it, have you check the apache log in order to find (or not) some errors ?

  27. Posted by Stewart on 10.05.10 at 9:52

    Seems I am having the same problem as above. It is configured ok and I can insert the code into a post with no problems but there is nothing in the post.
    In Apache log there is no error.
    The only thing shown is:

    [18/Aug/2010:18:39:18 -0400] « GET /g3/index.php/index.php/rest/item/21 HTTP/1.1″ 404 3522 « - » « PEAR HTTP_Request class ( http://pear.php.net/ ) »

    In the source of the page in the place where the gallery should be I see:
    div id= »gallery_2f0f21″ — but the div is just empty. Closing div tag follows right after.

  28. Posted by blindzero on 10.05.10 at 9:52

    Hi HeiV,
    in the article I have the shortcode [hgallery3 id="12"] after selecting a gallery.
    In the sourcecode of the generated page there is not code like yours at all…?
    But even stranger: the apache error log doesn’t show any PHP message at all…
    Matthias

  29. Posted by Avery on 10.05.10 at 9:52

    Hello HeiV,

    1. I have come back to this project and have installed v0.2.2. The test works, and the integration attempts to work when I setup guest access; however, I only receive question marks in lieu of actual thumbnails and images. Is this a current known bug, or a configuration issue on my end? If the later, what suggestions do you have?

    2. When I attempt to configure non-guest access, configuring ‘User for querying Gallery 3 Restful’ and the associated password, I am unclear what ‘user’ is being requested. I assume it is a Gallery3 user with sufficient permissions to view the album? Please confirm.

    3. Assuming the answer to 2 is yes, this does not appear to work for my installation. I get the error:
    « Error: Are you sure that the user with the username ‘myuser’ can make restful query on http://gallery.mywebsite.com? Check the username and password please and retry this test. »
    Can you please provide recommendation?

    4. WPG2 allowed SSO (single sign-on) for a user from WordPress to Gallery. This means a user clicking on an image in WordPress would be seamlessly logged into Gallery as their own user/security, versus as a single specified user or a guest. This is a feature that will be critical to many users who would be integrating WP3 and G3. Can you confirm if this is included in your future plans for your plugin?

    Thanks!
    Avery

Respond to this post