Back to vBulletin 3.7 Template Modifications

Lightbox v2 for image attachments
Mod Version: 1.00, by Mitchee

This modification is in the archives.
vB Version: 3.7.2 Rating: (1 vote - 5.00 average) Installs: 11
Released: 08 Aug 2008 Last Update: 08 Aug 2008 Downloads: 117
Not Supported Template Edits Additional Files  

Overview:

This is based on imranbiag's 3.6 mod using Lightbox v1 which is found here. I have tested it, and it works fine in vB 3.7.2 using Lightbox v2.04.

Lightbox v2 is made by http://www.lokeshdhakar.com/ and is released under Creative Commons License. If you like his script, please http://www.lokeshdhakar.com/projects/lightbox2/#donate

I dont really like the included version of vB Lightbox, and if an image takes a while to load it looks broken. Lightbox v2 has a loading ticker, and nicely resizes smoothly to the users screen size. Overall I feel its a much nicer experience.

Installation:

Very simple and straight-forward.

1. Download lightbox v2 from http://www.lokeshdhakar.com/projects/lightbox2/#download (currently v2.04) Or at the end of this post.

2. Upload the contents of the package to your forum root directory.

3. Turn off your forums in AdminCP > vBulletin Options > Turn Your vBulletin On and Off.
You will be editing some templates which will affect users experience if they access them whilst being edited. Best to be safe

4. Disable the built-in vB Lightbox in AdminCP > vBulletin Options > Message Attachment Options > Use Image Lightbox.
We want to turn this off so we can replace the vB function with our own.

5. Edit the headinclude template for any active styles on your forum in AdminCP > Styles & Templates > Style Manager.
Insert this anywhere appropriate:
Code:
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

6. Now we are going to edit the postbit_attachmentthumbnail template.
Replace the contents of this template with this:
Code:
<a rel="lightbox" href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>><img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1&amp;d=$attachment[thumbnail_dateline]" border="0" alt="<phrase 1="$attachment[filename]" 2="$attachment[counter]" 3="$attachment[filesize]" 4="$attachment[attachmentid]">$vbphrase[image_larger_version_x_y_z]</phrase>" /></a>
&nbsp;<if condition="$show['br']"><br /><br /></if>

7. Re-enable your forums and everything should work!

Notes:
Like in the original thread for vB 3.6, the page must finish loading for this script to work. Ive only had this script fail by purposely trying to click an attachment while the page is loading. Not a real concern for me.

Download

This modification is archived, downloads are still allowed.

File Type: %1$s lightbox2.04.zip (95.3 KB, 123 downloads)

Similar Mods

Show Thread Enhancements Image Lightbox Customization vBulletin 3.7 Add-ons
Mini Mods highslide integration with vB attachments - lightbox alternative - inline too. Modification Graveyard

vblts.ru supports vBulletin®, 2022-2024