Zenphoto/Share
Presentation :
This page will be dedicated to a little plugin I developped for Zenphoto. What this plugin does is allow people to add a link which, when clicked, displays a little thickbox containing sharing code for fast copy/paste into forums, web page, blog post, etc. For the moment, the plugin can generate BBCode (for sharing on phpBB powered forums for example) and standard HTML code (blog post, web pages, etc.)
Here is an example of it’s application in my own gallery :
There also are a few options that can be set via the admin option panel for the plugin. Available options are, for the moment :
- Enable / Disable link. If link is enabled, it can link to :
- The full resolution image
- The image page. Might be usefull : people will see the comments and might eventually add one.
- Set the max size of the generated preview image that will be shown.
- Select the format of the sharing code :
- BBCode
- HTML
- Enable / Disable the showing of a second textarea containing the same code as the first one, but with exifs data just bellow the image.
How to use it :
Just get the plugin version you want from below, unzip, copy to your zp-core/plugins directory. Then, in the admin panel, enable the plugin. Starting from v0.2 you can also set the options for the plugin and save them.
Then, in your image.php or equivalent, use the print_share_link($link_text) function to display the link which will show your sharing code. $link_text is the text used for the link and the thickbox title.
What is displayed in the thickbox is handled in the admin panel for the plugin.
Bugs :
I’m developping this plugin mainly for my own use, so I don’t test it in other version of Zenphoto (currently using the 1.2.9) I also don’t test it in Zenphoto installations with other options (I use URL rewritting, etc.) So their might be a few bugs. If you are using this plugin and experiencing any kind of problems (bug, a feature that is missing, etc.) you can post a comment here, or use the Contact page to send me a more detailed mail.
Changelog :
- Fixed: Problem when Zenphoto gallery wasn’t installed in the root directory.
- Fixed: Compatibility with Zenphoto 1.2.9 (uses colorBox instead of thickBox)
- Fixed: Compatibility with Zenphoto version 1.2.7 and higher (lower versions should still work)
- Added: Possibility to use the original image as the preview image. It can be usefull when you simply want to put an image in a forum without any link to the gallery, and in its original size. To do that, simply specify a size of the preview image lower or equal to 0. It will automatically disable the resizing.
- Changed the behaviour of the plugin : removed the option to use BBCode or HTML. Both show at the same time now. Both with or without EXIFs, depdending on the option.
- Fixed: link to the full image wasn’t working when Zenphoto’s option to protect full image was set. Now use the direct link to the full image so that it always work.
- Added: Option to display the sharing code in a ThickBox frame or inlined in the page (in which case clicking on the sharing link toggle visibility)
- Fixed: I hard-coded link to my gallery. Replaced with correct path to current gallery.
- Added: second textarea containing the same sharing code, but with exif data under the preview image.
- Added: option in the admin panel to show or not the sharing code with exifs.
- Added: option in the admin panel to generate BBCode or standard HTML.
- Added: possibility to disable the [url] part of the BBCode.
- Added: possibility to change the preview image size.
- Added: possibility to link to the full image OR the image page.
- Added: admin panel to handle the preview options.
- First version. Only a print_bbcode($link_text) function which prints a link which, when clicked, toggle the thickbox containing the BBCode.
