The Arcive of vBulletin Modifications Site. |
|
|
How to use the vBulletin 4 Lightbox Anywhere
This tutorial will explain how to use the vB 4 lightbox anywhere in the site for images other than attachments. In order to accomplish this you will have to make the following:
The File: Create a file, name it whatever you like, in this tutorial we will use "testlightbox.php" which should be placed in the root directory with the following:
PHP Code:
For the lightbox to work for your images you will need to place the following in the appropriate templates:
HTML Code:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" <vb:if condition="!is_browser('ie') OR is_browser('ie',8)"> dir="{vb:stylevar textdirection}"</vb:if> lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
{vb:raw headinclude}
<title>{vb:raw pagetitle}</title>
<vb:if condition="$includecss">
<vb:each from="includecss" value="file">
<link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}{vb:raw file}.css" />
</vb:each>
</vb:if>
<link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}lightbox.css" />
{vb:raw headinclude_bottom}
<script type="text/javascript" src="clientscript/vbulletin_lightbox.js?v=402"></script>
</head>
<body>
{vb:raw header}
{vb:raw navbar}
<div id="lightboximages" class="blockbody">
<h2 class="blockhead">Sample Images</h2>
<div class="blockrow">
<div style="padding-bottom: 10px; text-align: center;">
This image is not grouped:<br /><br />
<a href="iwtlightboxdemo/testlightbox.php?id=1" rel="Lightbox_0" id="image1">
<img class="thumbnail" src="iwtlightboxdemo/IWT_Products_System_Thumb.png" alt="test"/>
</a>
</div>
<div style="text-align: center;">
These two are grouped:<br /><br />
<a href="iwtlightboxdemo/testlightbox.php?id=2" rel="Lightbox_1" id="image2">
<img class="thumbnail" src="iwtlightboxdemo/IWT_Registration_Imposter_Blocker_Thumb.png" alt="test"/>
</a>
<a href="iwtlightboxdemo/testlightbox.php?id=3" rel="Lightbox_1" id="image3">
<img class="thumbnail" src="iwtlightboxdemo/IWT_Time_Spent_Online_Thumb.png" alt="test"/>
</a>
</div>
</div>
</div>
<script type="text/javascript">
<!--
vBulletin.register_control("vB_Lightbox_Container", "lightboximages", 1);
//-->
</script>
{vb:raw footer}
</body>
</html>
An example of it can also be found at www.idealwebtech.com/demos/vb_lightbox_demo/lightbox.php This tutorial brought to you by Ideal Web Technologies. |
|
#2
|
||||
|
||||
|
Excellent tutorial
|
|
#3
|
|||
|
|||
|
Excellent...
What I have been trying to do without success is using lightbox to access images outside the vbulletin folder example : root -- specialimages/ image1.jpg root -- forums/pagefile.php when calling pagefile, i wanted to display thumbnails from the specialimage folder (thats not a problem) but displaying the images with the lightbox doesnt work for me.. F. |
|
#4
|
||||
|
||||
|
Quote:
If so you will need to include a "../" in front of it to take you out of the forums folder and back to the root directory. |
|
#5
|
|||
|
|||
|
ahhh.. thx..
no i actually have to calculate the url from db.. i was doing the error by wanting to do it inside lightbox.. but if done on the page it works.. Thank you |
|
#6
|
||||
|
||||
|
Excellent
Thank you |
|
#7
|
||||
|
||||
|
Sorry for bumping this thread.
Does anyone know how can we implement a simple lightbox, which will show registration fields. This is very popular for list building in Wordpress blogs, but I haven't seen anything like that on vBulletin boards. |
|
#8
|
||||
|
||||
|
Great idea............
|
|
#9
|
|||
|
|||
|
Thanks For The Tutorial I Mark this thread excellent
|
|
#10
|
|||
|
|||
|
nice - will be giving this a try later tonight
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|