vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Forum Display Enhancements - If User Hasn't Got An Avatar Show Default Avatar With Link To Set One (https://vborg.vbsupport.ru/showthread.php?t=207224)

1Unreal 03-02-2009 10:00 PM

If User Hasn't Got An Avatar Show Default Avatar With Link To Set One
 

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>


DobieGillis? 03-03-2009 02:30 PM

nice. What hack do you have that displays the activity. longevity under the AV? I like that, too

1Unreal 03-03-2009 03:06 PM

<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.

DobieGillis? 03-03-2009 03:12 PM

Quote:

Originally Posted by 1Unreal (Post 1759347)
https://vborg.vbsupport.ru/showthread.php?t=177366

Its for vB 3.7 but its working fine on 3.8.

thanks!

macc 03-03-2009 04:11 PM

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

1Unreal 03-03-2009 04:13 PM

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>


macc 03-03-2009 04:17 PM

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


regards

macc

1Unreal 03-03-2009 04:55 PM

Quote:

Originally Posted by macc (Post 1759404)
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.

macc 03-03-2009 05:18 PM

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

macc 03-03-2009 05:25 PM

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


All times are GMT. The time now is 09:18 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01107 seconds
  • Memory Usage 1,757KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_html_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete