View Full Version : Show "No Avatar" Image If No Avatar is Selected
MW[MWGN]
03-19-2002, 10:00 PM
]What is it?
If the user has selected to not use avatar, then in the threads where the avatar will normally appear, instead of being blank because there is no avatar chosen, it will display a "No Avatar" image instead.
Credits
I would like to thank trilOByte, the creator of the Welcome Panel hack, for the "No Avatar" image, because there's where I stole...err...taken it from :)
Future Plans
Add an option to turn it on/off in the Admin CP.
Screenshot of the hack....
And the installation is in the next post
MW[MWGN]
03-20-2002, 08:50 PM
Installation file is here... with the "No Avatar" image
Edit: OK, I've added the other modifications to the installation file just incase the hack doesn't quite work for some. I've tested this on my 2.2.6 and it works fine.
Errr... nothing agaist you but why would you post someone elses code, that is already posted?
MW[MWGN]
03-20-2002, 09:00 PM
is it? oops..sorry
wooolF[RM]
03-20-2002, 09:12 PM
]lol :D
I mean the Welcome Panel hack
Recluse
03-21-2002, 07:18 AM
thanks dident work on mine :( surly i dident mess something this simple up
fonzerelli_79
03-21-2002, 07:37 AM
as far as i can remember, the welcome hack only adds the no avatar image on the foum hom page
MW[MWGN] hack (well i line changed) changes it in the posts and threads, yes they are very similar but not the same
anyhoo, cheers MW[MWGN]
MW[MWGN]
03-21-2002, 11:09 AM
Yes, the welcome panel hack has the changed line in INDEX.PHP, while mine changes in functions.php to apply to posts and threads.
Recluse, what version are you running? And how does it not work..i.e. any errors?
69-FLy-gUy
03-24-2002, 04:48 PM
does'nt work here either
MW[MWGN]
03-25-2002, 12:05 PM
version you running? Can you explain more HOW it doesnt work?
69-FLy-gUy
03-25-2002, 04:30 PM
easy. in the thread it doesn't show the No avatar selected image... want to see my funtions.php?
running 2.2.4
MW[MWGN]
03-26-2002, 11:02 PM
]I think if the user dont have the ability to use a custom avatar, then the hack doesnt work...I'm working on a fix.
Edit: OK, at the moment I cant test the fix because my board's domain is switching DNS to point to the new server, so please give me a day or two and I'll post the update here :)
MW[MWGN]
03-27-2002, 09:30 PM
]OK, try this for those who cant get the hack working.
Find in /admin/functions.php:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
Replace with:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="<img src=images/avatars/noavatar.gif border=0>";
I dont see why I can get it working with the code in the readme file but some can't... but try the above as well as the one in the readme and report if it works...thanks
ZiRu$
03-27-2002, 10:01 PM
The original hack worked perfectly on 2.2.4
i didnt need to use your code MW[MWGN]!
Can someone please give me an update so the noavatar image under our name will be linked to the editavatar url?
please?
MW[MWGN]
03-27-2002, 11:26 PM
yea but for some strange reasons some it doesnt work for some...
69-FLy-gUy
03-28-2002, 06:52 AM
Weird. still won't work for me. i will see if it still isn't working in a dayt and let you know. thakns for trying though=)
Recluse
03-28-2002, 07:22 AM
Originally posted by MW[MWGN]
Yes, the welcome panel hack has the changed line in INDEX.PHP, while mine changes in functions.php to apply to posts and threads.
Recluse, what version are you running? And how does it not work..i.e. any errors?
2.2.2 heavly hacked, but all the code was there as in the txt file. no errors. just dont show
MW[MWGN]
03-28-2002, 03:19 PM
]have you got avatar enabled? :) and do you allow custom avatars?
Recluse
03-28-2002, 03:37 PM
yes and yes :) i tired you fix to functions.php and it dont do anything either :(
MW[MWGN]
03-28-2002, 10:03 PM
]Try this
Find in /admin/functions.php:
return '';
Replace with:
return "images/avatars/noavatar.gif";
ZiRu$
03-29-2002, 01:25 AM
how do i link it so they can edit there avatar?
69-FLy-gUy
03-29-2002, 08:01 AM
Still didn't work:(
MW[MWGN]
03-29-2002, 11:03 AM
Oh well I have no idea on how to get it to work with those who can't... On my forums they are fine, whether it's someone who has the ability to use custom avatars or not.
Hot Dogg: You need to get FireFly's avatar thingy hack and use it as a reference... I am a newbie hacker and at the moment I'm too busy sorting all the problems on my server...
Raptor
03-29-2002, 07:17 PM
worked straight away for me no problems
vb 2.2.4
i have no clue how some peeps cannot get it to work - its very very simple
Gholsie
06-09-2002, 11:19 PM
Guys, the original instructions in the ZIP file are wrong. I followed MW[MWGN]'s instructions and it finally worked for me. I followed both of these steps:
Find:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
Replace with:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="<img src=images/avatars/noavatar.gif border=0>";
And the second step:
Find:
return '';
Replace with:
return "images/avatars/noavatar.gif";
The first step alone didn't work. But, after I performed the second step, it worked great. So, I'm not sure which one did it for me. I'm not going to f' with it.
Boofo
06-10-2002, 12:28 AM
Try this. It works here.
<a href="member.php?s=$session[sessionhash]&action=editavatar"><img src="https://vborg.vbsupport.ru/images/noavatar.jpg">
or whatever the name of your image file is. Let me know if that works for you. :)
Originally posted by Hot Dogg
how do i link it so they can edit there avatar?
Grealm
06-10-2002, 03:16 AM
works perfect to me.. im using 2.2.6
thanks MW.. ive been looking for this hack.. finally found one :)
MW[MWGN]
06-10-2002, 02:53 PM
]Actually the original instructions (now I've updated with the other instructions as well :)) aren't wrong, because I just use that in my 2.2.6 and it works, however on some others (dont know why) other changes are needed in functions.php...well..don't look at me, I know about vB hacking as much as my dog does :)
Prophet2002
07-10-2002, 03:47 AM
it worked on my pratice board, but not on the real thing.. with either version of the code, go figure
Heineken77
07-19-2002, 06:26 PM
nice! hopefully this will make people start choosing avs :)
thanks buddy!
LOD-squa
08-18-2002, 01:07 AM
is there a way I can set the guest image when guestpost?
I was really looking forward to using this, but it is not compatible with my avatars in categories/avatar taken hacks. I hope it will be at some time. Great hack though.
Boofo
08-23-2002, 05:25 AM
What is it doing or not doing? I'm sure there is a way to get it to work with it. :)
Originally posted by Diva
I was really looking forward to using this, but it is not compatible with my avatars in categories/avatar taken hacks. I hope it will be at some time. Great hack though.
My avatars cannot be selected anymore from the user cp. I have to go into the Admin control panel to choose them. :/
g-force2k2
08-23-2002, 06:35 AM
Diva :: try this coding
open admin/functions.php
find:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
and replace it with this:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="<img src=\"/forum/images/avatars/No Avatar.gif\" border=\"0\">";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
Then create a new directory in the forum/images folder and call it avatar.
Then upload your No Avatar Img... save it as No Avatar.gif
hope that helps :) regards...
g-force2k2
Is this instead of another code change or ontop of one for this hack? Or is this a code update? Sorry so blonde... :/
KrisP
09-07-2002, 12:41 PM
Really cool. Been looking for that.
Great!
/me clicks install...
- KrisP (Poof! Installed...)
PHiXTiT
09-13-2002, 12:51 AM
Simple...
5 Stars.
Mathieu
10-24-2002, 11:53 AM
thanks for this i'll install it now.
Glenn379
10-26-2002, 05:31 AM
simple but effective *installs*
deFunx
11-08-2002, 07:37 PM
Err, well it works on my 2.2.8 version.
andyrose
02-16-2003, 05:19 AM
Worked perfectly at www.neomega.net/forum, I actually altered the image to encourage the user to change the avatar perhaps a bit more. Thanks a lot for putting the time into coding it. :)
kevinnguyen
03-22-2003, 09:47 PM
work great w/ 2.3.0
PixelFx
06-06-2003, 08:28 AM
I remember this old hack :P just tested it, works great with vb2.30 :P
Michael
08-25-2003, 01:59 AM
Ok, I have version 2.3.2 and after I did this it said:
Parse error: parse error in /home/mikelevy/public_html/forums/admin/functions.php on line 945
Fatal error: Call to undefined function: vbdate() in /home/mikelevy/public_html/forums/admin/sessions.php on line 400
-- And I followed all the directions as followed and I even edited the parts that were mentioned in this thread. And I found everything perfectly, so WHAT DO I DO???
PixelFx
10-06-2003, 10:13 AM
I was working on my site, I thought I'd post an updated version of this hack for vb2.3.2
Intro:
Think of this as a remix of MW[MWGN] no avatar script, only I had to change things to make it work with vb2.3.2 and I made new art.
Credits:
Vincent "MW" Chan - Show "No Avatar" Image If No Avatar is Selected
trilOByte - welcome panel final, please note I didn't use his code in this hack, but it can be used with the welcome panel hack.
WORKS WITH: vBulletin v2.3.2
As always before you install anything BACK UP YOUR DATABASE!, :) aka use this hack at your own risk. This is tested on my site and works well :)
Files to Edit: 1 forum/admin/functions.php
1) FIND:
$avatarurl="";
REPLACE WITH:
$avatarurl="{imagesfolder}/avatars/noavatar.gif";
NEXT FIND:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
REPLACE IT WITH:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="{imagesfolder}/avatars/noavatar.gif";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
NEXT FIND:
return '';
Note: '' is ' ' not "
CHANGE IT TO:
return "{imagesfolder}/avatars/noavatar.gif";
Save, and Upload:
NEXT:
Goto your admin CP: Replacements, Modify, [expand list], then find: {imagesfolder}
Click Edit and change contents of replacement to your sites FULL URL + /images
example: http://www.domain.com/forum/images
Note: no end slash.
save...
NEXT GOTO:
Admin Cp: Options, [Avatars]
FIND: Maximum Dimensions
Maximum width and height (in pixels) that the custom avatar image can be.
Change the number from 50 to 64 goto the button and click save changes.
FTP to your Website: make dirdctory called "avatars" in the following location
example: forum/images/avatars/
Then upload the new art images I made for hack.
PS: I've created a GuestAvatar Image, that matches my noavatar image, for those that use the welcome panel final hack by trilOByte | below :)
If you used this hack, please click install here, and on Vincent "MW" Chan No avatar hack :)
Comments and or suggestions about this hack in this thread for this hack here only please.
DEMO: http://www.pixelfx.ca/forum/index.php
PS: please let me know if I missed anyone for credits... enjoy the new avatars below :)
PixelFx
10-06-2003, 10:23 AM
screenshot to follow...
Logician
10-06-2003, 01:48 PM
Please post such modifications and tweakings in the original hack thread.. Merged..
PixelFx
10-06-2003, 10:07 PM
doh, sorry, thought enough had changed as it was a complete rewrite.. not wanting to step on toes... enjoy anyway :)
Red Blaze
10-07-2003, 03:25 PM
Very Nice, I plan to make my own guest/noav. selected Avatar images though. ^^;
integra99
10-19-2003, 02:50 PM
Can someone compile the hack for 2.3.2 into a text file? I'm not really good at this stuff, and just want to make sure I get it right and don't leave something out. THanks
350Chevy
03-22-2004, 07:48 AM
I've been using the old hack for over a year and have upgraded to 2.3.4 now and it still works. Dunno why the rewrite.. :D
Ryan McBain
04-16-2004, 08:23 AM
Can you do this for vb3?
CFF Staff
09-16-2004, 01:59 AM
Helo
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.