Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Lightbox v2 for image attachments Details »»
Lightbox v2 for image attachments
Version: 1.00, by Mitchee Mitchee is offline
Developer Last Online: Apr 2013 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.7.2 Rating:
Released: 08-07-2008 Last Update: 08-07-2008 Installs: 11
Template Edits
Additional Files  
No support by the author.

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 Lokesh Dhakar and is released under Creative Commons License. If you like his script, please donate to him.

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 here. (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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-08-2008, 03:30 PM
iogames's Avatar
iogames iogames is offline
 
Join Date: Jan 2007
Location: Las Vegas, NV.
Posts: 1,433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

3.6.10 here... did u test on it?

got installed this https://vborg.vbsupport.ru/showthrea...ight=highslide
and now is in the graveyard
Reply With Quote
  #3  
Old 08-10-2008, 02:59 PM
Jezlad's Avatar
Jezlad Jezlad is offline
 
Join Date: Apr 2007
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems interesting.

If it works on 3.6.10 i'll use it.
Reply With Quote
  #4  
Old 09-30-2008, 01:29 AM
ATVTorture ATVTorture is offline
 
Join Date: Sep 2008
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have tried this multiple times. Ever time I turn it on and have standard or enhanced text editors enabled, Internet Explorer gets an "operation aborted" when you try to edit or create a new post. It works fine in the basic text editor. If I have standard or enhanced editors enabled, and enable the code referencing the js and css files in "headinclude", IE blows up for all of my users. Something I also noticed was that your line for scriptaculous.js doesn't have "load=effects,builder" on it. Without builder, there's a JS error that builder is not defined. If I put ",builder" on the end as the creator of lightbox says to do, IE blows up with an "operation aborted" error. And yes, I am turning the VB built-in lightbox function off.

I then tried to add a line in headinclude for "<script type="text/javascript" src="js/builder.js"></script>" and get the same results.

Do you ahve any ideas as to why the builder function is making IE barf? I'm running VB 3.7.3.

Thanks!
Buster
Reply With Quote
  #5  
Old 03-24-2009, 12:11 AM
crazlunatic crazlunatic is offline
 
Join Date: Mar 2009
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ATVTorture View Post
I have tried this multiple times. Ever time I turn it on and have standard or enhanced text editors enabled, Internet Explorer gets an "operation aborted" when you try to edit or create a new post. It works fine in the basic text editor. If I have standard or enhanced editors enabled, and enable the code referencing the js and css files in "headinclude", IE blows up for all of my users. Something I also noticed was that your line for scriptaculous.js doesn't have "load=effects,builder" on it. Without builder, there's a JS error that builder is not defined. If I put ",builder" on the end as the creator of lightbox says to do, IE blows up with an "operation aborted" error. And yes, I am turning the VB built-in lightbox function off.

I then tried to add a line in headinclude for "<script type="text/javascript" src="js/builder.js"></script>" and get the same results.

Do you ahve any ideas as to why the builder function is making IE barf? I'm running VB 3.7.3.

Thanks!
Buster
I'm getting same problem. Please help!
Reply With Quote
  #6  
Old 03-24-2009, 12:49 PM
ATVTorture ATVTorture is offline
 
Join Date: Sep 2008
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wouldn't expect help. If you notice, my last post was back in September and I got no help. If someone provides it now, I would be surprised. I still haven't found a solution.
Reply With Quote
  #7  
Old 03-24-2009, 02:39 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ATVTorture View Post
I wouldn't expect help. If you notice, my last post was back in September and I got no help. If someone provides it now, I would be surprised. I still haven't found a solution.
Just wait for someone nice to come along eh?

I'll test this WHEN I have time on a 3.6 board as I only have access to 3.6 and 3.8 boards, I stay busy so please send me a reminder PM this weekend if you see nothing well simply because I'm absent minded on occasion .
Reply With Quote
  #8  
Old 03-26-2009, 03:36 AM
crazlunatic crazlunatic is offline
 
Join Date: Mar 2009
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I got the code to not display if user was using IE. Works fine now Sorry IE users!
Reply With Quote
  #9  
Old 03-29-2009, 02:08 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there is this for highslide, which personally i REALLY like because it has more options... you can even drag the images around with highslide.

I'm using highslide with a bbcode right now as well.

https://vborg.vbsupport.ru/showthread.php?t=197901

and this one is easy, basically you add the stuff to the headinclude, and you can use class="highslide" onclick="return hs.expand(this)" anywhere there is an img tag.
Reply With Quote
  #10  
Old 03-30-2009, 11:57 AM
ATVTorture ATVTorture is offline
 
Join Date: Sep 2008
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So what do we have to do to make it work on ours then?

Thanks for looking into it!

Quote:
Originally Posted by crazlunatic View Post
Well, I got the code to not display if user was using IE. Works fine now Sorry IE users!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05959 seconds
  • Memory Usage 2,301KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete