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

Reply
 
Thread Tools
vBulletin Attachment Lightbox Details »»
vBulletin Attachment Lightbox
Version: 1.00, by Ntfu2 Ntfu2 is offline
Developer Last Online: Jan 2010 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 05-14-2006 Last Update: Never Installs: 95
 
No support by the author.

//////////////////////////////////////////////////////////////////\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\/
****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 -->
Save and close

2. Next open postbit_attachmentthumbnail find <a after add
Code:
rel="lightbox[attachment]"
Save and close

3. Next Open the headinclude template Find
Code:
<!-- / CSS Stylesheet -->
Replace with
Code:
<link rel="stylesheet" href="clientscript/vbulletin_css/lightbox.css" type="text/css" media="screen" />
<!-- / CSS Stylesheet -->
Save and close

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>
Thank You

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'
	});
});
Replace all YOURSITE.com with the actual address you will keep everything. pretty simple.
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" />
Save and close

Next open the postbit_attachmentthumbnail

After <a add
Code:
rel="lightbox"
If you want the image overlay, also add (or if you changed the effectclass in lightbox_plus.js use what you changed it to)
Code:
class="effects"
Save, and close.

in the postbit_legacy or postbit, place this code at the very top
Code:
<script type="text/javascript" src="clientscript/lightbox_plus.js"></script>
This should produce similar results to the last one, there is no next or previous buttons though.

Enjoy it.

Show Your Support

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

Comments
  #102  
Old 05-17-2006, 11:16 AM
Barakat's Avatar
Barakat Barakat is offline
 
Join Date: Nov 2004
Location: Jerusalem
Posts: 571
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just in the headinclude template put this code at the end of it

PHP Code:
<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>
<
link rel="stylesheet" href="clientscript/vbulletin_css/lightbox.css" type="text/css" media="screen" /> 
and u will have the effect on the pictures on ur forum aslo

with the code which i included it before
Reply With Quote
  #103  
Old 05-17-2006, 11:22 AM
Barakat's Avatar
Barakat Barakat is offline
 
Join Date: Nov 2004
Location: Jerusalem
Posts: 571
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and u can leave the postbit_legacy or the postbit templates without changeing
Reply With Quote
  #104  
Old 05-17-2006, 02:29 PM
Impreza04 Impreza04 is offline
 
Join Date: Jul 2005
Location: UK
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for getting [attach] to work..

On problem with the template edit is that it causes the [attach] to not work (for me at least, i thinks its my settings)

However
Code:
<if condition="$show['attachments']">
works perfectly
Reply With Quote
  #105  
Old 05-17-2006, 02:45 PM
Lady Divus Lady Divus is offline
 
Join Date: Feb 2006
Location: U.S.A.
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Barakat
just in the headinclude template put this code at the end of it

PHP Code:
<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>
<
link rel="stylesheet" href="clientscript/vbulletin_css/lightbox.css" type="text/css" media="screen" /> 
and u will have the effect on the pictures on ur forum aslo

with the code which i included it before
I placed this code in the headinclude at the very end. I dont see anything different with the pics on my forum. I even placed a new image using a url to test and nothing happened. Am i doing something wrong?

Also, could you tell me how to resize the view of the attached images once the thumb is clicked. I dont want it to open in the original size but rather in a predefined size. Is this possible? Anyone? Thanks in advance -

Lady Divus
Reply With Quote
  #106  
Old 05-17-2006, 04:30 PM
wtrk wtrk is offline
 
Join Date: Jun 2005
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice.
Reply With Quote
  #107  
Old 05-17-2006, 05:09 PM
Ntfu2 Ntfu2 is offline
 
Join Date: Feb 2006
Posts: 1,247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lady Divus
I placed this code in the headinclude at the very end. I dont see anything different with the pics on my forum. I even placed a new image using a url to test and nothing happened. Am i doing something wrong?

Also, could you tell me how to resize the view of the attached images once the thumb is clicked. I dont want it to open in the original size but rather in a predefined size. Is this possible? Anyone? Thanks in advance -

Lady Divus
Im trying to figure that out for ya, but not having much luck with this version,

Maybe one day though, im just a n00b
Reply With Quote
  #108  
Old 05-17-2006, 05:45 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dont forget the final " in
title="$attachment[filename] - $attachment[filesize] - Downloaded $attachment[counter] times"
Reply With Quote
  #109  
Old 05-17-2006, 05:57 PM
Ntfu2 Ntfu2 is offline
 
Join Date: Feb 2006
Posts: 1,247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you
Reply With Quote
  #110  
Old 05-17-2006, 06:29 PM
Barakat's Avatar
Barakat Barakat is offline
 
Join Date: Nov 2004
Location: Jerusalem
Posts: 571
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"Lady DIVUS" Coz iam useing my phone i cant make copy paste . But go up to page 3 and u will find a code that i put 'it a small changes on class_bbcode file . Without it the code in the headinclude is useless . Try it and i will work
Reply With Quote
  #111  
Old 05-17-2006, 06:55 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed, running great.
I installed and applied to one forum only "showcase forum" my members love it!

thanks for this great hack
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 07:23 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.05254 seconds
  • Memory Usage 2,332KB
  • 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
  • (12)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete