NP_LightBox2, 1.0, Add LightBox 2 JS functionality to posts

Post your new plugins here!
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Sun Dec 03, 2006 12:11 pm

Thanks for the tip, I haven't tested this plugin for really large images. I'll check need to check out the LightBox forum, and maybe look at LightBox_Plus as well.
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Mon Dec 04, 2006 5:19 pm

Some additional gotchas.

From testing with the laila skin, I have found the css for LightBox2 will not work if the <link> tag that sets the main css file includes a title attribute, the LightBox will not open.

For example, in the head.inc file of the Laila skin, you find this line:

Code: Select all

<link rel="stylesheet" type="text/css" href="<%skinfile(style-brown.css)%>" media="screen" title="Laila (screen)" />
This will not work, but if you change it to this:

Code: Select all

<link rel="stylesheet" type="text/css" href="<%skinfile(style-brown.css)%>" media="screen" />
It will work. Other skins may have the same problem.

Another tip is for skins that use other js scripts, you can sometimes remove any conflicts by putting this in your body tag:

Code: Select all

<body onload="initLightbox()">
or if other scripts are loaded, append it like this:

Code: Select all

<body onload="MM_preloadImages(‘/images/menu_on.gif’);initLightbox()">
No guarantee, but works in some cases.
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Mon Dec 04, 2006 9:02 pm

Just released version 1.1 which allows you to set the root url for the lightbox2 files (js and css) from a plugin option. This should help the problem in multi-blog and non-standard installations mentioned by danielck in a earlier post.

Download here: http://www.iai.com/NP_LightBox2.zip

To install, you must first uninstall the previous version, then upload the new files and install it using the plugin management page. You will need to be sure all your plugin options are set correctly after the re-install.
User avatar
danielck
Posts: 668
Joined: Thu Dec 15, 2005 7:26 am
Contact:

Postby danielck » Tue Dec 05, 2006 4:46 am

ftruscot wrote:Just released version 1.1 which allows you to set the root url for the lightbox2 files (js and css) from a plugin option. This should help the problem in multi-blog and non-standard installations mentioned by danielck in a earlier post.



Thanks for the fix Frank! :) It works now. (Yeah!)
User avatar
danielck
Posts: 668
Joined: Thu Dec 15, 2005 7:26 am
Contact:

Postby danielck » Tue Dec 05, 2006 4:59 am

vinhboy wrote:LightBox2.0 is kind of flaky. If you have really large images, it will display them very wierd.
There is a fix in the support forum, but that fix doesnlt allow for you to zoom. Not yet at least. Also, I think I prefer the loading style of the LightBox_Plus style more.




ftruscot wrote:Thanks for the tip, I haven't tested this plugin for really large images. I'll check need to check out the LightBox forum, and maybe look at LightBox_Plus as well.



Yes, large image is not well handled by Lightbox. You have to use the browser scroll bar to view parts of the image.

Also, you can't exit the lightbox view immediately as the exit function is only activate if you click on the webpage content area. Viewing large image means that you will be scrolling away from the content area. You have to scroll back to the original content area to click to exit.

See my post using a large image:
http://www.danielck.net/item/170
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue Feb 20, 2007 2:23 am

now version 1.2. fixes popup and image link replacement functions.
Aura13
Posts: 18
Joined: Sat Apr 10, 2004 10:12 pm
Location: Glasgow, Scotland

Postby Aura13 » Thu Mar 01, 2007 4:07 am

sorry my bad.
Sebuk
Posts: 2
Joined: Fri Mar 30, 2007 3:03 pm

Postby Sebuk » Fri Mar 30, 2007 3:08 pm

Hello,

I can't get the thumbnails to work. I checked my paths, GD, etc ... but it just doesn't display anything.
I contacted my web hosting and they think it has something to do with .htaccess. Does that means I need to use fancy urls?

Also, what does this means:
"The Thumbnail feature will not work if your site hotlink protection enabled, unless the direct requests are allowed."

My site is there:
http://seb.celeonet.fr

Thanks!
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Fri Mar 30, 2007 6:30 pm

Your problem is not with this plugin, but with a Global Site setting called 'Plugin URL' found in the Global Settings of the nucleus admin area.

Currently, yours seems to set to
http://seb.celeonet.fr/plugins/

but it should be set to
http://seb.celeonet.fr/nucleus/plugins/
Sebuk
Posts: 2
Joined: Fri Mar 30, 2007 3:03 pm

Postby Sebuk » Fri Mar 30, 2007 6:34 pm

Thanks! Works like a charm now.
Great plugin you've done here!
KouzelniCZech
Posts: 1
Joined: Sat Mar 31, 2007 10:17 am
Location: Brno, Czech Republic

Postby KouzelniCZech » Sat Mar 31, 2007 10:32 am

This is great plugin. Thank you for it.
But I had two problems:
1. Thumbnail images were too much sharp and it doesn't look like well. So I replaced function imagecopyresized by function imagecopyresampled in the file thumbnail.php. It looks better now.
2. The links created by plugin weren't valid. So I replaced
these lines

Code: Select all

$r .="<img src=\"".$this->getAdminURL()."thumbnail.php?image=".$image."&size=".$this->getOption('maxSize')."\" border=\"0\">";

by this

Code: Select all

$r .= "<img src=\"".$this->getAdminURL()."thumbnail.php?path=".$thumb_path."&amp;image=".$image."&amp;size=".$this->getOption('maxSize')."\" style=\"border:0;\" alt=\"\" />";

in the plugin file.
The alt tag may not be total correct for all because in this case is blank but I don't use it.
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Sat Mar 31, 2007 3:22 pm

Thanks for the tips. I will look at the imagecopyresampled() function for the thumbnail file and can add an alt variable to the link in a future version.
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Thu Apr 05, 2007 5:33 pm

I've released a few version in the past week to fix some bugs and add a little feature. The currect version is now 1.31. It adds some options to allow choosing of the path method used for thumbnails (URL, Full path, or Relative path) which lets users work around some PHP settings. Also, images in directories are now sorted alphabetically, case-insensitive. I have also used imagecopyresampled() in thumbnail.php to improve quality of the thumbnails.

Upgrading from from a version less than 1.3 (i.e. 1.1x or 1.2x) requires that the previous version be uninstalled before installing the new version.

Download: http://www.iai.com/sandbox/item/48/#lightbox2
Wiki: http://wiki.nucleuscms.org/lightbox2
dom
Posts: 176
Joined: Mon Oct 06, 2003 6:38 pm
Location: Belgium

Postby dom » Mon Jul 09, 2007 2:17 pm

Hello to all,

I would like to use this plugin but I don't know how to make the point 5
5. In your posts where you want to display the thumbnail(s) put this variable:
<%LightBox2(imagename|caption)%> for a single image ...


Where to put <%LightBox2(imagename|caption)%> ?
I've tried to put this in my template lifanosky/item in the field ' image ' but it doesn't work.

I've no problem with popup image but only when I want to insert an image.

Thanks in advance for your help.

Dominique,
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Mon Jul 09, 2007 4:38 pm

Dom, this goes directly into your post, not a skin or template, So when you are posting an item, you might type something like this into the body of the item:

I saw a really cool picture of the view from top of Mt Everest.

Check it out: <%LightBox2(common/everest.jpg|View From Everest)%>

It's almost surreal.
dom
Posts: 176
Joined: Mon Oct 06, 2003 6:38 pm
Location: Belgium

Postby dom » Mon Jul 09, 2007 5:03 pm

Hello ftruscot,

Thanks for your reply (and for your plugin !)

As our blog is multi-user, I don't see other ppl having to type code in their message ...
Too bad !

Maybe it there a way to just have the choice to insert an image by popup ?
In other words, is there a way to not display 'Insert' in the Nucleus Media display ?

I believe it could resolve the problem since popup works very well with LightBox ...

Could you please tell me if it's a good idea ... and if that case, how to remove the choice 'insert' ?

Thanks in advance for your help.

Dominique,
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Mon Jul 09, 2007 5:32 pm

In my nucleus media manager I don't have the option to "Insert", I only have "inline" and "popup". Are you using a plugin that uses a different media manager?

If you are using the standard nucleus media manager and really mean to disable inline images, you do it with a hack to one of the core files, but that is hard to maintain as you need to re-create the hack with each version upgrade. if you really want to do the hack, look at lines 221 and 222 of nucleus/media.php. I would consider training your writers to use the popup option when wanting a thumbnailed-lightbox picture. That way they still have the option of displaying a full size image inline.
User avatar
IHNBIIPOS
Posts: 324
Joined: Tue Aug 16, 2005 1:40 pm
Contact:

Postby IHNBIIPOS » Sat Jan 12, 2008 2:35 pm

That's a very nice plugin :) Took me a while to figure out one thing though: unless I add 1/ to the image path like this <%LightBox2(1/image.jpg)%> it won't work. I tried adding /1/ to the end of media directory in plugin options so I wouldn't have to add it to pictures every time, but for some reason it didn't work.
My sites using Nucleus: AgeOfConan.lt | AglocoLietuva.com
If you like Nucleus: Digg it | Stumble it | Save to del.icio.us | Donate
Wouters
Posts: 13
Joined: Thu Apr 05, 2007 11:01 am
Location: Amsterdam

Postby Wouters » Tue Mar 18, 2008 2:40 pm

Hi,

Im trying to use Lightbox2 in my blog.
But all seems to work well. The thumbnails are created and all that stuff.

i have put <%LightBox2%> head.inc file

but whenever i click on the thumbnail. The image is displayed some ware on the bottom of my blog page. Not as an overlapping image with a black background like it should.

Does anyone know what to do?
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue Mar 18, 2008 3:04 pm

Can you post a link to your site so I can see a page where this occurs? Thanks.

Return to “Plugin Development”