PDA

View Full Version : Show Thread Enhancements - Glossy avatars,profile pictures and attachment thumbnails


valdet
02-28-2008, 10:00 PM
Description:
Glossy Avatar & Image Effects allows you to add glossy rounded corners (and also shading and shadow) to avatars and images on your forums. It uses unobtrusive javascript to keep your code clean.

It works in all the major browsers - Mozilla Firefox 1.5+, Opera 9+, Safari and IE6+.

This modification is a nice addition to all of you, who want your forums to have a nice Web2.0 effect.

Installation:
1. Upload the attached glossy.js to your clientscript directory

2. In your header template, find:
<!-- content table -->and add this below
<script type="text/javascript" src="clientscript/glossy.js"></script>

3. In your postbit_legacy template, find
<div class="smallfont">
&nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>replace it with
<div class="smallfont">
&nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" class="glossy ibgcolor00aa00 igradient00aaaa horizontal noshadow" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>Finished.

Note that you can alter the javascript classes to suit your needs.
vary the radius by adding iradius followed by the desired radius in percent of half of the smaller picture dimension:

Corner radius class "iradius25" - min=20 max=50 default=25vary the shadow by adding noshadow:

Noshadow class "noshadow" - default=falsevary the background by adding ibgcolor followed by the desired color as hex:

Background color class "ibgcolor" - min=000000 max=ffffff default=0vary the background by adding igradient followed by the desired color as hex:

Gradient color class "igradient" - min=000000 max=ffffff default=0vary the color gradient direction by adding horizontal:

Horizontal gradient class "horizontal" - default=falseIt is very flexible and you can tweak it as much as you want.

v.1.01 added glossy effects for attachment thumbnails
v.1.0 Initial release


Credits for this modification go out to CVI Lab (http://www.netzgesta.de/glossy/) for the original javascript. I just made it to work for vBulletin

Enjoy,
Val.

valdet
02-29-2008, 09:57 AM
Here are the additional changes for postbit template, memberprofile, memberlist and profile picture


In your postbit template, find
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>replace it with
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" class="glossy ibgcolor00aa00 igradient00aaaa horizontal noshadow" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>For glossy avatar in member profile, in MEMBERINFO template, find:
<td><img src="$userinfo[avatarurl]" $userinfo[avatarsize] alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" /></td>and replace it with
<td><img src="$userinfo[avatarurl]" $userinfo[avatarsize] class="glossy ibgcolor00aa00 igradient00aaaa horizontal noshadow" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" /></td>For glossy avatar in memberlist, in memberlist_resultsbit template, find this
<if condition="$show['avatarcol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['avatar']"><img src="$avatarurl" border="0" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" /><else />&nbsp;</if></td></if>replace it with:
<if condition="$show['avatarcol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['avatar']"><img src="$avatarurl" class="glossy ibgcolor00aa00 igradient00aaaa horizontal noshadow" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" /><else />&nbsp;</if></td></if>For glossy display picture in member profile, in MEMBERINFO template find:
<img src="$userinfo[profilepicurl]" $userinfo[profilepicsize] alt="<phrase 1="$userinfo[username]">$vbphrase[xs_picture]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" />replace it with:
<img src="$userinfo[profilepicurl]" $userinfo[profilepicsize] class="cglossy ibgcolor00aa00 igradient00aaaa horizontal noshadow" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_picture]</phrase>" />For glossy attachment thumbnails, in postbit_attachmentthumbnail template find this:
class="thumbnail" as it is the only instance of a class in the template, and replace it with
class="thumbnail glossy ibgcolor00aa00 igradient00aaaa horizontal noshadow"

kiril_cvetkov
02-29-2008, 10:28 AM
first post.. nice ... :) thanks

shadowevil
02-29-2008, 11:18 AM
nice mod .... installed

Ps: does this work 3.7.x ????

Akademiks
02-29-2008, 12:07 PM
works with animated gif?

iogames
02-29-2008, 10:48 PM
Believe me... this are great but .GIF animated is a Tradition! :(

avsunforum
03-01-2008, 07:01 PM
thanks

syrus.xl
03-02-2008, 11:02 AM
Looks cool... But I would have placed the javascript call line in the headinclude template where most vbulletin javascript calls reside. :)

valdet
03-02-2008, 11:31 AM
Looks cool... But I would have placed the javascript call line in the headinclude template where most vbulletin javascript calls reside. :)

It does not work if you place the javascript in headinclude (<head>...</head>), because this one needs to be included after the <body> tag..

Believe me I tried to place in headinclude and it won't display these effects.

Val. ;)

syrus.xl
03-02-2008, 11:48 AM
It does not work if you place the javascript in headinclude (<head>...</head>), because this one needs to be included after the <body> tag..

Believe me I tried to place in headinclude and it won't display these effects.

Val. ;)

Yeah, I noticed... I tried that first!! :erm: Simple but entertaining modification though!

Nice work.
:)

montsa007
07-10-2008, 07:29 AM
will it work on bbcode images hosted on other sites?

Mazinger
12-10-2008, 09:17 AM
Interesting mod, downloaded!

Infopro
12-10-2008, 12:08 PM
It does not work if you place the javascript in headinclude (<head>...</head>), because this one needs to be included after the <body> tag..

Believe me I tried to place in headinclude and it won't display these effects.

Val. ;)


Hmm, works fine for me. Added to the bottom of the headerinclude, last line.

Once this is added, you can basically add it to any image. Find where the image is located in your template and add this right before the alt tag:
class="glossy ibgcolor00aa00 igradient00aaaa horizontal noshadow"

Doesn't matter of the size, but colors will need to be edited to look good. ;)

One last note, I added this to 3.8.0. Forum version shouldn't be a concern with this simple script I don't think.

Infopro
12-10-2008, 12:11 PM
Works in firefox but not in IE7 for me here. Just noticed. Might be something on my end.

IoGhost
12-12-2008, 09:46 AM
Tested on IE7, FF2, FF3, Opera 9.27, Opera 9.62, Safari 3.2 - works.
My recomendation, replace last two strings in js-file (setup window.onload event) with:if (navigator.appName == "Microsoft Internet Explorer")
{
window.attachEvent('onload', function() { addIEGlossy(); });
}
else
{
window.addEventListener('load',function OnLoad() { addGlossy(); }, true);
}

IoGhost
12-12-2008, 10:56 AM
And insert code:if (isIE) { addIEGlossy(); } else { addGlossy(); }in "clientscript/vbulletin_quick_edit.js" after else
{
vB_QuickEditor.restore(vB_QuickEditor.ajax.fetch_d ata(fetch_tags(AJAX.responseXML, 'postbit')[0]), 'tableobj');
PostBit_Init(fetch_object('post' + vB_QuickEditor.postid), vB_QuickEditor.postid);and in "clientscript/vbulletin_quick_reply.js" after PostBit_Init(postbit, postbits[i].getAttribute('postid'));
}if you want to keep glossy-effect in "quick-edited" and "qucik-added" posts.