1

Topic: Lightbox: help!

i created a little script for users to upload their images (not in their posts)
i'd like to use lightbox (http://www.huddletogether.com/projects/lightbox/)
how do i do it?
the script i created that prints out the thumbnails stays in /include/functions.php, what do i have to add and where?
thank you

Re: Lightbox: help!

Take a look at this. It might help guide you in the right direction smile

3

Re: Lightbox: help!

mm well i dont know if that's what i need:
i created a new section in profile (under essentials, privacy etc) named images where users can upload their images.
i just want it to use lightbox...and i dont know how to do it

and another thing i dont understand: by adding that code to parser.php, if i link an image on a post on the board (such as http://www.site.net/img.jpg) is it meant to be opened with lightbox or does it work only with attached images and images uploaded with imageshack and others?
thank you very much

4

Re: Lightbox: help!

You should see how to costumizing the lightbox too smile

Re: Lightbox: help!

cris wrote:

mm well i dont know if that's what i need:
i created a new section in profile (under essentials, privacy etc) named images where users can upload their images.
i just want it to use lightbox...and i dont know how to do it

and another thing i dont understand: by adding that code to parser.php, if i link an image on a post on the board (such as http://www.site.net/img.jpg) is it meant to be opened with lightbox or does it work only with attached images and images uploaded with imageshack and others?
thank you very much

The way I did it, was to process all links without GET variables in the URL. This was done to minimize the risk of html pages being loaded, as that would make lightbox not work correctly.
Other then that limitation, it processes all posted images posted in the format of [ url = http://www.domain.com/fullimage.jpg ] [ img ] http://www.domain.com/thumbnail.jpg [ /img  [ /url ].

The rewriting of urls was done to make it work with certain popular imagehosting websites as well...

6

Re: Lightbox: help!

codexp: what do i have to put in my website and where? i suppose lightbox.js, and then?
also, how do i use it outside the forum itself? as i told before i created a section called "images" outside the forum!
thank you again

Re: Lightbox: help!

cris wrote:

codexp: what do i have to put in my website and where? i suppose lightbox.js, and then?
also, how do i use it outside the forum itself? as i told before i created a section called "images" outside the forum!
thank you again

All you have to do, is just rel="lightbox" in the links. That's it.

Example:

<a href="http://www.link.to/image.jpg" rel="lightbox">Lightbox is nice</a>

There's really nothing to it smile

8

Re: Lightbox: help!

mm i made it working but it has great problems:
i added these lines to functions.php (i have a function that prints out the thumbnails):
<HEAD>
<script type="text/javascript" src="lightbox.js"></script>
</HEAD>

cause otherwise it wont work..
now: overlay png isn't there (i have no background for the image), it's all messy and it says (at the very start of the page)

Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.mysite.net/htdocs/upload/include/functions.php:2) in /home/mhd-01/www.mysite.net/htdocs/upload/header.php on line 34

where do i have to add that header?? thanks again

Re: Lightbox: help!

You shouldn't be echoing anything before punBB sends its headers tongue

10

Re: Lightbox: help!

cris wrote:

mm i made it working but it has great problems:
i added these lines to functions.php (i have a function that prints out the thumbnails):
<HEAD>
<script type="text/javascript" src="lightbox.js"></script>
</HEAD>

cause otherwise it wont work..
now: overlay png isn't there (i have no background for the image), it's all messy and it says (at the very start of the page)

Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.mysite.net/htdocs/upload/include/functions.php:2) in /home/mhd-01/www.mysite.net/htdocs/upload/header.php on line 34

where do i have to add that header?? thanks again

Add <script type="text/javascript" src="lightbox.js"></script> to your main.tpl

11

Re: Lightbox: help!

smile
now it is working, no error for header.php, but still no overlay (but the loading gif and close button does work, so where's the problem?)

12

Re: Lightbox: help!

Have you added the CSS, and set the correct path to the images in the javacsript?

13

Re: Lightbox: help!

yes, the css is there (with the gifs, the js and the png).
i searched for overlay in the js, but didn't find anything that refers to the png image

oh, im using lightbox, not lightbox plus, but i thing you got it since you told me to add "src="lightbox.js"
sad