View Full Version : Add-On Releases - Default avatar for users with no selected avatar
Just some help if you want to set the default avatar to users who did not select any avatar. It is for postbit, postbit_legacy and member list template.
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>
and put this below code before </if> - <else />
<if condition="$bbuserinfo[showavatars]">
<td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$stylevar[imgdir_misc]/noavatar.gif" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a><br /><a href="profile.php?$session[sessionurl]do=editavatar"><b>Set Avatar</b></a></td>
</if>
upload(copy) image noavatar.gif in "your template" /images/misc folder.
In your templete memberlist_resultbits find this:
<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>
and replace with this <img src="$stylevar[imgdir_misc]/noavatar.gif" border="0" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" />
For postbit_legacy find
<if condition="$show['avatar']">
<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>
</if>
and after </div> add this
<else />
<if condition="$bbuserinfo[showavatars]">
<div class="smallfont">
<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="your url link/noavatar.gif" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>
</if>
Change "your url link" to your link to picture (avatar)!
You can make your own pictures (avatar) for users who did not select any avatar!
Hope this will help someone!
Want to see this in action? - http://libar-libar.com
Regards,
macc
UKBusinessLive
03-06-2009, 03:56 PM
Great Idea :up:
acegames
03-06-2009, 04:30 PM
Nice , makes the site look neater , thanks
Great Idea :up:
Thanks! :rolleyes:
macc
Nice , makes the site look neater , thanks
Glad that you like it!
regards
macc
TimberFloorAu
03-06-2009, 06:42 PM
Thanks.
Your postbit legacy addition is missing a </if>
:)
TimberFloorAu
03-06-2009, 06:44 PM
*****
and its memberlist_resultsbit
Thanks.
Your postbit legacy addition is missing a </if>
:)
Thanks that you see - corrected the first post - code for postbit_legacy (added </if> )
Regards
macc
*****
and its memberlist_resultsbit
Thanks for suggestions but could not find that "</if>" is missing!
whole code in memberinfo - memberlist_resultsbit template should be like 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 /><img src="$stylevar[imgdir_misc]/noavatar.gif" border="0" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" /></if></td></if>
regards
macc
FFTFTCEd
03-11-2009, 05:38 PM
Got it working, but the install info up top is kinda hard to understand, (and put this below code before </if> -) I wasn't sure if I had to put before or below, it seems to say both & I had to delete one of those </if> at the end to get it to work, never did fine the right place for the template memberlist_resultbits because I don't know what and replace with this means, do you mean after ? if so, what text do I replace?
The last edit was fine.
Hello!
You should replace with this code (not after, not before - just instead )
<img src="$stylevar[imgdir_misc]/noavatar.gif" border="0" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" />
macc
FFTFTCEd
03-13-2009, 06:12 PM
Got it, thanks Macc.
Got it, thanks Macc.
you are welcome
macc
RiSqq
03-15-2009, 01:18 AM
Done as the instructions said and it's not working. The instruction really aren't easy to follow. Anyway anyone can make this a plug in?
wcguy
03-15-2009, 01:27 AM
I just got it to work, but this insruction...
<img src="your url link/noavatar.gif"
and the written instruction....
Change "your url link" to your link to picture (avatar)!
I had to modify.
to
<img src="./images/misc/noavatar.gif"
and like other posters above noted, in the first mod, removed the extra
</if>
PS and I'm not sure why but the postbit legacy search code didn't match. I had to hand find it.
RiSqq
03-15-2009, 01:53 AM
wcguy, to shorten it further use $stylevar[imgdir_misc]/noavatar.gif.
this is what the script should be as default. Maybe OP should update?
y2krazy
03-16-2009, 12:36 PM
How can I get the "Set Avatar" text to show up for just THAT user. With the code, as it is in the original post. Everyone will see "Set Avatar" under a user's avatar that isn't set. When they click on it, it will take them to edit their own avatar.
Thanks in advance!
~ Sean
Wyzrd
03-19-2009, 01:03 AM
I'm having a slight problem with this. I have it set for where members can choose whether or not they want the new horizontal postbit, or the old vertical postbit. When doing this, it will only work on the horizontal postbit. How can I get it to work for the old vertical postbit.
--------------------------------
EDIT: I figured out my problem. Thanks. for this great edition to vB.
Fastbird
03-19-2009, 03:42 AM
How can I get the "Set Avatar" text to show up for just THAT user. With the code, as it is in the original post. Everyone will see "Set Avatar" under a user's avatar that isn't set. When they click on it, it will take them to edit their own avatar.
Thanks in advance!
~ Sean
+1 I'd like to know this also!
Bowromir
03-19-2009, 07:33 PM
thanks! works great :)
newguy
03-23-2009, 02:21 PM
Just wondering if the instructions have been updated, since some posts suggested some changes?
jonah1892
03-23-2009, 02:59 PM
how would i go about doing this on the ipbroarcade avatars
newguy
03-23-2009, 04:27 PM
how would i go about doing this on the ipbroarcade avatars
Are you talking about the no avatar that shows in the arcade when that member does not have a avatar installed?
If so I just found the directory of the no avatar for the arcade and uploaded the one I wanted to show, and made it the same file name and over write the no avatar.gif
jonah1892
03-24-2009, 03:04 AM
thank you
Saviour
03-25-2009, 06:23 PM
I hate template edits...
Any way to package this as a product?
Saviour
03-25-2009, 07:05 PM
Just tried your manual install instructions...and it doesn't work...
I think you need to take a look at the coding so it's compatible with 3.8.1 PL1.
Also...this mod conflicts with [tk] Egg Avatar mod.
Installed...then Uninstalled.
Sorry...
i use myself vbulletin 3.8.1 PL1 and this code works fine !
never used [tk] Egg Avatar mod...
regards
macc
powerful_rogue
04-02-2009, 06:57 PM
Shame this dosent work with [tk] egg avatar :(
Magnumutz
04-05-2009, 12:48 AM
This is NOT an add-on, but a template modification.
y2krazy
04-06-2009, 03:33 PM
How can I get the "Set Avatar" text to show up for just THAT user. With the code, as it is in the original post. Everyone will see "Set Avatar" under a user's avatar that isn't set. When they click on it, it will take them to edit their own avatar.
Thanks in advance!
~ Sean
3 weeks and no help. Anyone have any ideas? :/
~ Sean
Alfa1
04-06-2009, 03:35 PM
Does this work on the blog / blog list as well?
pigpog
05-06-2009, 12:35 AM
I did the first two steps relatively easily, but when I put the postbit_legacy bit in, my threads got completely messed up (with bits here, bits there) and I immediately had to revert back to an old version of postbit_legacy. :(
I think this is a great idea so I'm not giving up on it now, and and I'm going to keep fiddling with the code until I either get it working or.... give up. :rolleyes:
ubcforums
06-16-2009, 11:19 AM
Thanks...works perfectly ;)
rrudeboy
06-17-2009, 01:51 AM
works great on version 3.8.2...
idoL1
06-18-2009, 11:08 PM
no avatars work on my site at all now....not the default or the people who had avatars before??? any idea?
no avatars work on my site at all now....not the default or the people who had avatars before??? any idea?
have no idea...maybe you make some wrong in your code!
regards
macc
theforumplace
06-20-2009, 01:49 AM
Very sloppy code and instructions.
Sean try removing this line from the edited postbit code.
It has not solved the issue but instead just removed the link which cleans it up.
<a href="profile.php?$session[sessionurl]do=editavatar"><b>Set Avatar</b></a></td>
</if>
Regards
Andy
xxxclubk1dxxx
06-23-2009, 06:56 AM
thank you once again! :)
TAIFUN_T
06-23-2009, 12:35 PM
after each update the forum again to edit the template? Hm...
I like https://vborg.vbsupport.ru/showthread.php?t=165563
after each update the forum again to edit the template? Hm...
I like https://vborg.vbsupport.ru/showthread.php?t=165563
after forum update you do not need make any changes in your templates for this modifications!
regards
macc
NLP-er
06-25-2009, 08:05 PM
How can I get the "Set Avatar" text to show up for just THAT user. With the code, as it is in the original post. Everyone will see "Set Avatar" under a user's avatar that isn't set. When they click on it, it will take them to edit their own avatar.
Thanks in advance!
~ Sean
Next one - also want to know :)
NLP-er
06-25-2009, 08:32 PM
How can I get the "Set Avatar" text to show up for just THAT user. With the code, as it is in the original post. Everyone will see "Set Avatar" under a user's avatar that isn't set. When they click on it, it will take them to edit their own avatar.
Thanks in advance!
~ Sean
Made it :D
Just put your Set Avatar link in this if
<if condition="$bbuserinfo[userid] == $post['userid']">
<br /><a href="profile.php?$session[sessionurl]do=editavatar"><b>Set Avatar</b></a>
<else />
<br/>No Avatar
</if>
Of course you can customize it - I set "No Avatar" to enyone else.
ShawneyJ
06-29-2009, 04:53 AM
whats with members now having 2 avatars lol?
Verionia
08-01-2009, 05:48 PM
Thanks soo much, worked! A+!
Saviour
08-03-2009, 03:34 AM
After removing [tk] Egg Avatar mod...this works great!
Installed and working fine on vB 3.8.3.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.