View Full Version : Avatar alt tags that actually work
SFishy
11-09-2001, 02:02 PM
Because I don't want there to be any confusion about what I'm looking for, and because I don't want to step on anyone's toes, I posting this in a new thread. I'm thinking it's a hack only because it doesn't work in VB "out of the box", but I've posted it over on vbulletin.com in the "how do I" area as well.
- - - - -
I am using avatars on my board, avatars provided by me, no custom avatars allowed. Each avatar has a title/name, just like post-icons do. Post icons show the alt= tag as the title/name. (example below)...
http://www.fishy.com/test/images/posticon.gif
...Avatars don't have this. How can I get it so that an avatar uses it's given title/name as it's alt= tag, just like post icons do?
In the postbit template I tried "alt=$avatar[title]" but that didn't work. Is there something I have to change in a .php file so it does work, the same way it does by default on Avatars Info Page (http://fishyvb.something-fishy.org/misc.php?s=&action=showavatars)?
Any help would be greatly appreciated.
Don't get your hopes up but maybe this will work?
Try :
title=$avatar[title]
SFishy
11-09-2001, 07:46 PM
try that where?
JJR512
11-09-2001, 08:12 PM
The postbit_avatar template. The default template is this:
<img src="$avatarurl" border="0" alt="">
Try this (based on what Matt said):
<img src="$avatarurl" border="0" alt="title=$avatar[title]">
JJR512
11-09-2001, 08:15 PM
BTW, that doesn't work. It only shows title= as the alt bit. But whatever the code is to display it, you want to stick it where I just showed you.
JJR512
11-09-2001, 08:18 PM
And the avatar is also displayed by the following templates, so you would need to make similar changes there, too:
modifyavatar_custom
modifyoptions
getinfo
SFishy
11-10-2001, 12:28 AM
And I said in my first post, "alt=$avatar[title]" doesn't work. I had tried that before even posting (in postbit template).
It DOES work in the modifyoptions template.
From what I can tell, the members profile stores the avatar id (avatarid), and in a post is told to display that id based on $avatarurl -- I do not how to get the $avatar[title] to relate to this information so that it will show up in the member's post and profile.
Any ideas coding gurus?
Thanks
<img src="$avatarurl" border="0" title="$avatar[title]">
Try that.
JJR512
11-10-2001, 07:31 PM
You already had us try $avatar[title].
Admin
11-11-2001, 11:50 AM
In showthread.php find this:
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
and replace it with this:
".iif($avatarenabled,",avatar.avatarpath,avatar.title AS avatartitle,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
Now you can use $post[avatartitle] in your postbit_avatar template.
SFishy
11-13-2001, 01:04 PM
Hey Firefly...
AWESOME... that worked perfect! THANKS! Was exactly what I needed!
:D
Admin
11-13-2001, 01:58 PM
Glad I could help. :)
SirLANcelot
11-17-2001, 03:18 PM
It works!! Great, absolutely!!! I love it!! :)
Thanks, FireFly!
- LANce
SFishy
11-23-2001, 03:21 PM
Another question ;)
How about if I want the same effect in the user's profile??
Thanks!
Aim
Scott MacVicar
11-23-2001, 08:55 PM
the one for the profile relies on a function called getavatarurl and all it does is get the avatarurl and return it so you would have to make the $avatarinfo a global variable in the getavatarurl function and then adjust the query within it to take the avatar title as well then you could use $avatarinfo[avatartitle]
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.