Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard

Reply
 
Thread Tools
If User Hasn't Got An Avatar Show Default Avatar With Link To Set One Details »»
If User Hasn't Got An Avatar Show Default Avatar With Link To Set One
Version: 1.00, by 1Unreal 1Unreal is offline
Developer Last Online: Aug 2020 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.8.x Rating:
Released: 03-02-2009 Last Update: Never Installs: 3
Template Edits
Re-useable Code  
No support by the author.


I think that when most of your users have custom avatars set it makes your forum look alot better as your user has shown some sort of commitment to it. Using this small template hack it will encourage your users to set an avatar and if they haven't give a nice alternative.

Also, its worth noting that the link to set a new avatar will only be shown to the user, not everyone using the forum.

Firstly, I will show you the one with the default avatar included. Then another version without it.

Ok, so open up the style manager and open the postbit for what ever style you are using. Then where you want your avatar to display paste this code:

HTML Code:
<if condition="$bbuserinfo[showavatars]">
<img src="DefaultAvatarURL" alt="" border="0" />
<br />
<if condition="$bbuserinfo['userid'] == $post[userid]">
<a href="profile.php?$session[sessionurl]do=editavatar">Set Avatar</a>
</if>
Remember to change this src="DefaultAvatarURL" to whatever your image URL is.

So, this will show the default avatar and a link below it to set their own custom avatar.

This version will not show the default avatar, just the link to set one. Do the same as the first step just paste in this code instead.

HTML Code:
<if condition="$bbuserinfo[showavatars]">
<if condition="$bbuserinfo['userid'] == $post[userid]">
<a href="profile.php?$session[sessionurl]do=editavatar">Set Avatar</a>
</if>

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-03-2009, 05:38 PM
1Unreal 1Unreal is offline
 
Join Date: Jul 2008
Location: London
Posts: 372
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I updated it. Try the code again.
Reply With Quote
  #13  
Old 03-03-2009, 06:34 PM
macc's Avatar
macc macc is offline
 
Join Date: Feb 2008
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello!

used this code and get image (defaul avatar) to work ... what to do now to get your text - select avatar - to work ?

PHP Code:
<!-- user info -->
  <
table cellpadding="0" cellspacing="$stylevar[cellpadding]border="0" width="100%">
  <
tr>
   <if 
condition="$show['avatar']">
 <
td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]$post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td>
<else />
<if 
condition="$bbuserinfo[showavatars]">
 <
td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$stylevar[imgdir_misc]/blue.gif" $post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td>
</if>
</if> 
you can see here - http://libar-libar.com/libar/vb/show...=3377#post3377

regards

macc

edit: fixed - now works fine!

maccc
Reply With Quote
  #14  
Old 03-04-2009, 06:41 AM
TriAxis TriAxis is offline
 
Join Date: Dec 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your code listed at the top of this tread did not work for me.

I finally got it to work by using the code that was in one of the reply boxes.

I had to do a bit of editing because it kept showing 2 avatars for all the users that had already picked their avatar. And I was confused in all the extra code about where to put the default image, but I figured it out. As well as making sure clicking the avatar took you to the change avatar area and not to their profile default area.

The bottom line is I did get it to work and I marked installed.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:51 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03720 seconds
  • Memory Usage 2,245KB
  • Queries Executed 18 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete