usergallery: lightbox-suppport?

Creating and modifying plugins.
Post Reply
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

usergallery: lightbox-suppport?

Post by stm999999999 »

playing with the usergallery I had an idea:

The javascript-popup for the images has a problem: if someone uses no javascript, the picture did not appear on a click. :-(

solution: no "href=javascript..." but "<a href=image-link onclick="the script; return false"

But this perhaps can have other problems with popup-blocker.

But the best idea is - I think - to make normal href-links to the image for all these without javascript - but for the people with js the real nice functions of the lightbox-plugin!

For testing I make these:

Code: Select all

           
 <a href="{$plugin_usergallery_file.link}"rel='lightbox'>
            
<img class="gallery_thumb" {if $plugin_usergallery_file.dimensions_width > 480}width="480px" height="{math equation="round((480/x) * y)" x=$plugin_usergallery_file.dimensions_width  y=$plugin_usergallery_file.dimensions_height }px"{else}width="{$plugin_usergallery_file.dimensions_width}px" height="{$plugin_usergallery_file.dimensions_height}px"{/if}
            src="{$plugin_usergallery_file.link}" border="0" alt="" /></a>
I think there must be a way to do this without the "rel=lightbox" in the tpl-file, just as the lightbox-plugin does it with images in an normal entry. This seems me to be important, because someone wants to use lightbox, some lightbox2 or thickbox.
Ciao, Stephan
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Can the a href just have a class set?
(You are out of my depth with CSS/XHTML standards and behaviours.)
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

mgroeninger wrote:Can the a href just have a class set?
Äh, what? :?:
Ciao, Stephan
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

So, obviously I would prefer not to have the rel='lightbox' in the template.

Are you saying I should just do something like this instead:

Code: Select all

<a href="{$plugin_usergallery_file.link}">
           
<img class="gallery_thumb" {if $plugin_usergallery_file.dimensions_width > 480}width="480px" height="{math equation="round((480/x) * y)" x=$plugin_usergallery_file.dimensions_width  y=$plugin_usergallery_file.dimensions_height }px"{else}width="{$plugin_usergallery_file.dimensions_width}px" height="{$plugin_usergallery_file.dimensions_height}px"{/if}
            src="{$plugin_usergallery_file.link}" border="0" alt="" /></a>
Or, are you saying that this line needs something else:

Code: Select all

<a href="{$plugin_usergallery_file.link}">
I'm a little confused, as you can see...
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

As I understand the lightbox-plugin:

the js-code of the plugin needs the rel=lightbox to recognize, which image it it should effect.

But in normal blog-entrys (or even the manual inserted text in static pages) you have not to write these "rel" in the text. The code of the plugin-php-file seems to add the rel as an text-markup-plugin.

I deactivate js and load a static page with image:

Code: Select all

<div class="staticpage_content"><p><div class="serendipity_imageComment_right" style="width: 115px"><div class="serendipity_imageComment_img"><a  class='serendipity_image_link'  rel='lightbox' href='/blog2/uploads/artikel/gemeinde/pfarrerallein.jpg'><!-- s9ymdb:15 --><img width="115" height="130" src="/blog2/uploads/artikel/gemeinde/pfarrerallein.serendipityThumb.jpg" alt=""  /></a></div><div class="serendipity_imageComment_txt">Fernando Yago Cantó</div></div></p>
So, it seems, that you do not need the rel=lighbox in the normal entry code, the lightbox-plugin adds it for us.

Even if I add an image in the "Introductory Text (optional)" this image on the gallery overview page will have added an rel=...

But unfortunality the plugin does not add this for images that are in the plugin_usergallery_imagedisplay.tpl

But I think, this must be makeable - on the moment I only do not how. :-) perhaps we only have to ad a smarty-hook in the tpl or so?
Ciao, Stephan
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Ok, I think I understand... I'll install the lightbox plugin sometime and see what I can do...

*grin* I need to install the permalink plugin, too, and figure out that xmlrpc thing, too...
Post Reply