First off... excellent photo gallery, Very impressed, Your work is deemed commendable :)
Now to why im posting,
After downloading the lightbox plugin I was slightly disheartened, excellent plugin dont get me wrong but it didnt quite suit my particular needs. I was looking for a lightbox style display of the "HD Image" rather then opening a new window when the user clicks to see the larger format photo. After searching through the forums for a bit I started opening php files and dissecting the source. Once i got it working I figured i would post my work for anyone else that would like to add this feature to their site. The shadowbox does not allow you to hop images within the category, does not display comment information, it simply displays the "hd image" in a lightbox style fashion.
You will need a js library, I used Shadowbox from http://www.shadowbox-js.com/.
Once you have uploaded the library to your server you will need to edit two of your template files to implement the box.
/template/*YourTemplate*/header.tpl
and
/template/*YourTemplate*/picture_content.tpl
Here are the edits:
header.tpl:
Directly following the opening <head> tag add:Code:
<link rel="stylesheet" type="text/css" href="http://InsertYourPathHere/shadowbox/shadowbox.css"> <script type="text/javascript" src="http://InsertYourPathHere/shadowbox/shadowbox.js"></script> <script type="text/javascript"> Shadowbox.init(); </script>
picture_content.tpl
Change:Code:
<a href="javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')">to
Code:
<a href="{$high.U_HIGH}" rel="shadowbox">
Thats all, your photo page will now display the "HD Image" in a shadowbox....
Last edited by RFDesigns (2010-02-03 13:23:59)
Offline
Hi!
Great idea... you ca do that easily with a plugin...
Create plugins/shadowbox directory.
Put shadowbox files in this directory.
Create a main.inc.php with this content:
<?php /* Plugin Name: Shadowbox Version: 1.0 Description: Display HD pictures in shadowbox Author: RFDesigns */ add_event_handler('loc_begin_picture', 'shadowbox'); function shadowbox() { global $template; $template->set_prefilter('default_content', 'shadowbox_prefilter'); $template->append('head_elements', ' <link rel="stylesheet" type="text/css" href="plugins/shadowbox/shadowbox.css"> <script type="text/javascript" src="plugins/shadowbox/shadowbox.js"></script> <script type="text/javascript"> Shadowbox.init(); </script>' ); } function shadowbox_prefilter($content, &$smarty) { $search = '<a href="javascript:phpWGOpenWindow(\'{$high.U_HIGH}\',\'{$high.UUID}\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes\')">'; $replacement = '<a href="{$high.U_HIGH}" rel="shadowbox">'; return str_replace($search, $replacement, $content); } ?>
Now, share your plugin on http://piwigo.org/ext !
Last edited by P@t (2010-02-04 11:50:34)
Offline
Thanks P@t !
So...
http://www.shadowbox-js.com/download.html
Does that function on your premise?
[EDIT]
http://www.shadowbox-js.com/forum.html#nabble-f1309102
Last edited by Gotcha (2010-02-04 13:29:35)
Offline
Gotcha wrote:
http://www.shadowbox-js.com/download.html
Does that function on your premise?
I downloaded the script on this site: http://webscripts.softpedia.com/script/ … 44117.html
Gotcha wrote:
http://www.shadowbox-js.com/forum.html#nabble-f1309102
???
This plugin will be an example for PiwigoCamp ;-)
Last edited by P@t (2010-02-04 14:34:19)
Offline
Many thanks P@t. So... don't work for me :-(
I don't understand why. I have change the path of shadowbox.js & shadowbox.css with my path and over files. A active the personnal plugin normaly, no error message.
Offline
Gotcha wrote:
I don't understand why. I have change the path of shadowbox.js & shadowbox.css with my path and over files. A active the personnal plugin normaly, no error message.
Look at your path....
Instead of PP_Shadowbox, you wrote PP_Sahowbox...
Last edited by P@t (2010-02-04 16:42:32)
Offline
That gives me the same result with the relative path.
Offline
Gotcha wrote:
That gives me the same result with the relative path.
It was not a problem of relative path...
You wrote (in your url) PP_Sahowbox instead of PP_Shadowbox
Offline
MP send.
Offline
Holy Crap... lol didnt check the post for replies for a day and poof...
P@t,
Giving you major kudos in the description, a few things i would like to add as options such as different lightbox/shoadowbox display options or whatnot in the future. Will poke around in the documentation on piwingo plugins and see what i can come up with, any points in the right direction would be appreciated.
I feel a plugin should be more functional then its current revision after all not every template/theme looks great with a black box as a popup on the page, maybe for version 2.0 :)
For now however:
Heres v1.0 of the plugin
Offline
I have corrected plugin path in version 1.1
Last edited by P@t (2010-02-06 15:33:43)
Offline
I will see that immediately :-D
Offline
Hi ;
LLGBO2 needs to be deactivated so to make Shadow Box work :-/
Offline
Hi !
This plugin is really usefull ! Thank you for doing it.
I'd have juste an advice : The main goal is to display HD pictures with full ranged resolution. Without HD Lightbox, they are displayed in a navigator's tab where it's possible to zoom in or out (ability with FF and IE).
By example, a normal sized picture is 800x600 and his HD size is 1700x1200. With HD Lightbox, this HD picture is displayed in a smaller box than the normal sized and can't zoom in or out on details. This could be a bit perturbing a visitor seeing a picture reduction when he expects to see a full ranged, isn't it ?
Offline
@ Eric,
at this point the javascript library used to implement the shadowbox is based on browser resolution, and served my needs.
However since there seems to be a few people liking this feature for their galleries i have started creating a full featured version that will technically be a full screen chromeless window, this will allow the zoom feature built into most browsers to function in the shadowbox.
There are several things I am attempting to add at once because I have to write my own JS library to handle light vs dark background as well as adding code from the gallery to implement a few buttons such as download and comment as well as the star rating. After all a plugin that performs a function and is customizable depending on your taste is really a much better addition to this community rather then the simple box that is appearing in the plugin's current form.
Gimme a few weeks and i'll update the plugin,
@ P@t
geuss i screwed something up.. lol thnx for fixing what im sure will not be my only error :)
BTW all who read this topic most of the thnx for what is present so far in this plugin should be given to P@t they are the one that turned my hack into a plugin
Offline