vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Avatar/Image Reflection Effect (https://vborg.vbsupport.ru/showthread.php?t=114726)

Tralala 05-03-2006 10:00 PM

Avatar/Image Reflection Effect
 

This modification dynamically adds a subtle "reflection" effect underneath avatars and/or images on your forums. The reflection will automatically fade into your forum's background color, whatever it might be. You can also offer this effect as an option for your members' uploaded images via a BB Code.


This effect uses unobtrusive javascript to keep your code clean. It doesn't require additional server work. It works in all the major browsers - Internet Explorer 5.5+, Mozilla Firefox 1.5+, Opera 9+ and Safari. On older browsers, it'll degrade and your visitors won't notice a thing. Best of all, it's under 5KB!

"Simple. Unique. Classy. Thank you!"
- Forum admininstrator, JoeSixPack

"This mod gives my forum a slick, almost 3-D look!"
- Forum administrator, Tralala


Details:
1 file upload ("reflection.js") to forum's clientscript directory

1 template edit to "header" template

Optional edit: 1 for avatars in thread view ("postbit_legacy" template)
Optional edit: 1 for avatars in thread view ("postbit" template)
Optional edit: 1 for avatars in member profile ("MEMBERINFO" template)
Optional edit: 1 for profile picture in member profile ("MEMBERINFO" template)
Optional edit: 1 for avatars in Members List ("memberlist_resultsbit" template)
Optional edit: 1 for new BBcode (AdminCP -> Custom BB Codes -> BB Code Manager)
Optional edit, not recommended: 1 for ALL images posted inline via standard IMG BBCode ("includes/class_bbcode.php" file)

(All of the above optional edits involve simply inserting class="reflect" to the image HTML code, which adds the reflections. The code to replace for each edit is included in the .zip archive.)

See screenshots to see it in action...


My very first vBulletin hack! Kudos to the fine coders at vBulletin.org whose work inspires me.

Special thanks to Cow's Blog for the reflection.js code. Shared and distributed freely under MIT-style License.

Enjoy!!

Tralala 05-04-2006 04:43 AM

Avatar/Image Reflection Effect (aka "AIRE")

Version History

1.5 - (Upgraders, simply overwrite reflection.js in your forum's clientscript folder!)
-Added ability to vary height and the opacity of the reflections
-Fixed issue with Safari and landscape images
-Made reflection of images with specified dimensions better
-Removed wholeimage class
-Added scriptable reflections - Reflection.add(), Reflection.remove() - allowing for interactivity and flexibility. Reflections can respond to user actions (e.g. changing the reflection opacity when the image is hovered over or clicked.) For more information, see info and files at http://cow.neondragon.net/stuff/reflection/
-Added instructions for postbit template.

1.02
-added another optional edit, this time a BB Code available for your members to invoke on an image-per-image basis

1.01
-added one optional edit, for profile picture in member profile
-tweaked the display for avatars in member profile and Members List (removing 1px border to line up reflection better)

1.0
-initial release

Boofo 05-04-2006 05:05 AM

On the older browsers when it degrades, even though you can't see the reflection, does the avatar reduce to the original size or is it still elongated and looking like it has a space underneath is where the reflection should be?

Tralala 05-04-2006 05:14 AM

Quote:

Originally Posted by Boofo
On the older browsers when it degrades, even though you can't see the reflection, does the avatar reduce to the original size or is it still elongated and looking like it has a space underneath is where the reflection should be?

On older browsers, there is no reflection under images, and no extra "space underneath." (In other words, images display exactly as they did before this modification was installed.)


Also note that this mod doesn't "elongate" the original image nor change it's dimensions or modify it in any way; it merely adds a reflection effect underneath. In fact, the original image is still right-clickable to download (or display in a new window or tab) in its original form.

Boofo 05-04-2006 05:15 AM

Quote:

Originally Posted by Tralala
On older browsers, there is no reflection under images, and no extra "space underneath." (In other words, images display exactly as they did before this modification was installed.)


Also note that this mod doesn't "elongate" the original image nor change it's dimensions or modify it in any way; it merely adds a reflection effect underneath. The original image is still right-clickable to download in it's original form.

I meant the space where the reflection is, sorry about that. ;)

Tralala 05-04-2006 05:18 AM

Quote:

Originally Posted by Boofo
I meant the space where the reflection is, sorry about that. ;)

Gotcha. So yeah, on older browsers... there is no reflection. And no "space" where the reflection would have been. It just displays the original image normally, as it always had been displayed (before this mod.)

Boofo 05-04-2006 05:22 AM

Quote:

Originally Posted by Tralala
Gotcha. So yeah, on older browsers... there is no reflection. And no "space" where the reflection would have been. It just displays the original image normally, as it always had been displayed (before this mod.)

Thank you, sir. I will give this a shot then. ;)

Ziki 05-04-2006 10:30 AM

Installed Maestro!

OrangeFlea 05-04-2006 11:30 AM

What does this hack do to animated avatars?

wizardan 05-04-2006 11:31 AM

Installed.
Unfortunately, my old favorite, Netscape 7.2, doesn't seem to pick it up.

Snake 05-04-2006 12:23 PM

Pretty nice. Works fine on Firefox!

Tralala 05-04-2006 12:55 PM

Quote:

Originally Posted by OrangeFlea
What does this hack do to animated avatars?

Reflections of animated images only work correctly in Internet Explorer.

Tralala 05-04-2006 01:05 PM

Update 1.01

-added one optional edit, for profile picture in member profile
-tweaked the display for avatars in member profile and Members List, removing 1px border to line up reflection better

The Chief 05-04-2006 01:41 PM

Will give this a shot :)

firstrebel 05-04-2006 03:09 PM

Tried this on my dev site using steps 1 -3 and it didn't work. I am using the current version of IE.

Bob

Tralala 05-04-2006 03:37 PM

Quote:

Originally Posted by Bob
Tried this on my dev site using steps 1 -3 and it didn't work. I am using the current version of IE.

Hmm... it should...
Do you have javascript turned on in IE?
Does the effect display in other browsers for you, like Firefox?

firstrebel 05-04-2006 03:48 PM

Javascript is on, and it does not show in FF either. I will try it on my live site later and let you know.

Bob

TruthElixirX 05-04-2006 04:10 PM

Awesome looking! clicked install.

Tralala 05-04-2006 04:37 PM

Quote:

Originally Posted by Tralala
Reflections of animated images only work correctly in Internet Explorer.

Actually, allow me to clarify: animated images will reflect in all the major browsers. Only in Internet Explorer 5.5+, however, does the reflection animate as well. (In the others, it is just a static reflection.)

And as mentioned previously, if the visitor's browser happens to not be compatible... avatars and images display normally, just as before. The visitor wouldn't even know this effect was installed.

Ziki 05-04-2006 05:56 PM

Your zip is corrupt

Tralala 05-04-2006 06:04 PM

Quote:

Originally Posted by ZIKI-SET
Your zip is corrupt

I've just re-uploaded it, and removed the screenshot samples (since they're on display in the first post.) Let me know if that works for ya.

Ziki 05-04-2006 06:09 PM

Nope still doesn't

Tralala 05-04-2006 06:15 PM

Quote:

Originally Posted by ZIKI-SET
Nope still doesn't

Weird; others have downloaded it fine...

Anyway, I just zipped it on a different computer using a different app. Please try downloading again, thanks!

Barakat 05-04-2006 11:45 PM

installed and working fine >

Tralala 05-04-2006 11:47 PM

Quote:

Originally Posted by Lil Ripsta
Pretty nice. Works fine on Firefox!

Thanks, Lil Ripsta. Please click Install. :cool:

Tralala 05-04-2006 11:49 PM

Quote:

Originally Posted by firstrebel
Javascript is on, and it does not show in FF either. I will try it on my live site later and let you know.

Sounds good. I've tested it and confirmed it works over here, as have quite a few others... so am curious to hear feedback after you've tested on your live site.

whitetigergrowl 05-05-2006 12:08 AM

Working awesome. Great job. Thank you!

Tralala 05-05-2006 12:50 AM

I just made a slight tweak to the installation procedure, and that is putting the reflection.js file into the clientscript directory instead. (It's more appropriate there, than loose in the forum's parent directory.) I then updated the "header" template change to match this new location.

Other than that, the modification is exactly the same. Such a minor change, not worthy of a new version number.

Boofo 05-05-2006 01:05 AM

LOL I did that when I first installed it. Better to keep the js files together. ;)

board.trash 05-05-2006 01:53 AM

thank you, a very nice mod!

GrendelKhan{TSU 05-05-2006 09:57 AM

way cool! works great too!

:D

<< clicks install

Tralala 05-05-2006 07:37 PM

Quote:

Originally Posted by Barakat
installed and working fine >

Quote:

Originally Posted by board.trash
thank you, a very nice mod!

Quote:

Originally Posted by GrendelKhan{TSU
way cool! works great too!

:D

<< clicks install


You're welcome and thanks for the compliments! :banana:

Tralala 05-05-2006 10:33 PM

Update: 1.02
-added another optional edit, this time a BBCode available for your members to invoke on an image-per-image basis



To create a BB Code that your members may choose to invoke when they want to add the reflection effect to their linked, inline images... go to AdminCP -> Custom BB Codes -> BB Code Manager.
Click "Add new BB Code." Enter in the following and then "Save."

Title: Image with reflection

Tag: imgreflect

Replacement: <img src="{param}" class="reflect" />

Example: [imgreflect]http://www.google.com/images/logo_sm.gif[/imgreflect]

Description: Adds reflection effect to images.

Use {option}: No


Note that the "Example" will not display with a reflection there, because the javascript isn't linked in the AdminCP pages. However, the example will display properly on your forum's FAQ/BB Code page: http://www.yourforumname.com/forums/misc.php?do=bbcode

babynino 05-06-2006 01:01 PM

Thanks for this cool hack. Installed :)

Nachtfalke 05-06-2006 06:58 PM

Nice one. Fits my design perfectly and works like a charm

C_P 05-06-2006 07:22 PM

I added this but does not seem to work? Wonder where I may have went wrong.

Tralala 05-06-2006 07:42 PM

Quote:

Originally Posted by C_P
I added this but does not seem to work? Wonder where I may have went wrong.

Due to postbit's horizontal orientation, adding this effect to avatars on forums using that layout will make it look very strange, and wasteful of space. Therefore I didn't include those instructions with the hack. It makes much more sense on the postbit_legacy (vertical) layout.

I checked your site and it looks like you are using postbit and not postbit_legacy.

So, which of the edits did you apply?

The easiest one to test with, I think, would be the BBcode. You can just add that in and make a test post with an embedded image (wrapped inside the new [IMGREFLECT] tag) and see if the reflection effect works for you.

If so, then you can start editing the templates/codes.

Boofo 05-06-2006 07:46 PM

Quote:

Originally Posted by Tralala
Due to postbit's horizontal orientation, adding this effect to avatars on forums using that layout will make it look very strange, and wasteful of space. Therefore I didn't include those instructions with the hack. It makes much more sense on the postbit_legacy (vertical) layout.

That's why I only installed it for the profile. ;)

C_P 05-06-2006 09:38 PM

I did get this to work fine. I was adding it to the wrong section and did not follow all the instructions.
I also wanted to say this is a VERY nice hack and really add a nice look to your site.
I just found out this is the first hack for Tralala and for it to work flawlessly as it is, not a bad one I must say!

Tralala 05-06-2006 09:56 PM

Quote:

Originally Posted by C_P
I did get this to work fine. I was adding it to the wrong section and did not follow all the instructions.
I also wanted to say this is a VERY nice hack and really add a nice look to your site.
I just found out this is the first hack for and for it to work flawlessly as it is, not a bad one I must say!


Thanks C_P!

And yes, it is definitely looking very nice on your site...

With your permission, here are screenshots so everyone can see the reflection effect in action:

http://homepage.mac.com/joshr/trl/re...es/screen1.jpg

http://homepage.mac.com/joshr/trl/re...es/screen2.jpg


All times are GMT. The time now is 10:31 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.01468 seconds
  • Memory Usage 1,829KB
  • 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
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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