Ticket #6802 (closed enhancement: fixed)

Opened 2 months ago

Last modified 1 month ago

Add Gravatar's Identicon, MonsterID, and Wavatar support

Reported by: Viper007Bond Assigned to: anonymous
Priority: normal Milestone: 2.6
Component: General Version: 2.5
Severity: normal Keywords: has-patch needs-testing 2nd-opinion
Cc:

Description

http://blog.gravatar.com/2008/04/22/identicons-monsterids-and-wavatars-oh-my/

We should support this parameter via the options page.

Attachments

6802.patch (8.6 kB) - added by Viper007Bond on 04/25/08 11:33:23.
6802.png (38.7 kB) - added by Viper007Bond on 04/25/08 11:39:46.
Screenshot of the patched options page
6802.2.patch (8.6 kB) - added by Viper007Bond on 04/25/08 11:49:22.
Use the current user's e-mail address for fun to display the example avatars
discussion_options_action_hook.diff (4.8 kB) - added by filosofo on 04/25/08 12:44:05.
fix_forcedefault.patch (0.7 kB) - added by ionfish on 05/04/08 21:39:04.

Change History

04/24/08 17:18:46 changed by Otto42

+1, however I'd like to make it more generic than that.

There should be a textbox to specify the default gravatar parameter. It could either take a URL for a default, or take the 'identicon' string and such.

Perhaps some js selection to fill in that blank properly with the various gravatar built-in options or something.

Note that get_avatar($comment,80,'identicon') in the theme currently works perfectly.

04/25/08 11:33:23 changed by Viper007Bond

  • attachment 6802.patch added.

04/25/08 11:34:03 changed by Viper007Bond

Great minds think alike. I coded up a patch and then saw your comment, Otto, heh.

Anyway, take a look at my patch and let me know what you guys think. :)

04/25/08 11:39:46 changed by Viper007Bond

  • attachment 6802.png added.

Screenshot of the patched options page

04/25/08 11:49:22 changed by Viper007Bond

  • attachment 6802.2.patch added.

Use the current user's e-mail address for fun to display the example avatars

04/25/08 11:59:50 changed by Viper007Bond

  • keywords changed from needs-patch to has-patch needs-testing 2nd-opinion.

04/25/08 12:43:51 changed by filosofo

I wish we would go the other way and remove the existing radio buttons. Gravatars are particular to a theme: if a theme designer hasn't made use of the function call, then the radio buttons do nothing. I don't think there is another core admin option quite so dependent on a particular theme's design.

Instead, I've attached a patch for an action hook on that settings page that would allow themes or plugins to add in an indefinite variety of geegaws.

04/25/08 12:44:05 changed by filosofo

  • attachment discussion_options_action_hook.diff added.

04/26/08 01:29:00 changed by Viper007Bond

Sorry, but I don't like your patch. Besides making it rather complex for a novice user to add Gravatars to their existing theme (right now, all you have to do is drop in the function), there is Gravatar support in the admin area. Those options need to be there.

I'm not saying my solution is the best out there (although it's the best I could come up with), but it's easy for the end user.

A simple "these options will do nothing if your theme lacks avatar support" message would get the job done IMO.

05/03/08 00:56:18 changed by ryan

(In [7879]) Default avatar selector. Props Viper007Bond. see #6802

05/03/08 00:58:51 changed by ryan

I hacked the patch a bit to move as much of the logic as I could into get_avatar() and to make everything filterable. I also removed custom avatars for now. Let's bring it back as an upload box.

05/03/08 01:06:00 changed by Viper007Bond

Sounds good to me and nice trick with preg_replace(). That didn't even occur to me to add forceddefault via that. :D

05/04/08 18:05:21 changed by ryan

(In [7886]) Add blank to default avatars. Rename default to Mystery Man. see #6802

05/04/08 21:38:45 changed by ionfish

The forcedefault argument isn't being appended to the URL because it's looking for the wrong kind of quotes, so if the user has a Gravatar they won't be able to see the options properly, just their own avatar repeated several times. Patch to fix this is attached.

05/04/08 21:39:04 changed by ionfish

  • attachment fix_forcedefault.patch added.

05/23/08 01:05:03 changed by Viper007Bond

  • status changed from new to closed.
  • resolution set to fixed.

05/23/08 01:05:26 changed by Viper007Bond

ionfish: the <img> tag uses single quotes, so you patch isn't needed.

05/23/08 02:00:49 changed by Viper007Bond

Post explaining how theme developers can add new default avatars to the options page:

http://www.viper007bond.com/archives/2008/05/22/adding-new-default-gravatars-to-wordpress-26/