| Home | Forum | Advertise | Contact Me | About WPTavern | WPWeekly Show Info |
![]() |
| |||||||
| General WordPress Talk about news, share great posts and more |
![]() |
| | Share | LinkBack | Thread Tools | Display Modes |
| ||||
| Quote:
This plugin died when Gravatar changed something on their end. http://txfx.net/code/wordpress/gravatar-signup/ |
| ||||
| Quote:
This is a jQuery example that will tell you if an email address has a gravatar or not. Works across domains just fine. Code: // code to load jQuery here
// code to load jQuery md5 extension here (http://plugins.jquery.com/files/jquery.md5.js.txt)
var email = "fake@example.com";
var img = new Image();
$(img)
.load(function() {
alert('Yes, there is a gravatar there');
})
.error(function() {
alert('Nope, no gravatar there.');
})
.attr('src','http://www.gravatar.com/avatar/' + $.md5(email)+'?d=404');
http ://en.gravatar.com/site/signup/fake@example.com So yes, it is wholly possible with all Javascript. |
| ||||
|
I got bored. Here's a working example. Make an html file, stick this in it, load it up to see. I estimate that it would take about 5 minutes to get this into a theme. 20 to make a portable plugin out of it. HTML Code: <html> <head> <title>Example</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script src="http://plugins.jquery.com/files/jquery.md5.js.txt"></script> </head> <body> <script> function gravatar(email) { return 'http://www.gravatar.com/avatar/' + $.md5(email); } $(document).ready(function () { $('#email').blur(function () { var email = $(this).val(); if (email.indexOf('@') == -1) { return; } var img = new Image(); $(img) .load(function() { $('#gravatar_box').html("<img src='"+gravatar(email)+"?s=96&d=404' />"); }) .error(function() { $('#gravatar_box').html("<p>No gravatar? <a href='http://en.gravatar.com/site/signup/"+email+"'>Get one!</a></p>"); }) .attr('src',gravatar(email)+"?s=96&d=404"); }); }); </script> <form> <!-- This is extremely similar to the comment form in WordPress --> <p><input type="text" name="name" id="name" size="22" tabindex="2" aria-required='true' /> <label for="name"><small>Name (required)</small></label></p> <p><input type="text" name="email" id="email" size="22" tabindex="2" aria-required='true' /> <label for="email"><small>Mail (will not be published) (required)</small></label></p> <p><input type="text" name="website" id="website" size="22" tabindex="2" /> <label for="website"><small>Website URL</small></label></p> </form> <!-- Put your Gravatar_box div wherever you want it, style it however you like --> <div id="gravatar_box"></div> </body> </html> |
| |||
| Not being a very technical person, I wasn't sure what 'sucks in implementation' actually meant?
|
| ||||
|
Huh. Once I actually sat down and did it, converting it to a portable plugin actually took half an hour. I'm getting rusty. :( http://ottodestruct.com/blog/wordpre.../gravatar-box/ |
| ||||
| Quote:
Why, yes: here it is! Might his technique be useful? cbnet Plugins |
![]() |
| Thread Tools | |
| Display Modes | |
| |