Topic: Avatars

I know PunBB is aiming to have a perfect XHTML and I noticed a little something today.

It's not a very big problem, but when a use has an avatar and the avatar is showing, it dosn't have an alternate text. (alt="")

$username = pun_htmlspecialchars($pun_user['username']);
if (substr($username,-1,1)=='s')
    $username .= "'";
else
    $username .= "'s";
echo '<img src="avatar1.gif" style="width: 100%; height: 100%" alt="'.$username.' avatars" />';

The script simply ads a "'" if the names ends with a "s" or a adds "'s" if the name dosn't end with an "s".
For example:
ultime: ultime's
Rats: Rats'

As I said, it's nothing big, but it's one step closer of having a perfect XHTML score..

Thanks for reading,
Pete

2 (edited by coaster 2005-07-06 12:09)

Re: Avatars

No, having no "alt" text is absolutely fine in this case from both XHTML standard's and semantic Web's side.
I think I've read a page in the past which explained this topic very well, but I don't remember it any more. hmm

3

Re: Avatars

In version 1.3 it just says alt="Avatar" which is sufficient since it obviously belongs to the person who authored that particular reply. In reality it isn't necessary as avatars are merely decorative and you don't need meaningful alt attributes for decoration only content. I was even thinking of including them as a background image to the <dd> tag and dispensing with the <img> tag alltogether.

I'm moving this as it isn't really a bug report.

Re: Avatars

coaster wrote:

No, having no "alt" text is absolutely fine in this case from both XHTML standard's and semantic Web's side.
I think I've read a page in the past which explained this topic very well, but I don't remember it any more. hmm

actually alt is not optional it is required for img tags

http://www.w3schools.com/tags/tag_img.asp

5

Re: Avatars

connor: alt is not optional but it can be empty.

Re: Avatars

@Connorhd: Ty, I was 99.9% sure it needed an alt tag smile now I'm 100% sure.
@Paul: You are right, I looked up avatar properties on firefox and it said "blank" I thought it meant there was no alternate text.. I looked in viewtopic.php and there really is an alt="". My bad..

Re: Avatars

also, remember 'ownership' is different in different languages ... so that if-statement will look different in other languages ...

Re: Avatars

Paul wrote:

connor: alt is not optional but it can be empty.

aha i didn't see that it was set as empty at the moment, i was just argueing with coaster lol