PDA

View Full Version : Show Thread Enhancements - [hoangkiso] Avatar First letter from username in postbit


hoangserip
05-03-2013, 10:00 PM
Demo online: T?i Liệu (http://webtailieu.org)

Info:

Getting alphabet The first of names user as a avatar.

How to install:


Download attachments
Import file product-hoangkiso_avatar.xml


Open postbit or postbit_legacy, add anywhere code:

{vb:raw ad_location.hoangkiso_avatar_show}

additional.css:


.khung {
float: left;
margin: 3px 5px;
}
.pavatar {
color: white;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
float: left;
width: 50px;
height: 50px;
text-align: center;
font-size: 30px;
cursor: default;
}

Way displayed avatar member is already avatar

Find :

<vb:if condition="$show['avatar']">
<a class="postuseravatarlink" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<vb:if condition="$post.avatarurl">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
<vb:else />
<img src="{vb:stylevar imgdir_misc}/unknown.gif" />
</vb:if>
</a>
</vb:if>


And change :


<vb:if condition="$show['avatar']">
<a class="postuseravatarlink" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<vb:if condition="$post.avatarurl">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
<vb:else />
<img src="{vb:stylevar imgdir_misc}/unknown.gif" />
</vb:if>
</a>
<vb:else />
{vb:raw ad_location.hoangkiso_avatar_show}
</vb:if>

Thats all.

djbaxter
05-04-2013, 12:23 PM
:confused:

So does this add the letter avatar only if another avatar does not already exist for that member? Or does it override the current avatar and replace it with this one?

Thangvip9x
05-04-2013, 12:31 PM
Thanks, but not use

hoangserip
05-04-2013, 11:58 PM
Way displayed avatar member is already avatar

<vb:if condition="$show['avatar']"><a class="postuseravatarlink" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}"> <vb:if condition="$post.avatarurl"> <img width="50px" src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" /> <vb:else /> <img src="{vb:stylevar imgdir_misc}/unknown.gif" /> </vb:if> </a> <vb:else /> {vb:raw template_hook.postbit_userinfo_right_after_posts.p ostbit_avatar}</vb:if>

lazytown
05-04-2013, 11:58 PM
Interesting, but it would be more useful if we could have some type of background image behind the letter -- or assign a unique color to each member with the same letter. I know that's probably way beyond the scope of this mod, but it would be neat.

hoangserip
05-05-2013, 12:02 AM
You may Development added of mod, thanks vissa

Toorak Times
05-05-2013, 01:45 PM
Way displayed avatar member is already avatar

<vb:if condition="$show['avatar']"><a class="postuseravatarlink" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}"> <vb:if condition="$post.avatarurl"> <img width="50px" src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" /> <vb:else /> <img src="{vb:stylevar imgdir_misc}/unknown.gif" /> </vb:if> </a> <vb:else /> {vb:raw template_hook.postbit_userinfo_right_after_posts.p ostbit_avatar}</vb:if>

Will not interfere with the member's chosen avatar

Toorak Times
05-05-2013, 01:49 PM
You may Development added of mod, thanks vissa

You change this mod to your needs...please post them in this thread.

Toorak Times
05-05-2013, 01:49 PM
Love this mate, hope you don't take offence I thought I'd clarify what you mean't, did I get it right?

hoangserip
05-06-2013, 12:57 AM
If you do not want to interfere with the member's avatar

hoangserip
09-10-2014, 02:03 AM
update 1.2

hoangserip
09-15-2014, 05:33 PM
update v1.3

ozzy47
09-15-2014, 07:40 PM
Update what? You need to tell people what is going on. :)

Stratis
12-14-2017, 10:16 AM
What other changes we need to make this to work and in the other places that shows the default avatars?

Thanks