User Profile or gravatar plugin?

Creating and modifying plugins.
Post Reply
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

User Profile or gravatar plugin?

Post by Don Chambers »

Just installed the user profile plugin. What I mostly want is an author photo. Is this plugin supposed to insert an author image into the entries, comments or both? I have an image of /img/myusername.gif (note: username, not "real name"). I configured the plugin:

File extension: gif
Show user picture within entry: yes
Use gravatar: no (have also tried yes)
gravatar pic size: 80
location of default gravatar: img/gravatar.gif
maximum gravatar rating: r
show comment count: no.

So where is the image supposed to be? It shows neither in entries, nor comments. This is a sandbox install I am trying it on, so I cannot provide a live example. It does not work with my username.gif image, nor if I say "yes" for gravatar.

Now, back to the desire primarily for a photo... what is the real difference, if fetching a gravatar image, between the user profile, and avatar plugin?
=Don=
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

As long as I am on the subject - regardless of which of these plugins ultimately best meets my needs, what I need to do is be able to exactly place the output into comments.tpl with a smarty variable, not just stamped into the beginning of $comment.body. Is this already possible, or if not, can it be easily implemented in both plugins? Perhaps an option like the user profile already has for inserting comment count (ie, manual via tpl). This may take a bit of thought with respect to the recent comments plugin since it is not currently smartified.....
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: User Profile or gravatar plugin?

Post by garvinhicking »

Hi!

I believe the picture needs to be named after the realname. s9y should never display the actual username to the outside.

I'm not sure how Grischa modified the gravatar-plugin, but I think only the userprofiles plugin offers to show custom userpictures, the gravatar plugin only for remote site like gravatar.com.

If you only have lokal images, you can already work with getTemplateFile an an img.src in your comments.tpl?

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

I have not yet decided if I want a local image or a gravatar..... but one key component may be the ability to show the image in an entry AND comment.

Regarding the User Profile Plugin:
I was finally able to get the DEFAULT gravatar image/logo (not MY gravatar) to display by creating a new entry. Not sure why it is not fetching my actual gravatar. I also have the gravatar plugin installed, and it IS fetching the correct gravatar. Also - the user profile plugin is showing my LOGIN username below the gravatar - not my real name!

But it only inserted for a newly created entry. It did not insert images into my existing entries. It does not insert an image into my comments, including newly created ones (maybe it is not supposed to?). What is confusing about this is that it DOES insert comment counts into my comments, including previously created comments.

I then said "no" to gravatar, and created another new entry. This time, the image used was my local image of my_real_name.gif. Once again, it displayed my LOGIN name below. I opened the entry, re-saved it, and it then displayed my REAL name below the image!!! This change from using a gravatar to using a local image did NOT affect my first entry with the gravatar - it is still trying (but failing) to fetch the gravatar.

With respect to the user profile plugin, I see the following problems or opportunities for improvement:

1) gravatar is not loading - only the gravatar logo. Not sure if this is a problem with the gravatar server, or the plugin. The gravatar logo does not appear to be contained within the plugin folder, and the gravatar plugin is fetching it, so not sure what is stopping the user profile plugin from fetching it.

2) Once enabled, the plugin should display the image in all entries, not just newly created ones. This is how the gravatar plugin works with respect to comments.

3) Is the plugin supposed to be inserting the image into comments? If not, it would be nice. If it IS supposed to be doing it now, it does not work.

4) Just like the comment count is smartified, it would be great if the <img> output of the plugin could also be inserted exactly where desired, and not just at the beginning of $comment.body.

5) suggest text-align: center be added to inline stylesheet for .serendipity_authorpic


Regarding the gravatar plugin, I would only request 2 things:

1) same as point 4 above - smartify so it can be inserted exactly where desired.

2) work entries too, not just comments.
=Don=
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Post by blog.brockha.us »

First: I don't know the "user profile plugin" so I can't say anything about this.

Speaking about the avatar plugin: This one was build to add commentors images to comments. To do this, it has to use external services to match the user email and/or homepage to images, as the commentors are unknown before and so there can't be some local image files representing commentors.

It was not meant to add images to entries representing the author.

But: Of course this is possible, too. S9Y allows to configure at least email addresses for authors, so it is possible to fetch pictures using services using emails (like Gravatar). Or a new option for authors could be added in order to let the Avatar plugin fetch locally saved imagefiles like <autor>.gif or something. But I think, this change might be a big one, I have to look into the code and think about it. And: I am not sure, if the Avatar Plugin should do this, as the user profile plugin is the right place to configure author pictures, I guess.

With the smarty changes: I'm not sure, how to do this. To change this, I need a hint from Garvin (or any other smarty guru), how I add new variables to the smarty hash. But I think, this change shouldn't be that hard to do.

P.S.: The avatar plugin also feeds the comments sidebar plugin. I don't know if this supports smarty tags at all and the avatar plugin can't decide if the comment is displayed as normal comment or inside the sidebar plugin. This is a problem I think, as the sidebar plugin has to be changed, too, if I add an smarty option to the avatar plugin, I think.
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks Grischa..... Perhaps we can let Garvin deal with my comments on the user profile plugin, and keep you centered on the gravatar plugin.

For the gravatars/externally hosted avatars, I am not concerned about a local image..... using the services is fine, and perhaps, preferable since users have to deal with the maintenance of it themselves that way! :D

The user profile plugin has a function that may be valuable for the gravatar plugin... it has the ability to show the number of author comments within each comment (which is not what I am after), but more importantly, the ability to NOT show it, and instead make if available via the smarty variable {$comment.plugin_commentcount} and styling it via the serendipity_commentcount CSS class. This is exactly the functionality I think would be valuable in the gravatar plugin..... install the plugin, but have it output nothing if configured that way, instead making a smarty variable available for the entire generated <img blah blah>.

This might require a bit of additional thought since gravatars are also shown in the recent comments plugin, which - at the moment - are not smartified.

The next possible functionality would be much as you described - the ability to show this within entry body based on the entry author email address. That is what the user profile plugin supposedly does, but I am having difficulty with it.

Right now, smartifying the output of the gravatar would be a great first step.
=Don=
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Post by blog.brockha.us »

Ready.. I "smartyfied" the avatar plugin. Now it has a new option "Produce avatar smarty tag" defaulting to false. If switched on, you can use the smartytag comment.avatar.

And I was able to detect the call from the sidebar plugin. If detected, the smarty option will be switched off (only for the sidebar plugin call, normal comments will still produce only the smarty tag), no matter of the settings of the plugin.

Tested it at my testinstallation: Worked! :-)

I will send you the update, so you can test, if it matches your smarty needings, too.
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
Post Reply