Can avatars be added to trackbacks? Currently, the only way trackbacks can display avatars is if a template uses the $trackback.avatar.
Another request: currently, if the plugin does not specify a default image, and none is found, the <img> code is still emitted and alt text is displayed because no image is found. Any chance of simply displaying nothing if no avatar is found?
Avatar plugin - suggestions
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
-
blog.brockha.us
- Regular
- Posts: 695
- Joined: Tue Jul 03, 2007 3:34 am
- Location: Berlin, Germany
- Contact:
Re: Avatar plugin - suggestions
At the moment I'm not sure, what results in this. I don't make any difference between comments and trackbacks in the avatar plugin. The Avatar *should* be added, but seems to be overridden later.Don Chambers wrote:Can avatars be added to trackbacks? Currently, the only way trackbacks can display avatars is if a template uses the $trackback.avatar.
I looked into the core code, but didn't find any problem relating this yet.. Have to look deeper, I guess..
Well, the problem here is: At the time the avatar plugin adds the image tag, it doesn't know, if the commenter will get an avatar (or to be more specific: I don't know if he doesn't get an avatar). This is evaluated while loading the src of the img tag.Don Chambers wrote:Another request: currently, if the plugin does not specify a default image, and none is found, the <img> code is still emitted and alt text is displayed because no image is found. Any chance of simply displaying nothing if no avatar is found?
This is done in order to have avatar evaluation in the background, so gravtar and all these services don't block your blog for each avatar.
-
blog.brockha.us
- Regular
- Posts: 695
- Joined: Tue Jul 03, 2007 3:34 am
- Location: Berlin, Germany
- Contact:
Re: Avatar plugin - suggestions
Found it. It is the template itself , that strips the avatars from trackbacks:blog.brockha.us wrote:The Avatar *should* be added, but seems to be overridden later.
comments.tpl:
{$comment.body}
trackbacks.tpl
{$trackback.body|@strip_tags|@escape:all}
In the trackbacks.tpl all tags are stripped from the trackback body.. The avatar plugin uses a tag, if not added using smarty. If you change the trackbacks.tpl to
{$trackback.body}
the avatar is shown without smarty option, too.
P.S.: Looking into the core code the @strip_tags directive is useless there, because s9y already stripped all tags found in the original trackback before handing it to the smarty template. Only plugins may add tags in between loading and smartifying.
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Avatar plugin - suggestions
No wonder I was not seeing anything in the plugin code! DOH!blog.brockha.us wrote: Found it. It is the template itself , that strips the avatars from trackbacks:
It makes sense that striping tags from trackbacks should not be required by the template - we certainly are not stripping comment body. I only had a moment to check... it appears to be emitting the <img> tag now, but my localhost sandbox pavatar is not being displayed.. not sure if it is a localhost only issue, and will not have time to check a live site until later tonight, or perhaps tomorrow... but I will assume it works. Thanks for looking into this!
=Don=