Digg This O’ Mine

Just like most of us here, I love WordPress, and I like Digg.

And as you may know, Digg allows us to integrate the “Digg This” button into virtually any web page. Yes, this naturally includes my WordPress posts. Yay!

The integration is dead simple. To display a “Digg This” button in my post, I only need to place this code somewhere:

<script type="text/javascript">
    digg_url = "My post's permalink";
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

Or, in case I want to customize the button a bit:

<script type="text/javascript">
    digg_url     = "My post's permalink";
    digg_title   = "My post's title";
    // The background color *around* the button
    digg_bgcolor = "#ff9900";
    // The "skin" of the button. "Compact" means that tiny icon.
    digg_skin    = "compact";
    // Clicking on the button will open the Digg link in a new tab/window
    digg_window  = "new";
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

Can’t be simpler right? But I’m not satisfied with this… Firstly, I’m lazy and it bores me to death to copy and paste the scripts above into every new post. Second, if I change the permalink of my post, I’ll have to edit it to update the URL or the button will be in trouble. And third, it will be hell if someday I decide to change the layout of the buttons in all posts, or if Digg changes something in its integration code.

So I was thinking about a “Digg This” plugin that can automate everything for me. And it beat me to see that there’s none, or at least I couldn’t find any.

Then I decided to write one myself. By the way, this is my first attempt to write a plugin for WordPress - I’ve hacked plenty though, like WP-Syntax, All In One SEO Pack etc. It took me one day and lot of headache, but finally I managed to get my Digg This O’ Mine working smoothly, and I’m using it right now.

/*
Plugin Name: Digg This O' Mine
Plugin URI: http://www.phoenixheart.net/2008/10/digg-this-o-mine
Description: Place a "Digg This" button at the end of your posts, pages, or anywhere at your choice.
Version: 1.0
Author: Phoenixheart
Author URI: http://www.phoenixheart.net
*/

It can be downloaded here. Just like any other plugin, just unzip and upload it into your wp-content/plugins folder, activate it through the “Plugins” panel, and it will work out of the box. If you want more power, head to Settings->Digg This O’ Mine to configure some options:

Digg This O' Mine Options

(The numbers and shading effect are added using Photoshop).

The (background) color picker was implemented using the fantastic Farbtastic jQuery plugin.

Feel free to download, use, and maybe extend this plugin, as it’s licensed under GPL. Comments and bug reports are always welcomed!

As the final line: I attempted to add this plugin into WordPress repository, but somehow I’ve not received any email from them. I would appreciate a lot if someone could guide me through the plugin adding process, as I’m now totally stuck. I’ve managed to add it to WordPress. Now it’s an “official” plugin there.


  • Looks awesome. I’ll have to check it out.

  • Hi!
    I have installed the plug-in, but it isn’t showing me any settings.
    Here is a screenshot of the settings. http://www.imagetoshare.com/images/dpt0f7qv0v6tun4jymg.png

    What can I do?
    Thanks.

  • Hello detoam!
    Are you installing the latest version here http://wordpress.org/extend/plugins/digg-this-o-mine/?

  • Is there a way to add this to individual posts and not site-wide? Like a quicktags button option?

  • Hi Stefanie, currently there’s no such an option, but there *will* be in the next version which is coming very, very soon. Stay tuned ;) !

  • How to translate all this staff to other languages?

  • Skidka,
    The texts on the Digg This button is provided by Digg.com itself, and honestly I don’t know how to change it.

  • Hey there.  I installed your plugin on wordpress 7 and seem to have the same problem as detoam with no settings showing.  i see on the plugin page that it is compatible up to 6.3 so maybe it’s that.  I have diggclick but I don’t like the antiquated graphic and the lack of count. . yours is much nicer.  could the error be a conflict with my template or some other plugin?  the dig button shows fine in the UI but i was hoping there was a setting to determine where it displays. . i’d like to to display at the top left of the post, like i have now with diggclick.  anyway, looking forward to your next version. .

  • Therrold, I’m personally using the plugin on this site (2.7), so I suggest it’s a conflict. Do you suspect on any other plugin? Mine use jQuery, if that matters.
    And yes, you can place a tag where you want the button to be shown.

  • I am also not seeing the settings. Instead I see a page very similar to what detoam has described…
    Digg This O’ Mine Options
    2
    * You will have to manually add this Digg This O’ Mine template tag into your theme if these settings are set to “no”:
     
    And then a line of php code.

  • By the way, this is with 1.0.2 of the plugin and WP 2.7.1, using the Flexx theme by iThemes.

  • I’ve actually just reverted back to the default WP theme and this plugin still doesn’t show any options panel, just what I described in my earlier comment. Bummer. The only other plugins I have installed are cForms, Robots Meta, WP-spamfree. Through a process of elimination I have determined that there is a conflict between this plugin and Robots Meta plugin. Disabling Robots Meta plugin enables your plugins settings to display properly.

    So the question is, which plugin is at fault, yours or Robots Meta ?

  • it does not work, i am only seeing drop downfields and text boxes in my setting option screen. i do not even know what setting each of these dropdown field does.

  • Hi there… good plugin, but no matter what I do, adding Digg to my pages throws an error in IE(6 at least) and causes page loading to go at a snail’s pace.
    Any ideas how I can fix this?  I have now tried 3 digg plugins… all same thing.
    for example: http://www.faxthegovernment.ca/send-fax-email-bill-c-6/
    thanks :)

  • Hello,
    It’s not a problem with the plugins, it’s from Digg itself. I didn’t notice about the error on IE6, but the snail space is explainable: the Digg badges are loaded from Digg as iframes, so the more they are, the slower your page should be.

  • ok… thanks :)   That’s weird that Digg would have such unfriendly code.  Going with a makeshift solution for time being!
    peace

  • Hi - I’ve installed Dig o’mine and really like it. However, I can’t change any of the settings because I can only see drop down boxes…I have no idea what I’m saying yes or no to.
    Please can you give a screengrab of the full options page, so I can see what the drop downs relate to?
     

  • Ally, I have the screenshots right in this post… Didn’t you even take a look?

  • I did…but they don’t match with what I see in my options screen…so I assumed it was from a previous version. The options page I have seems to be quite long.

  • Ally, would you mind uploading your screenshot somewhere so that I can take a look?

  • No problem…thanks for taking the time to look at this  :)
    I’ve uploaded it to here:
    http://www.twitpic.com/kl0gg

  • Ally, there was a problem with your installation - maybe some plugin conflicts. The options shown are not from Digg This O’ Mine.

    I would disable one by one to see which plugin cause the conflict.

  • How do I edit the width of the plugin? It uses <iframe> and I can’t edit the width using the .adom on the css.  Any ideas on how to fix this?

  • How can a adjust where the button is placed? By default it seems to be the bottom left?
    I would like it to Float in the top left of each post.

  • I also would like to know if there is an easy way to adjust the location of the Digg button.  I already have a tweetmeme button appearing at the top right of my posts and would like to add the Digg button below it on the top right as well. Cheers.

  • Yes I also want to learn how to reposition the button… please advise

  • Great
    Thanks a lot

  • Is it possible if digg button refers to homepage not to latest post?

You can follow any responses to this entry through the RSS 2.0 feed.

Trackbacks / Pingbacks