The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vBulletin Attachment Lightbox Details »» | |||||||||||||||||||||||||
//////////////////////////////////////////////////////////////////\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\/ ****LightBox for vBulletin Attachments By: Dave @ FightRice.com**** \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\/ //////////////////////////////////////////////////////////////////\ Ogrinal Version: ALl credit should go there, I Simply ported to vBulletin by myself View Second Post In Thread for more modifications: What this hack does is add a nice CSS and Javascript lightbox effect to your forums attachments. Attachments must be set to shown as thumb- nails and not inline. Attachments can not be posted using the [attach] id[/attach] bbCode at this time. Working Demo(s): (Send me your URL once you get it working) http://www.fightrice.com/forums/showthread.php?t=124 Now Lets Get Started 1. Open your adminCP - Styles and Templates - Template Manager - Postbit Templates - postbit OR postbit_legacy (only edit both if you use both) At The Very Top Add Code:
<!--LightBox By Dave At FightRice --> <if condition="$show['thumbnailattachment']"> <script type="text/javascript" src="clientscript/prototype.js"></script> <script type="text/javascript" src="clientscript/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="clientscript/lightbox.js"></script> <!-- / Light Box --> <else /> <!-- Nothing To Load Here--> </if> <!-- /LightBox --> 2. Next open postbit_attachmentthumbnail find <a after add Code:
rel="lightbox[attachment]" 3. Next Open the headinclude template Find Code:
<!-- / CSS Stylesheet --> Code:
<link rel="stylesheet" href="clientscript/vbulletin_css/lightbox.css" type="text/css" media="screen" /> <!-- / CSS Stylesheet --> Thats all for template edits: Now upload the contents of the clientscript into your forums. You should end up with this structure /forums/clientscript/vbulletin_css/lightbox.css /forums/clientscript/ - All the .js files go inside this folder Next Upload the images into the webroot.ex http://www.yoursite.com/images/lightboximages.gif (note this isnt an actual image, its an example) Thats all there should be User Configuration Options below If you do not feel comfortable doing this, dont its not neccasary. if you come up with a cool effect please share it. |||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||| ------------------------------------------------------------------------------- In the clientscript/lightbox.js file these lines you can config to suite your needs __________________________________________________ _________________________________ Code:
var fileLoadingImage = "/images/loading.gif"; var fileBottomNavCloseImage = "/images/closelabel.gif"; var resizeSpeed = 7; // controls the speed of the image resizing (1=slowest and 10=fastest) var borderSize = 10; //if you adjust the padding in the CSS, you will need to update this variable clientscript/vbulletin_css/lightbox.css Of Course can also be edited to make it unique to your needs. Thats All, Make sure you click install, and nominate for Hack Of The Month! If you like and wish to see other cool releases please donate via paypal, marcia@secondhomekennel.com or a simple link back will rock as well Code:
<a href="http://www.FightRice.com" target="_blank">Fight Rice</a> CLICK INSTALL TO GET SUPPORT! also a nomination for hack of the month wouldnt hurt THIS IS FOR THE IMAGE RESIZE VERSION - USE lightboxresize.zip DO NOT USE BOTH! /////////////////////////////////////////////////////////////\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\/ Dynamic Lightbox auto resize - and image overlay. /////////////////////////////////////////////////////////////\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\/ If using a previous version of this hack, please remove all instances, delete all old files and undo any templae edits. easy way is to simply follow the old instructions, and simply remove things instead of add. This lightbox will automatically resize images to your screen, and all for full size viewing. Feel free to edit as you see fit. First Step. open lightbox_plus.js at the very end find Code:
// === PLEASE EDIT TO MATCH YOUR SITE === addEvent(window,"load",function() { var lightbox = new LightBox({ loadingimg:'http://www.YOURSITE.com/images/loading.gif', expandimg:'http://www.YOURSITE.com/images/expand.gif', shrinkimg:'http://www.YOURSITE.com/images/shrink.gif', effectimg:'http://www.YOURSITE.com/images/zzoop.gif', effectpos:{x:-40,y:-20}, effectclass:'effects', closeimg:'http://www.YOURSITE.com/images/close.gif' }); }); Save and close. Create the zzoop.gif image to match your site, Upload lightbox_plus.js to the /yourforumlocation/clientscript folder Upload lightbox.css into /yourforumlocation/clientscript/vbulletin_css folder Upload all images into http://www.YOURSITE.com/images *MAKE SURE ALL PREVIOUS INSTALLATIONS ARE REMOVED AT THIS POINT* Login to AdminCP -> Styles Templates -> headinclude template add at the very end. Code:
<link rel="stylesheet" href="clientscript/vbulletin_css/lightbox.css" type="text/css" media="screen,tv" /> Next open the postbit_attachmentthumbnail After <a add Code:
rel="lightbox" Code:
class="effects" in the postbit_legacy or postbit, place this code at the very top Code:
<script type="text/javascript" src="clientscript/lightbox_plus.js"></script> Enjoy it. Show Your Support
|
Comments |
#132
|
||||
|
||||
Well I can't can't figure it out right now, same thing happens anywhere within the postbit template, perhaps I can add it to one of the header templates to make it work properly.
BTW - the only complaint I've received from users is that the images do not resize. If someone adds a 2048x2048 pic and users click the thumbnail, they have to scroll all over the place and can't really make anything out because the original size is just too big. Normally a browsers automatic image resizing takes care of this but it seems to be disabled when using your hack. Any plans to get this working again somehow? Overall it's a beautiful hack and I'll continue to use it once the images can be automatically resized or the image resizing for browsers works |
#133
|
|||
|
|||
I have a version coming that resizes images automatically, but sadly the next and previous buttons do not work at the same time with it. because there is the option to view the image in full size.
When adding the javascript into the headinclude template it calls them every time the page is loaded and can have an effect on performance sometimes. |
#134
|
|||
|
|||
Quote:
Lady Divus |
#135
|
|||
|
|||
Updated first post to include instructions for image resize and a overlay.
here is a demo: http://www.fightrice.com/forums/site...-test-197.html My sites running like poo right now, if you go there and its down, just check back Quick edit also seems to work fine in this version, someone else will need to confirm that for me please |
#136
|
|||
|
|||
Ntfu2, i did everything you said to do for this new resize release, but for the life me i cant get it to work. It just stopped working altogether and opens the images in a seperate window with a white background, (vB Default view)...
I undid all the previous template edits, i deleted all the previous files from my server, i edited the new js file to point to my site images, i did the new template edits, i uploaded all the new files to my server. Am i doing something wrong? Thank you for any help in advance - Lady Divus |
#137
|
|||
|
|||
did you change the rel="lightbox[attachment]" to simply rel="lightbox" ?
|
#138
|
|||
|
|||
Quote:
|
#139
|
|||
|
|||
When I load up the three pics on your demo site I simply get the pic with a nice border around it and a small x in the upper right hand corner. Anywhere I click on the pic once it's loaded, it goes away. No prev or next. The name size and number of times loaded shows as a tooltip and that's it.
Now on my site I get the annoying prev/next with a flashing line right in the middle of the pic where each click side is separated. I get the animation of the box and the sliding down with the name,size and loaded times but only on the pics without bbcode [attach]. I love the way the demo site works, clean and simple. Load the pic, close the pic, click on the next pic to see it. What is different about your demo site and the instructions you have provided here? Also I do have it loaded the bbcode pics on 3.5.3 since you said you'd only tested in 3.5.4. |
#140
|
|||
|
|||
The demo site is now running the 2nd version "lightboxresize.zip"
Simply undo all template edits from previous version, and follow instructions in the second part of the first post - /////////////////////////////////////////////////////////////\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\/ Dynamic Lightbox auto resize - and image overlay. /////////////////////////////////////////////////////////////\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\/ From there down to get the same version as on demo site now.q |
#141
|
|||
|
|||
Perfect!
Are you adding the bbcode support to the second one? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|