Home Forum Advertise Contact Me About WPTavern WPWeekly Show Info

Go Back   WordPress Tavern Forum » WordPress » General WordPress

General WordPress Talk about news, share great posts and more

Reply
 
Share LinkBack Thread Tools Display Modes
Old 06-22-2009, 08:02 AM
andrea_r's Avatar
WPTavern Forum Moderator
 
About
Join Date: Jan 2009
Location: Eastern Canada
Posts: 810
Default

Quote:
I wouldn't mind seeing a plugin that provided granularity for exporting data.
I'll tell Ron to release the one he did. :)
Reply With Quote
Old 06-22-2009, 10:43 PM
Martin's Avatar
Hello World
 
About
Join Date: Jun 2009
Location: Sydney, Australia
Posts: 83
Default

Quote:
Originally Posted by Otto View Post
The gravatar thing could be done via javascript. The problem is how to detect when somebody doesn't have an avatar right after they type in their email address. You'd need to use some javascript to calculate the md5 hash for the email after they type it, then perform a hit to this URL:

http://www.gravatar.com/avatar/MD5_H...-RECOGNIZE.com

If the hash doesn't match an existing gravatar, then the gravatar server sends back a temporary redirect to your default URL. If you can recognize that redirect and act on it instead of redirecting, then you can do anything you like at that point.
Just came across a plugin called Gravatar Signup and was created by Mark Jaquith and it has not been updated since 2005. This plugin allowed users to sign upto Gravatar from within their comment form area.

This plugin died when Gravatar changed something on their end.

http://txfx.net/code/wordpress/gravatar-signup/
Reply With Quote
Old 06-23-2009, 01:10 AM
Otto's Avatar
Patron
 
About
Join Date: Apr 2009
Location: Memphis, TN
Posts: 438
Default

Yeah, I found that once. Basically it just submitted a signup form for you. Nowadays, the gravatar signup sends you a custom link to prove your email address before letting you sign up for it. So you can't do it via a direct submission.
Reply With Quote
Old 06-25-2009, 08:46 AM
JohnM's Avatar
Big Tipper
 
About
Join Date: Feb 2009
Location: Norway
Posts: 314
Default

I may through 3 plugin ideas your way. One for site visitors, one for site authors and one for site developers. Are usability/readability, internal WP authors/developer communication/collaboration tools, and develop/launch tools interesting subjects for your plugins project ?

I`ll make a description of my plugin ideas if you're interested.

John Myrstad
Reply With Quote
Old 08-20-2009, 01:44 PM
Otto's Avatar
Patron
 
About
Join Date: Apr 2009
Location: Memphis, TN
Posts: 438
Default

Quote:
Originally Posted by itsananderson View Post
Doing what Otto suggests directly via JavaScript would be a bit challenging though, because browsers stop AJAX requests to across domains (to avoid XSS attacks). It wouldn't be terribly hard to accomplish with a simple PHP proxy page though.
It's actually possible now that they implemented the 404 response.

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');
On the no gravatar one, you could generate a signup link instead of showing their image. A signup link with the email already filled in looks like this:
http ://en.gravatar.com/site/signup/fake@example.com

So yes, it is wholly possible with all Javascript.
Reply With Quote
Old 08-20-2009, 04:37 PM
Otto's Avatar
Patron
 
About
Join Date: Apr 2009
Location: Memphis, TN
Posts: 438
Default

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> 
Reply With Quote
Old 08-22-2009, 07:52 PM
Hello World
 
About
Join Date: Jan 2009
Location: UK
Posts: 47
Default

Quote:
Originally Posted by carlhancock View Post
Or think about an existing plugin that adds a lot of functionality... but just flat out sucks in implementation (NextGen Gallery anyone?).
Not being a very technical person, I wasn't sure what 'sucks in implementation' actually meant?
Reply With Quote
Old 08-23-2009, 03:09 AM
Lyndi's Avatar
Hello World
 
About
Join Date: Jul 2009
Location: Pretoria, South Africa
Posts: 24
Default

Thanks Otto, that script works very nicely. You should get bored more often.

Nice2All - Let's Talk WordPress
Reply With Quote
Old 08-25-2009, 12:27 PM
Otto's Avatar
Patron
 
About
Join Date: Apr 2009
Location: Memphis, TN
Posts: 438
Default

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/
Reply With Quote
Old 08-25-2009, 01:03 PM
chipbennett's Avatar
On The Rocks
 
About
Join Date: Feb 2009
Location: St. Louis, MO
Posts: 832
Send a message via ICQ to chipbennett Send a message via AIM to chipbennett Send a message via MSN to chipbennett Send a message via Yahoo to chipbennett Send a message via Skype™ to chipbennett
Default

Quote:
Originally Posted by Ryan View Post
@Otto - Interesting idea, I was thinking of something simpler by having a link saying 'get a gravatar' or similar. When the link was clicked a lightbox would pop open which iframed the gravatar site. Checking for one dynamically would be far cooler though.
Didn't EpicAlex put together a plugin to pull in a gravatar dynamically on the wp-login.php page?

Why, yes: here it is!

Might his technique be useful?

@chip_bennett | chipbennett.net (est. 2000) | WordPress user since May, 2005 | Linux (Kubuntu) user since September, 2007
cbnet Plugins
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:58 AM.