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
Lytebox Intergration. Allows image groups, slideshows and works with embeded images. Details »»
Lytebox Intergration. Allows image groups, slideshows and works with embeded images.
Version: 1.20, by D.Baker D.Baker is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.7.0 Rating:
Released: 05-20-2008 Last Update: Never Installs: 9
Template Edits
Re-useable Code Additional Files Translations  
No support by the author.

This mod has be made redundant by The Image Resizer by TCattitude. So, I no longer support it and recommend you use his plugin instead, it's much better!

This isn't the best mini-mod out there, and I'm not even sure if it's technically a mod. It's closer to a "how to" document than a mod. This works better than most of the proper Lytebox mods out there as it allows image grouping or slideshows (can't have both) and works with images embeded in posts (using ATTACH BBcode, or the little paper clip) . I'm not sure if it works with images in signatures, try it out and let me know. It does not do anything to images embedded using the IMG BBcode (it only works on images linked to by a thumbnail).

LIVE DEMO: Here. Note that I am using the image group feature instead of the slideshow feature.

Anyway, here it is.

If you would like to get Lytebox working with vB 3.7.0 (this should work with other versions, but this is all I have tested it on). You need to do the following.

1) Download latest version of Lytebox here.

2) Edit lytebox.js to your desired settings (can just leave as default if you want).

3) Edit lytebox.css using a find-and-replace tool (even Notepad will do this). You need to swap all the words:
HTML Code:
images
for:
HTML Code:
../images/lytebox
4) Upload lytebox's images folder to "/images/lytebox" using FTP.

5) Upload lytebox.js and lytebox.css to "/clientscript" using FTP.

6) In AdminCP, go to Styles & Templates>Replacement Variable Manager and create a new replacment variable. Set it to replace:
HTML Code:
rel="Lightbox"
with:
HTML Code:
rel="lytebox"
If you want to use the image group feature then replace
HTML Code:
rel="Lightbox"
with:
HTML Code:
rel="lytebox[group]"
This will make all attached/embeded images in the one thread display in lytebox as a group (I am still working on how to make only images from the one post group).

If you want to use the lyteshow feature then replace
HTML Code:
rel="Lightbox"
with:
HTML Code:
rel="lyteshow[group]"
This will make all attached/embeded images in the one thread display in lytebox as a slidshow (I am still working on how to rhis with only images from the one post ).
7) In AdminCP, go Style Manager>Edit Templates>Show Thread Templates>SHOWTHREAD. Click Customize (or Edit) and replace the following code:

Code:
<if condition="$show['lightbox']">
<!-- lightbox scripts -->
    <script type="text/javascript" src="clientscript/vbulletin_lightbox.js?v=$vboptions[simpleversion]"></script>
    <script type="text/javascript">
    <!--
    vBulletin.register_control("vB_Lightbox_Container", "posts", $vboptions[lightboxenabled]);
    //-->
    </script>
<!-- / lightbox scripts -->
</if>
with this code:

Code:
<if condition="$show['lightbox']">
<!-- lightbox scripts -->
    <script type="text/javascript" language="javascript" src="clientscript/lytebox.js"></script>
    <link rel="stylesheet" href="clientscript/lytebox.css" type="text/css" media="screen" />
<!-- / lightbox scripts -->
</if>
8) You need to move the above code into the head section of the SHOWTHREAD template. To do this, you simply cut it and paste it right above the <HEAD> tag.

9) Repeat steps 7 and 8 for the SHOWTHREAD_SHOWPOST template. You can find this template by going into Style Manager>Edit Templates>Show Thread Templates>SHOWTHREAD_SHOWPOST. This will get lytebox working on the individual post page.

10) In AdminCP you need to turn on thumbnails and Lightbox (note that it refers to Lightbox, not lytebox. This is OK). You can do this in the AdminCP at vBulletin Options>Message Attachment Options.

11) Make sure that your images aren't set to load in a New Window. You can change this in the AdminCP at Attachments>Attachments Manager.

12) To enable images embedded using the IMG tag to be resized and enlarged using lytebox, you need to install JASE2's Image Resizer plugin from here and make some code changes.
Make sure you you set Image Resizer to enlarge images in a new window. You do this in AdminCP vBulletin Options>Image Resizer Options>Default Resize Mode and set it to "Open in new window". You also need to set the size you want the IMG embedded images resized to (I set them to the same as my thumbnail settings).
13) Using FTP, browse to /includes/ and edit the following line of PHP code in the file "class_bbcode.php".

PHP Code:
return '<img src="' .  $link '" border="0" alt="" />'
change to:

PHP Code:
return '<a target="_blank" href="' $link '" rel="lytebox[group]"><img src="' $link '" border="0" alt="" /></a>'
NOTE: If you want to use the slideshow feature, simply use rel="lyteshow[group]" rather than rel="lytebox[group]".

14) To remove the yellow warning box from images embedded using IMG tags, add the following CSS to your style.

Code:
.ncode_imageresizer_warning {
    display: none;
}

v1.2

Provides a way to resize images embedded using IMG. It's not perfect, but it works in the meantime.

v1.1
Works when viewing a single post.
Allows for slideshows using lyteshow.


Credits:
Thanks to Andy Huang from the vB team.
Thanks to Lost Heaven for coming up with the code I used in step 13.
Of course, thanks to Markus F. Hay for Lytebox.

Show Your Support

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

Comments
  #12  
Old 05-22-2008, 07:37 PM
DoB Rhapsody DoB Rhapsody is offline
 
Join Date: Jul 2007
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

demo please..
Reply With Quote
  #13  
Old 05-23-2008, 12:19 PM
D.Baker D.Baker is offline
 
Join Date: May 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LIVE DEMO: Here. Note that I am using the image group feature instead of the slideshow feature.
Reply With Quote
  #14  
Old 05-23-2008, 06:09 PM
Stoebi Stoebi is offline
 
Join Date: Apr 2006
Location: Germany, Berlin
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how can i set a comment for evey image, please?

Demo here:
http://www.dolem.com/lytebox/misc/jupiter_io_thumb.jpg
Reply With Quote
  #15  
Old 05-23-2008, 06:31 PM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice this hack, i like it, congrat
Reply With Quote
  #16  
Old 05-23-2008, 06:53 PM
bmwusa bmwusa is offline
 
Join Date: Feb 2006
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just what i was looking for thanks!
Reply With Quote
  #17  
Old 05-23-2008, 07:53 PM
DoB Rhapsody DoB Rhapsody is offline
 
Join Date: Jul 2007
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by D.Baker View Post
LIVE DEMO: Here. Note that I am using the image group feature instead of the slideshow feature.
ok, great. I'll definitely install this when it works for the IMG tag.
Reply With Quote
  #18  
Old 05-23-2008, 11:53 PM
vitoreis vitoreis is offline
 
Join Date: Nov 2005
Location: Portugal
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DoB Rhapsody View Post
ok, great. I'll definitely install this when it works for the IMG tag.
Waiting for IMG too Thanks D.Baker!
Reply With Quote
  #19  
Old 05-24-2008, 07:36 AM
D.Baker D.Baker is offline
 
Join Date: May 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the feedback guys. I have contacted JASE2 of Image Resizer to see if it's possible for him to support vb 3.70's inbuilt version of Lightbox, or even better, for us to merge our two modes together.

If he supports vB's Lightbox with the "open in new window" feature of his plugin, I'm pretty sure that my mod will then work with his, as it replaces all Lightbox calls with lytebox, so I'm pretty sure it would work. Otherwise, I am stumped. I don't know enough about JavaScript to edit his plugin to ad the necessary rel="lytebox" tags on his open in new window commands. I have tried messing around with it, but I couldn't get it working. I haven't heard anything back from him yet. I'll keep you posted. If he does get back to me, this plugin will be the ultimate lightbox plugin.

As for getting all images in a single post to group, I posted a support request here, but haven't heard anything back yet. If anyone knows the answer, please let me know.
Reply With Quote
  #20  
Old 05-24-2008, 08:32 AM
D.Baker D.Baker is offline
 
Join Date: May 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I figured out how to get it to resize images embedded using IMG tags!

It's not perfect. It requires another plug (which you might already be using). It also removes the images paddings, so they sit right on top of each other. But its prett close to working perfect.

Let me know what you think, and if you can see a better way of doing it. I'd love to know.
Reply With Quote
  #21  
Old 05-24-2008, 09:31 AM
pedroenf pedroenf is offline
 
Join Date: Jun 2006
Location: Portugal
Posts: 308
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fantastic!! Now it is really perfect. Thank you for your efforts.
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 01:06 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04388 seconds
  • Memory Usage 2,319KB
  • 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
  • (3)bbcode_code
  • (8)bbcode_html
  • (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
  • (3)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