Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

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
  #2  
Old 03-03-2009, 02:30 PM
DobieGillis? DobieGillis? is offline
 
Join Date: Feb 2009
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice. What hack do you have that displays the activity. longevity under the AV? I like that, too
Reply With Quote
  #3  
Old 03-03-2009, 03:06 PM
1Unreal 1Unreal is offline
 
Join Date: Jul 2008
Location: London
Posts: 372
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=177366" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=177366</a>

Its for vB 3.7 but its working fine on 3.8.
Reply With Quote
  #4  
Old 03-03-2009, 03:12 PM
DobieGillis? DobieGillis? is offline
 
Join Date: Feb 2009
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 1Unreal View Post
https://vborg.vbsupport.ru/showthread.php?t=177366

Its for vB 3.7 but its working fine on 3.8.
thanks!
Reply With Quote
  #5  
Old 03-03-2009, 04:11 PM
macc's Avatar
macc macc is offline
 
Join Date: Feb 2008
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello!

i have like this in my postbit template
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></if>
   <
td nowrap="nowrap">
    <
div id="postmenu_$post[postid]">
     <if 
condition="$show['profile']">
     <
class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
     
$post[onlinestatus]
     <
script type="text/javascript"vbmenu_register("postmenu_$post[postid]"true); </script
where to put your code (this one with image)?
i will have this image like is when users-members put own avatars.(their own after select will change default no-avatar image)
regards

macc
Reply With Quote
  #6  
Old 03-03-2009, 04:13 PM
1Unreal 1Unreal is offline
 
Join Date: Jul 2008
Location: London
Posts: 372
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:

HTML Code:
<!-- user info -->
  <table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
  <tr>
   <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>
</if>
   <td nowrap="nowrap">
    <div id="postmenu_$post[postid]">
     <if condition="$show['profile']">
     <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
     $post[onlinestatus]
     <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
Reply With Quote
  #7  
Old 03-03-2009, 04:17 PM
macc's Avatar
macc macc is offline
 
Join Date: Feb 2008
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

every avatar is clickable ..and after clik go to userprofile - shoud i will lose this function ?


regards

macc
Reply With Quote
  #8  
Old 03-03-2009, 04:55 PM
1Unreal 1Unreal is offline
 
Join Date: Jul 2008
Location: London
Posts: 372
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by macc View Post
every avatar is clickable ..and after clik go to userprofile - shoud i will lose this function ?


regards

macc
Firstly the link is only visible to the user without an avatar so that's not an issue. Secondly there's a text link and it's not the avatar you click.
Reply With Quote
  #9  
Old 03-03-2009, 05:18 PM
macc's Avatar
macc macc is offline
 
Join Date: Feb 2008
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tried your code (few posts above) and get this error message

PHP Code:
The conditional on line 38 appears to be missing its end tag (</if>). The template will not function properly unless this is fixed
some help ?

regards

macc
Reply With Quote
  #10  
Old 03-03-2009, 05:25 PM
macc's Avatar
macc macc is offline
 
Join Date: Feb 2008
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

your code works not - put </if> tag and could not see text and picture is on top-left - see here - http://libar-libar.com/libar/vb/show...=3377#post3377


will that be like default avatars pictures to all members like original - and that code change all members avatars ...???
regards

macc
Reply With Quote
Reply


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 01:09 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.04270 seconds
  • Memory Usage 2,315KB
  • Queries Executed 23 (?)
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
  • (3)bbcode_html
  • (2)bbcode_php
  • (2)bbcode_quote
  • (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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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