I've cobbled together a somewhat functioning in-chat avatar system for my chat site.
What it does is takes the user's uploaded profile picture [or rather its name based on the username] and places it inside image tags at the beginning of the text.html file. [as well as a few other speaking files]
Here's how I have it set up:
which is both simple and "dumb"
The pros:
The user picture is displayed in chat, making the chat more attractive and fun.
Avatar size can be easily restricted, etc.
Browsers will automatically fill in the file extension.
The cons:
In IE there is an image placeholder for those who have no avatar.
Doesn't use the $image string. [if you do, it just shows the viewer's profile pic for all users]
Can't do an IF/ELSE for those who have not uploaded avatars/guests, it ends up showing nothing but that image for the viewer without a profile picture for ALL users. [since the IF is for the current user not the others.]
Can someone point me in the direction of how to make this a much more elegant solution? I'm hell-bent on having in-chat avatars. If I can't do an IF/ELSE for a no-avatar, how can I get rid of the placeholder for IE users?
What it does is takes the user's uploaded profile picture [or rather its name based on the username] and places it inside image tags at the beginning of the text.html file. [as well as a few other speaking files]
Here's how I have it set up:
which is both simple and "dumb"
The pros:
The user picture is displayed in chat, making the chat more attractive and fun.
Avatar size can be easily restricted, etc.
Browsers will automatically fill in the file extension.
The cons:
In IE there is an image placeholder for those who have no avatar.
Doesn't use the $image string. [if you do, it just shows the viewer's profile pic for all users]
Can't do an IF/ELSE for those who have not uploaded avatars/guests, it ends up showing nothing but that image for the viewer without a profile picture for ALL users. [since the IF is for the current user not the others.]
Can someone point me in the direction of how to make this a much more elegant solution? I'm hell-bent on having in-chat avatars. If I can't do an IF/ELSE for a no-avatar, how can I get rid of the placeholder for IE users?