The beta plugin I made just to see if I could (after @styletime sent me a tweet) has been quite popular, even more so since it got mentioned at Mashable so, I have updated the beta version of WP-Twitip-ID to final version 1.0 which takes care of some issues and makes it much better.

It no longer user custom post fields to store the users’ twitter ID, instead, it uses a new table in the database so a user only has to enter their twitter id once in a comment and all their other comments will show their ID (provided they use the same email address).

I’ve also added a new option to the plugin call to output the most popular way of displaying in the comments. The new command is “auto” and outputs as “Twitter: @commentluv” the username part is a link that opens in a new window and is nofollow. The whole thing is wrapped in a class of “twitter_id” so you can adjust the size of the text and link if you want.

See the plugin page here
http://www.fiddyp.co.uk/wp-twitip-id-plugin-add-a-twitter-field-to-your-comment-form-easily/

I wouldn’t have been able to get this done today if it wasn’t for @clearskynet who was able to answer my question about adding a table to the database. OMG I luv twitter!

also thanks go to @Mobasoft for the weird problem of using str_replace with a POST string containing @

for the geeks,
the twitter id gets posted from the comment form and gets collected by the plugin with $twitter=$_POST['atf_twitter_id'];
I wanted to remove any @ symbol so I used
$twitter_id=str_replace(“@”,”",$twitter);
but for some reason, the @ wouldn’t get removed. It was driving me crazy! I tried all sorts of urlencode, char(64) and so on but no joy. In the end, I got it to work by using str_replace with arrays instead. Now it’s
$search=array(“@”,”http://twitter.com/”);
$replace=array(“”,”");
$twitter_id = str_replace($search,$replace,$twitter);

and that worked! I don’t know why it wouldn’t work with “@” on it’s own. How strange!

Anyway, all is working now and I’m happy with it. You can download it at the plugin page here
http://www.fiddyp.co.uk/wp-twitip-id-plugin-add-a-twitter-field-to-your-comment-form-easily/