vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Adding Lightbox to Attachment thumbs (https://vborg.vbsupport.ru/showthread.php?t=123235)

imranbaig 08-05-2006 10:00 PM

Adding Lightbox to Attachment thumbs
 
Adding Lightbox to Attachment thumbs
Overview
Lightbox JS is a simple, unobtrusive script used to overlay images on the current page. It's a snap to setup and works on all modern browsers.

-This hack allows you to add the famous lightbox to attachment thumbnails.

- This makes users see attached images easilly, without having to open another page.

- It can be completly customised, to fit into your skin design, from css.

Installation - Very easy.

Download and upload the contents of upload folder into your forum root.

Template Edits.

Step1: Open headinclude, and insert this inside <heade></head>

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" />

click Save.

Step2: Now Open postbit_attachmentthumbnail

Find:
Code:

<a 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>

Replace With:
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>

Thats it Enjoy The hack.

Demo: http://forums.winkeyfinder.com/showthread.php?p=1502

Note: It doesn't work if I click an image link before the page has finished loading.
The script is activated only after the page has finished loading.

Thank you!

All the Credit goes to huddletogether.com, for devloping such a beautifull script.

Terminatoronly 08-06-2006 06:59 PM

installed ;) its really good i love it :)

Benj 08-06-2006 06:59 PM

wicked i will be installing

Oddjob 08-06-2006 07:15 PM

Where exactly are you supposed to put that in the headinclude template? At the very top?

Im also a little confused where the files are uploaded to.....

effectica 08-06-2006 11:05 PM

Thanks for this. I installed it, it's great. :)

When I installed it though, it didn't work.
I think that the second edit should be

Code:

<a rel="lightbox" ....
Note the lightbOx

instead of

Code:

<a rel="lightbpx" ....

effectica 08-06-2006 11:09 PM

Quote:

Originally Posted by Oddjob
Where exactly are you supposed to put that in the headinclude template? At the very top?

Im also a little confused where the files are uploaded to.....


EDIT: imranbaig has a better solution

imranbaig 08-07-2006 10:40 AM

Sorry for that typo error.
In the headinclude template Paste it below this.
Code:

<!-- CSS Stylesheet -->
$style[css]
<if condition="is_browser('opera') AND !is_browser('opera', '8.0.1')">
<style type="text/css">
ul, ol { padding-left:20px; }
</style>
</if>
<!-- / CSS Stylesheet -->


effectica 08-07-2006 10:50 AM

Thanks imranbaig.

One question. As with the other lightbox mods that can be found on this site, also yours gives the problem that the quick edit does not work. It saves the data but it doesn't close the quick edit box. Would you happen to know how to fix this?

imranbaig 08-07-2006 11:13 AM

Well this is due the the script, I think the author of the scriipt has few tips for Collision of scripts, Here is the link = http://www.huddletogether.com/projects/lightbox2/ Look into support part.

Also If you want to have it like gallery where it shows Next and Prev Links in lightbox, just change rel="lightbox" to rel="lightbox[whatever]"

Holidazed 08-07-2006 04:47 PM

Well, I followed the instructions to the letter, yet it does not work. I uploaded all the files and made the edits. When I click on the thumbnail in my forums, it just displays it like it always did b4.

See for yourself.
http://www.pcinfoman.com/vbb350/show...?p=193#post193
Username: testing
Password: testing

Ideas?

effectica 08-07-2006 04:53 PM

Quote:

Originally Posted by bitg
Well, I followed the instructions to the letter, yet it does not work. I uploaded all the files and made the edits. When I click on the thumbnail in my forums, it just displays it like it always did b4.

See for yourself.
http://www.pcinfoman.com/vbb350/show...?p=193#post193
Username: testing
Password: testing

Ideas?

Make you sure you used:

<a rel="lightbox" ....

instead of

<a rel="lightbpx" ....

imranbaig 08-07-2006 05:47 PM

Hey man, You have it like <a rel="lightbpx" , pls change it to <a rel="lightbox" this happend while I was typing it. Sorry about it.
I cant edit the above post to correct it, If any mod can it will help many others who will implement this.
Thanks.

Allan 08-07-2006 06:38 PM

Thanks for this hack :)

it work for me if i put this: <a rel="lightbox" .... .... and no <a rel="lightbpx" ....

Click install ^^

Allan 08-07-2006 07:29 PM

There are a problem

Under FF, Attachment thumbs, it's ok, but with IE, Attachment thumbs don't show

and looking this:

https://vborg.vbsupport.ru/

Holidazed 08-07-2006 09:33 PM

Quote:

Originally Posted by effectica
Make you sure you used:

<a rel="lightbox" ....

instead of

<a rel="lightbpx" ....

D'Oh!! Thanks. That fixed it.

effectica 08-07-2006 09:39 PM

Quote:

Originally Posted by Allan
There are a problem

Under FF, Attachment thumbs, it's ok, but with IE, Attachment thumbs don't show

and looking this:

https://vborg.vbsupport.ru/

Yes, same problem here. I guess it is not an easy thing to fix :surprised:

mvigod 08-08-2006 01:59 AM

We looked at this lightbox script awhile ago but the filesize payload on those .js files is way too heavy. Take a look at them and decide if you want members to pay that download hit when viewing your site. I wouldn't use it on high traffic site or for sites where users are not on broadband

imranbaig 08-08-2006 11:47 AM

Quote:

Originally Posted by effectica
Yes, same problem here. I guess it is not an easy thing to fix :surprised:

This problem is nothing to do with hack, You are effectively adding one rel tag to yur anchor tag, thats all and nothing.
Try removing the hack, and see if it still has the same problem.

Can you give me access to your admincp, I will try and fix it?

mvigod, You can easilly creat a Conditional statement which will enable this hack only for a certain group of members.
If you want help in this pm me.

effectica 08-08-2006 12:40 PM

Quote:

Originally Posted by imranbaig
This problem is nothing to do with hack, You are effectively adding one rel tag to yur anchor tag, thats all and nothing.
Try removing the hack, and see if it still has the same problem.

Can you give me access to your admincp, I will try and fix it?

mvigod, You can easilly creat a Conditional statement which will enable this hack only for a certain group of members.
If you want help in this pm me.

Hi imranbaig,
thanks for the help, but I've tried your mod (installed it from scratch twice) as well as other similar mods. The result has always been the same. I've also seen in the threads of these other hacks, people having the exact same problems.

Quote:

You are effectively adding one rel tag to yur anchor tag
I know it is not a problem of how you coded the hack. I love it and I appreciate the time you put on this, but I can only imagine that the javascript that comes with lightbox is causing problems with some vb javascript.
There are obviously problems with the way lightbox integrates with vb, since lightbox wasn't written for vb originally. So when I said "I guess it is not easy to fix" I didn't mean that as in fixing your hack. I was just saying that it is probabily not easy to modify the lightbox code so that it doesn't break certain vb features.

Quote:

Try removing the hack, and see if it still has the same problem.
Yes, by removing the hack everything turns back to normal.

Support on the lightbox authors site, about various issues, is not helpful in this case.

Anyway, thanks for the hack and support. I didn't mean to be unappreciative towards your work.

Allan 08-11-2006 01:38 PM

No fix bug ?

Ntfu2 08-11-2006 06:45 PM

My version from 3.5 still works perfectly with 3.6, and even has some extra options and info in the thread, and doesnt have the undefined error if you are looking for a fix for that.

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

effectica 08-11-2006 08:34 PM

Quote:

Originally Posted by Ntfu2
My version from 3.5 still works perfectly with 3.6, and even has some extra options and info in the thread, and doesnt have the undefined error if you are looking for a fix for that.

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


Hi,
does inline editing work with your hack installed?

Ntfu2 08-11-2006 09:47 PM

yes,

everything works perfect. This version of the hack is missing a few vBulletin specific items it needs to function correctly.

While mine works perfectly within the vBulletin pages

aycan555 08-13-2006 10:11 AM

Verry shine thank you...

mahakala 08-14-2006 09:18 AM

what does this plugin do when the attachment is ".rar", ".zip" or else?

ForumDog 08-14-2006 10:02 AM

Quote:

Originally Posted by effectica
Hi imranbaig,
thanks for the help, but I've tried your mod (installed it from scratch twice) as well as other similar mods. The result has always been the same. I've also seen in the threads of these other hacks, people having the exact same problems.

I know it is not a problem of how you coded the hack. I love it and I appreciate the time you put on this, but I can only imagine that the javascript that comes with lightbox is causing problems with some vb javascript.
There are obviously problems with the way lightbox integrates with vb, since lightbox wasn't written for vb originally. So when I said "I guess it is not easy to fix" I didn't mean that as in fixing your hack. I was just saying that it is probabily not easy to modify the lightbox code so that it doesn't break certain vb features.

I know that a modification I did, which used javascript interaction with Quick-Reply, didn't work in Internet Explorer. I tried four methods of doing the same thing, same result every time. Code validated, no errors or issues. It just didnt work. IE seemed to have problems with the textarea being the target of two javascript functions from different places. It is, to be fair, a very bugged browser and it worked perfectly in every other browser for every method I tried so I could only conclude that it was some kind of issue with IE and I ended up restricting the modification with a conditional that barred it from loading in IE.

Might have been some kind of browser-specific shennanigans in the forum code itself I suppose.

imranbaig 08-17-2006 07:24 PM

.rar and other files work fine with out a problem,..
Check it here: http://forums.winkeyfinder.com/showthread.php?t=1199

upsetter 08-21-2006 07:38 AM

Quote:

Originally Posted by Allan
There are a problem

Under FF, Attachment thumbs, it's ok, but with IE, Attachment thumbs don't show

and looking this:

http://img409.imageshack.us/img409/776/opussjf4.th.png

I have the exact same problem on my forum, but my attached file shows at the bottem, and when I submit it the thumb. on the forum works perfectley but I got the same problem as you, says " undefined (undefined) "

http://www.boostconcept.com/forum/WTF.png

tappedout 08-21-2006 08:37 AM

Works Great thanks!! I had the same script on my home page it ties in great now to have it on the forums! Thanks a ton!!

*Clicks install!

www.sectionviiiclan.com

P.Jackson 08-21-2006 11:34 AM

im getting that undefined problem aswell :(

webgroup 08-23-2006 07:21 AM

Quote:

Originally Posted by imranbaig
Well this is due the the script, I think the author of the scriipt has few tips for Collision of scripts, Here is the link = http://www.huddletogether.com/projects/lightbox2/ Look into support part.

Also If you want to have it like gallery where it shows Next and Prev Links in lightbox, just change rel="lightbox" to rel="lightbox[whatever]"

Installed and working perfectly.
Could you please explain a little more how to exactly add the gallery style function(next/prev)?

Thanks! :)

Snake 08-30-2006 04:17 PM

Thanks for the hack! I'll install it right away... :)

43082448 08-31-2006 02:52 AM

quick edit does not work,how do i?

Lionel 09-06-2006 06:43 AM

Once I removed the javascript in the headinclude, that undefined all over problem mentioned many times in this thread disappeared

Kanustep 09-06-2006 11:42 PM

I'm getting an error on vBulletin editor in font size.
This is a great plug-in, but need a little bit of improvement. Working with version 3.6.0.

Mr_Devlin 09-07-2006 12:50 PM

Sorry, but I can't get this to work.

Did all edits and uploads as described and nothing happened. btw: does it take affect when using custom styles? If so, other upload locations may be required.

Please be more precise where the file have to be uploaded. I loaded all files to forum root and several other folders and get always same result - nothing changed, no lightbox. It depends NOT on browser, because FF won't do it also. I tried IE, FF, Netscape and Deepnet without any success. Have to change back to default attachments.

Kanustep 09-07-2006 12:56 PM

In some cases you need to rebuilt forum cache or forum information.

dodgeboard.com 09-08-2006 03:34 PM

Quote:

Originally Posted by Kanustep
I'm getting an error on vBulletin editor in font size.
This is a great plug-in, but need a little bit of improvement. Working with version 3.6.0.


Same here!!! Plus the UNDEFINED error mentioned earlier. I wished it worked cause I love this hack and so did my members.

Reverted template headinclude and that fixed it but of course, removed lightbox.

Kanustep 09-08-2006 03:41 PM

Is there any fix to this? It shouldn't be hard since it doesn't change anything relevant.

dodgeboard.com 09-08-2006 03:59 PM

Quote:

Originally Posted by Kanustep
Is there any fix to this? It shouldn't be hard since it doesn't change anything relevant.


Dunno.....I don't think it is actually the script in the headerinclude so much as it is the js files in the js directory. I think this because I was able to correct the problem by renaming the js folder to js.whatever which effectively renders the files in that folder unusable to lighbox.

Me thinks one of the .js files is the problem.

I run 3.6.0 and only experience issues in advanced or wysiwyg editor modes, which of course are the only modes that use those drop-down menus.

Dodgeboard.com clicks *uninstalled*


All times are GMT. The time now is 04:54 PM.

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.01399 seconds
  • Memory Usage 1,840KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete