Page 1 of 1

Lightbox BBCode

Posted: 09 Mar 2010, 22:23
by BBCode Bot
Lightbox BBCode

Lightbox BBCode for phpBB3 is meant for admins only. I use it for reviews of products.
You need to have 2 images: An ordinary image and a thumbnail.
When You click on the thumbnail, the ordinary image pops up centered - se demo.
Also there is a link version available. [lightscript][/lightscript]
Image

How to do the modifications:
Download the zip file from here: http://www.huddletogether.com/projects/ ... /#download
- From the images folder You upload loading.gif and close.gif to root/images
- From the images folder You upload: nextlabel.gif and prevlabel.gif to root/styles/prosilver/theme/images and to root/styles/subsilver2/theme/images
- Upload the js folder to root
- Add following at the bottom prosilver/theme/colours.css:

Code: Select all

#lightbox{	position: absolute;	left: 0; width: 100%; z-index: 100; text-align: center; line-height: 0;}
#lightbox img{ width: auto; height: auto;}
#lightbox a img{ border: none; }

#outerImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; }
#imageContainer{ padding: 10px; }

#loading{ position: absolute; top: 40%; left: 0%; height: 25%; width: 100%; text-align: center; line-height: 0; }
#hoverNav{ position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; }
#imageContainer>#hoverNav{ left: 0;}
#hoverNav a{ outline: none;}

#prevLink, #nextLink{ width: 49%; height: 100%; background-image: url('data:image/gif;base64,AAAA'); /* Trick IE into showing hover */ display: block; }
#prevLink { left: 0; float: left;}
#nextLink { right: 0; float: right;}
#prevLink:hover, #prevLink:visited:hover { background: url("{T_THEME_PATH}/images/prevlabel.gif") left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url("{T_THEME_PATH}/images/nextlabel.gif") right 15% no-repeat; }

#imageDataContainer{ font: 10px Verdana, Helvetica, sans-serif; background-color: #fff; margin: 0 auto; line-height: 1.4em; overflow: auto; width: 100%	; }

#imageData{	padding:0 10px; color: #666; }
#imageData #imageDetails{ width: 70%; float: left; text-align: left; }	
#imageData #caption{ font-weight: bold;	}
#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em;	}			
#imageData #bottomNavClose{ width: 66px; float: right;  padding-bottom: 0.7em; outline: none;}	 	

#overlay{ position: absolute; top: 0; left: 0; z-index: 90; width: 100%; height: 500px; background-color: #000; }
- Add following at the bottom subsilver2/theme/stylesheet.css:

Code: Select all

#lightbox{	position: absolute;	left: 0; width: 100%; z-index: 100; text-align: center; line-height: 0;}
#lightbox img{ width: auto; height: auto;}
#lightbox a img{ border: none; }

#outerImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; }
#imageContainer{ padding: 10px; }

#loading{ position: absolute; top: 40%; left: 0%; height: 25%; width: 100%; text-align: center; line-height: 0; }
#hoverNav{ position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; }
#imageContainer>#hoverNav{ left: 0;}
#hoverNav a{ outline: none;}

#prevLink, #nextLink{ width: 49%; height: 100%; background-image: url('data:image/gif;base64,AAAA'); /* Trick IE into showing hover */ display: block; }
#prevLink { left: 0; float: left;}
#nextLink { right: 0; float: right;}
#prevLink:hover, #prevLink:visited:hover { background: url('./images/prevlabel.gif') left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url('./images/nextlabel.gif') right 15% no-repeat; }

#imageDataContainer{ font: 10px Verdana, Helvetica, sans-serif; background-color: #fff; margin: 0 auto; line-height: 1.4em; overflow: auto; width: 100%	; }

#imageData{	padding:0 10px; color: #666; }
#imageData #imageDetails{ width: 70%; float: left; text-align: left; }	
#imageData #caption{ font-weight: bold;	}
#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em;	}			
#imageData #bottomNavClose{ width: 66px; float: right;  padding-bottom: 0.7em; outline: none;}
Add the following code before </head> in both prosilver and subsilver2 overall_header.html:

Code: Select all

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>

How to create the BBCode for the easy single image version
Create this BBCode in ACP:
BBCode:

Code: Select all

[light1={URL1}]{URL2}[/light1]
HTML:

Code: Select all

<a href="{URL1}" rel="lightbox"><img style="border: 1px solid black;" src="{URL2}" alt="" /></a>
Helpline:

Code: Select all

Light1: [light1=URL to Thumbnail]URL to big Picture[/light1]
DEMO1:
[light1=images/billede17.jpg]images/billede17lille.jpg[/light1] [light1=images/billede19.jpg]images/billede19lille.jpg[/light1]

How to create the BBCode for the linked image version
Create this BBCode in ACP:

BBCode:

Code: Select all

[light2={URL}]{TEXT}[/light2]
HTML:

Code: Select all

<a href="{URL}" rel="lightbox" title="Click to see image">{TEXT}</a>
Helpline:

Code: Select all

Lightbox2: [light2=URL to image]Link text[/light2]
Example:

Code: Select all

[light2=http://stokershoppen.dk/bbcodes/images/billede19.jpg]Check this link![/light2]
[light2=http://www.dynamicdrive.com/dynamicindex4/listenmusic.jpg]Link to external image[/light2]
DEMO2:
[light2=images/billede19.jpg]Check this link![/light2]
[light2=http://www.freedigitalphotos.net/image/s_wasp2.jpg]Link to external image[/light2]

If You got this working You might want to take a look at the Lightbox Group images.
Click the spoiler:
[spoiler]How to create the BBCode for the easy group image version
Create this BBCode in ACP:
BBCode:

Code: Select all

[lightgroup={URL1}]{URL2}[/lightgroup]
HTML:

Code: Select all

<a href="{URL1}" rel="lightboxgroup"><img style="border: 1px solid black;" alt="" title="" src="{URL2}" /></a>
Helpline:

Code: Select all

[lightgroup=URL to thumb]URL to big pic[/lightgroup]
Example:

Code: Select all

[lightgroup=http://www.phpbb3bbcodes.com/images/billede16.jpg]http://www.phpbb3bbcodes.com/images/billede16lille.jpg[/lightgroup]    [lightgroup=http://www.phpbb3bbcodes.com/images/billede6.jpg]http://www.phpbb3bbcodes.com/images/billede6lille.jpg[/lightgroup]
[lightgroup=http://www.phpbb3bbcodes.com/images/billede8.jpg]http://www.phpbb3bbcodes.com/images/billede8lille.jpg[/lightgroup]    [lightgroup=http://www.phpbb3bbcodes.com/images/billede1.jpg]http://www.phpbb3bbcodes.com/images/billede1lille.jpg[/lightgroup]
DEMO3:
[lightgroup=images/billede16.jpg]images/billede16lille.jpg[/lightgroup] [lightgroup=images/billede6.jpg]images/billede6lille.jpg[/lightgroup]
[lightgroup=images/billede8.jpg]images/billede8lille.jpg[/lightgroup] [lightgroup=images/billede1.jpg]images/billede1lille.jpg[/lightgroup][/spoiler]