View Full Version : Show Thread Enhancements - Rounded avatars, profile pictures and attachment thumbnails
valdet
02-27-2008, 10:00 PM
Description:
Rounded Avatar & Image Effects allows you to add 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 corner.js to your clientscript directory
2. In your header template, find:
<!-- content table -->and add this below
<script type="text/javascript" src="clientscript/corner.js"></script>
3. In your postbit_legacy template, find
<div class="smallfont">
<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">
<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" class="corner iradius10" 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. If you want a shadow in your avatars/profile pics you may add ishadowXX to the class, so it may become: class="corner iradius10 ishadow25".
It is very flexible and you can tweak it as much as you want.
v.1.01 added rounded effects for attachment thumbnails
v.1.0 Initial release
Credits for this modification go out to CVI Lab (http://www.netzgesta.de/corner/) for the original javascript. I just made it to work for vBulletin
Enjoy,
Val.
valdet
02-28-2008, 05:43 PM
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="corner iradius10" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>For rounded 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="corner iradius10" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" /></td>For rounded 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 /> </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="corner iradius10" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" /><else /> </if></td></if>For rounded 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="corner iradius10" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_picture]</phrase>" />
For rounded 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 corner iradius10"
Defkalion
02-28-2008, 06:28 PM
This is very nice, but it has one single problem. It destroys animated avatars.
Thanks. :)
iogames
02-28-2008, 07:38 PM
This is very nice, but it has one single problem. It destroys animated avatars.
Thanks. :)
you destroyed my illusions :rolleyes:
Forum Lover
02-28-2008, 07:55 PM
Ah!! It was almost great... any way to keep those gifs away from these action? I can't leave my animations.
valdet
02-28-2008, 08:56 PM
I don't think this javascript works for animated gifs.
But hey someone might find it useful though. ;)
Defkalion
02-28-2008, 09:04 PM
Absolutely. I didn't mean to dishonor your work. This hack is very cool, I just don't have use for it, because I have animated gifs as avatars on my website. :)
Forum Lover
03-01-2008, 04:21 AM
I don't think this javascript works for animated gifs.
But hey someone might find it useful though. ;)
Chill, sure its handy with jpeg.
Brandon Sheley
03-01-2008, 06:15 AM
Nice, I think I'll add this to my forum :)
Thanks valdet
oh, just seen it's for 3.6, will this work in 3.7 ?
thanks
erdiyilmaz
03-01-2008, 11:06 AM
i don't understand how i can shadow it
valdet
03-02-2008, 10:42 AM
Nice, I think I'll add this to my forum :)
Thanks valdet
oh, just seen it's for 3.6, will this work in 3.7 ?
thanks
Hey Brandon, thanks. It surely works for vb3.7 too, but i just did not install that one yet.
In your postbit_legacy search for $vbphrase[xs_avatar] , because there is only one instance of this phrase and do the replace accordingly between the <div> ...... </div> tags. Same goes with other templates too where you want to tweak the avatars.
For profile picture look for phrase $vbphrase[xs_picture].
I am sure it will work.
i don't understand how i can shadow it
It is quite easy.
In my replacements, all you need to do is add the ishadowXX (XX is a number) to the javascript class.
Example if you need to add shadows in postbit_legacy you would use this replacement:
<div class="smallfont">
<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" class="corner iradius9 ishadow38" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>
Note that you can tweak the numbers highlighted in red color to your liking.
The result:
http://img182.imageshack.us/img182/6202/shadowedfi9.th.png (http://img182.imageshack.us/my.php?image=shadowedfi9.png)
Cheers,
Val.
erdiyilmaz
03-02-2008, 02:00 PM
thanks vaLdet, i understand now : )
its very nice
donaldgkimball
03-03-2008, 03:47 PM
Superb find. thx.
debian1
03-04-2008, 10:17 AM
valdet,
pershendetje edhe urime per kete script...
kam nevoje per ndonje script qe mund te mi zvogeloje automatikisht avataret ne 80x80 pixel, edhe pse custom avatars mund te jene te medhej, automatikisht te zvogelohen ne 80x80
Tharos
03-11-2008, 03:41 PM
very nice dude
i´ll use it but i´ll edit it with a pretty rounded
cafenetland
03-19-2008, 02:39 AM
awsome
thx
erdiyilmaz
04-24-2008, 07:09 PM
my forum has a probLem because of corner.js
some antivirus programs immediateLy aLert; EXP/HTML.VML.Gen virus.
how can we soLve this issue?
valdet
04-25-2008, 05:22 PM
my forum has a probLem because of corner.js
some antivirus programs immediateLy aLert; EXP/HTML.VML.Gen virus.
how can we soLve this issue?
I think that might be a false positive, because I scanned that file with Kaspersky online scanner, my McAfee scanner and NOD32 and there were no risk alerts at all.
What's more, I provided the link to original author of this script and since it is widely used, I don't think it is a virus/trojan and whatsoever.
I hope that helps.
Regards,
Val.
sherytiger
04-26-2008, 04:31 AM
Not working for me! :(
Still the avatars are same, no curve or any other effect.
Boofo
04-26-2008, 05:05 AM
What does the shading do?
valdet
04-26-2008, 05:47 AM
Not working for me! :(
Still the avatars are same, no curve or any other effect.
Make sure, you are using the correct replacement and upload the file.
If you want you may PM me your URL to take a look.
Click Install too. :)
What does the shading do?
Hi Boofo,
This adds a shadow to rounded avatars if you selected the appropriate settings in javascript class.
Attached is a screenshot of shades and rounded avatars in action.
Boofo
04-26-2008, 06:09 AM
You did shadow, not shading, though. Isn't the shading on the pic itself?
I finally got the optimal setting for this and it really looks great! Thank you. ;)
valdet
04-26-2008, 06:59 AM
You did shadow, not shading, though. Isn't the shading on the pic itself?
I finally got the optimal setting for this and it really looks great! Thank you. ;)
Shades/shadow it all sounds same to me as I am not a native English speaker. :)
The attached picture has a drop shadow on bottom right side of the picture/avatars.
I am glad you sorted it out.
kj_202
05-18-2008, 05:10 PM
hello valdet, it looks nice but do you know if it possible to do it with categories?
rounded categories if so any ideas on how I would go around this?
valdet
05-19-2008, 07:32 PM
hello valdet, it looks nice but do you know if it possible to do it with categories?
rounded categories if so any ideas on how I would go around this?
Do you mean to have rounded avatars only in certain categories & forums..?
If that's your question, then YES, it can be done by using conditionals.
If, you're thinking categories of your users (aka usergroups) then it can be done with conditionals too.
Regards,
Val.
kj_202
05-20-2008, 07:12 PM
Erm I mean, just having categories, rounded
e.g. Plain categories nothing but a gradient in with a curve in? Do you understand if not reply please... I can explain further.
Edit: doesn't matter now, sorted :)
-deleted-
never mind, stupid question :)
TNCclubman
03-25-2009, 05:11 PM
tried this in vB 3.8.1 doesnt work.
any similar mod for the latest vB?
ERAFOX
04-13-2009, 12:22 PM
this is great
isatice
05-08-2009, 06:45 AM
great hack , but makes animated gif avatars , freezing
valdet
05-08-2009, 09:13 AM
Yes it does. That is one of the limitations of the javascript file.
isatice
05-08-2009, 11:35 PM
anyway great hack , worked fine on 3.8 , thanks 4 quick reply
powersilie
05-23-2009, 11:44 AM
Great! It also works with 3.8.2 !!! :up:
Thanks, we like it!
Karin
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.