Arne Brachhold

Del.icio.us – Bookmark this! WordPress Plugin

Filed under: Plugins — arne on June 21, 2005
Latest release:
1.1
2005-11-27

Hi there,

here is another WordPress Plugin for you! I’m sure you know del.icio.us, an online service where you can manage and share your bookmarks with other people. With this plugin you can add a "Bookmark this page on del.icio.us" link to your posts or sidebar. This will allow your visitors to add your page directly into their del.icio.us profile and makes your blog more popular!

Installation:
Just download the zip file and extract the content into your wp-content/plugins directory.
Then activate it at your Plugin menu in the administration panel.
The last step is to add some code in you template where the link should appear.
<?php dbt_getLinkTag("Bookmark on del.icio.us"); ?>
This will add a link to bookmark the current page. If you want to create a bookmark link for the current post use the following code inside "the loop".
<?php dbt_the_LinkTag("Bookmark on del.icio.us"); ?>
Please have a look at the included readme.txt which also contains a sample with an image. You can see the result at the left sidebar of my blog or below the post title.

Download:
http://www.arnebrachhold.de/get/delicious-bookmark-this/delicious-bookmark-this.zip

License:
This plugin is licensed under the GPL. Because the plugin is licensed free of charge, I do not accept any responsibility for any damages, direct or indirect, that may arise from using the plugin. This software is provided "AS IS" without warranty of any kind. Please refer to the full version of the GPL for more details.

Update 1 (2005-11-27):

  • Added "dbt_the_LinkTag" function which works inside the loop to bookmark the current post. Parameters are the same, use it inside the loop.

What is "The Loop"?

The Loop is used by WordPress to display each of your posts. Using The Loop, WordPress processes each of the posts to be displayed on the current page and formats them according to how they match specified criteria within The Loop tags.

Have a look at your index.php template and search for the loop. It begins with
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
and ends with something like
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

Inside of the loop you can use the functions beginning with “the_” which depend on the current post of the loop. Place <?php dbt_the_LinkTag("Bookmark on del.icio.us"); ?> anywhere between the two code pieces above to create a del.icio.us link for the current post.

More info about "The Loop" is available at The codex

43 Comment(s)

Comment by Tomer

Posted on June 22, 2005

great plugin! thanks. please consider using the image i’ve prepared for del.icio.us’s logo, instead of using text. you can find it here:

http://www.hapinkas.co.il/images/delicious.png

Comment by Marc Magi

Posted on August 11, 2005

Thanks for the plugin. I have a simple question. Please tell me how to modify the plugin with the “target=_blank” parameter? That is, I would like the Technorati link to open in a new window.

Comment by Marc Magi

Posted on August 11, 2005

Oops, That is, I would like the Delicious link to open in a new window.

Comment by Raj Bala

Posted on September 12, 2005

I’m trying to add the “Bookmark with del.icio.us” link to my posts so that each individual post can be bookmarked with del.icio.us, not just the page. I can’t seem to get it to do anything other than bookmark the entire page. Isn’t there some way to pass in the post id and title so that each post can be bookmarked individually? Am I missing something.

Comment by Mikhail Esteves

Posted on September 26, 2005

Neat! Thanks!

Comment by thesuperstar

Posted on October 5, 2005

thanks, very nice.

Comment by eidderf

Posted on October 27, 2005

i have the same concern as raj bala… how can i make it to bookmark the post and the post title and not the website link?

Comment by C Montoya

Posted on November 7, 2005

thanks so much! It works great!

Comment by themaxx.ca

Posted on November 26, 2005

as eidderf and Raj Bala, I would like to know if we can have the link to bookmark the post and not the entire page. I place the tag inse the post and I only get it to bookmark a particular post if the user is visiting the permalink of the post.

Thanks for this great plugin ;)

Comment by arne

Posted on November 27, 2005

Hi,

yes, this is now possible. Download the new version 1.1 and use dbt_the_LinkTag inside the loop.

Best regards,

arne

Comment by John Koetsier

Posted on November 29, 2005

Thanks for the cool plug-in. I’ve added it to my site.

I’ve noticed that whenever I tested the link (thereby initiating the first step in creating a bookmark at del.icio.us) and then clicked back, I got a parse error:
Parse error: parse error, unexpected T_STRING in /home/gilgames/public_html/wp-content/themes/bionicjive/index.php on line 19

But a simple refresh of the page fixed it. Any idea what’s going on here? And yes, that’s the main index file of my site, and that’s the location where I put the line of code that calls the del.icio.us link:

Comment by Allan

Posted on November 29, 2005

Just downloaded “Update 1″ and my Blog choked on first load after activating the plugin. It turns out I’ve copied the bad code from the readme.txt:

http://img452.imageshack.us/my.php?image=picture26kb.jpg

The quotation marks are… erm… not what they should be.

Thanks for this neat plugiin.

Comment by arne

Posted on November 29, 2005

Hi,

hmm, i’ve corrected the wrong quotation marks in the readme file. I don’t now where the false ones came from…

@John: Are you using WP-Cache? If so, try to clear the cache after the installation.

arne

Comment by emilio

Posted on January 6, 2006

Hi everyone,
I put a “Bookmark with del.icio.us? link at boottom of each post, but when i am in principal page each delicious link points to base domain of the blog and not to post`s permalink.
In single page works fine.

Any suggestions ?

(sorry my english, i´m from Argentina)

Comment by arne

Posted on January 7, 2006

Hi emilio,

just use the dbt_the_LinkTag function instead of dbt_get_LinkTag :)

Best regards,

arne

Comment by Erno

Posted on January 7, 2006

Love the plugin.
Love it so much I copied it and added next to the Furl and Delicous bookmark, a Blink It bookmark and Technorati Cosmos button.

Thankx
Erno

Comment by Emilio

Posted on January 8, 2006

Now it´s working :)

Thanks arne !

Comment by Navjot Singh

Posted on January 17, 2006

It is showing this error repeatedly on WP 2.0

Parse error: parse error, unexpected T_STRING in /home/exguides/public_html/blog/wp-content/themes/wp-andreas09/alt-right-sidebar.php on line 41

Comment by ricky

Posted on January 27, 2006

“use dbt_the_LinkTag inside the loop.”

What’s the “loop”? Where’s the “loop”? Where exactly do I put the plugin code to have “bookmark this” show up at the bottom of every post?

Comment by Matthew Bennett

Posted on January 30, 2006

Great plugin, I’ve been looking for this for a while and have finally got round to finding it. It was very easy to install and works perfectly. Thanks. Now just have to see if anybody adds my stuff to del.icio.us :-))

Comment by BillyG

Posted on February 9, 2006

FYI, I’ve been getting this validation error ever since installing your plugin, other than that, I love it.

Below are the results of checking this document for XML well-formedness and validity.

1. Warning Line 29, column 18: character “&” is the first character of a delimiter but occurred as data .

if(targetURL && targetURL.length>0) loc = targetURL

23. #
24.#
25.# //Bookmark on del.icio.us
26.# function dbt_bookmark(targetURL) {
27.# //URL of this document
28.# var loc=location.href;
29.# if(targetURL && targetURL.length>0) loc = targetURL;

I’m guessing you may need to split that last line up to something like:

if ( (targetURL > 0) && (targetURL.length > 0) ) loc = targetURL;

G/L.

Comment by BillyG

Posted on February 9, 2006

How did I know that comment was gonna get deleted lol?

I guess I gotta blog about it now to let others know, I tried leaving you a comment but if you wanna be that way, so be it. G/L

Comment by arne

Posted on February 10, 2006

Hi “BillyG”,

since you use WordPress too, you should know what “Comment moderation is in use. Please do not submit your comment twice – it will appear shortly.” means. But especially for you, I’ll explain it. Comment moderation means, that I review all comments that are posted on my blog to avoid spam and advertising. It also means that comments will appear AFTER i read them. Because I’m busy and don’t sit in front of my PC waiting that somebody comments my post, it can take up to 2 days until a comment is moderated and appears on my site. So please cool down and wait a little bit… in the meantime, i recommend you to read a good WordPress Codex Article about comment moderation.

Best regards,

Arne Brachhold

BTW: If you are using XHTML and want a validating HTML, you can add //<![CDATA[ after the opening script tag and //]]> before the closing script tag.

Comment by BillyG

Posted on February 10, 2006

I’m sure you haven’t been staring at your screen since November, just thought I’d finally put it out there since I know there is no way in hell that I’m the first one to validate since Nov. How did you not know this is beyond me but now everybody does lol.

Comment by Alex Walker

Posted on February 15, 2006

Thank you for this plugin!

Comment by Rocky

Posted on February 17, 2006

Hi,

I need you help, I want to use Bookmark button of “del.icio.us” and “furl” on my Blog, so that by pressing, post can be Bookmarked. Like you have on Top of every Post.

I had inserted of “del.icio.us” and “furl” in my Post.html file as is from their sites. But nothing happens.

My Blog is hosted on “Blogsome.com”, a backend of wordpress.

Could you advice me the right for both “del.icio.us” and “furl”.

thanks in advance.

Comment by Mark

Posted on February 18, 2006

Darn it doesn’t work on my 2.01 install. I get blank pages no matter where I put the code in a template.

Comment by Matt

Posted on February 28, 2006

similar error –

Parse error: parse error, unexpected T_STRING in /home3/echristi/public_html/wp-content/themes/our bridge/index.php on line 21

plus the snippet of code from my index.php fle:

|

|
|’); ?>

Must be pretty simple, but I just can’t see it – thanks

Comment by Steve

Posted on February 28, 2006

Arne,

Thank you for your time to create this plugin. It seems that there are some regular problems users are facing. They may not be well-versed in PHP, but that is of little consequence. Would you consider putting several examples of code blocks using the default theme so users can see exactly what it means to be put “in the loop”

Possible example blocks of code:

showing in Sidebar
showing at top of post “Bookmark in Del.icio.us | Furl |”
at bottom of post “Category Name | Bookmarke in Del.icio.us | Comments (1)

This would be of such great help and would eliminate redundant questions – perhaps put on a FAQ page.

Thanks Arne, and have a blessed day.

Comment by Matt

Posted on March 1, 2006

Hey Arne, would appreciate a little help – guess the code doesn’t print in the posts. In return I have a small tip which may be of assistance. My sites have CTRs of around 10% (except the blog my name links to – even this super-capitalist has to draw the line somewhere : ) If you change the Adsense links to the same blue as the rest of your links you would definitely pick up a bit more coin.

I’m sure you already knew that, being web-savvy and all, but it’s amazing how much people scan when reading an article. That all-black scheme probably is skipped over since people know that they reached the end of the article and would then be naturally looking for comments.

Just a thought. I know you are a busy person, but Plz help w/ my dilemma listed in past question (errors). Seems to be common. I know it isn’t the program, and I did get it to work some time back on a 1.5 blog. Now it just won’t work.

Thanks,

Comment by arne

Posted on March 2, 2006

Hi all,

thanks for your feedback. I will add more FAQ and samples to this page as soon as possible. If you get a parse error, make sure you activated the plugin and used correct quotation marks when embedding the PHP code. Some browsers and WordPress tend to use "nice" quotation marks (like this one: “) instead of normal ones (like this: "). If you get a blank page, try to find out what happened. You can get a more useful error message if you remove the two slashes at line 61 of the plugin (//error_reporting(E_ALL);)

I’ll update this page soon.

@Matt: Thanks for your hints :)
I’m thinking of removing the ads completely from my page. I tried to embed nicely so they don’t disturb the layout but this also means that they don’t attract attention. I will try… Thanks!

Comment by Matt

Posted on March 3, 2006

Yeah – it was the quotations. I copied the code directly from within the little blurb in the WordPress menu wher we activate the plugin. It shows double quotes there. When I changed them to single-quotes it worked. Knew it was something little – thanks Arne, and have a blessed day!

Comment by Andrea

Posted on March 14, 2006

I was playing with your script and tried to add a "&tags=sometags" in order to set the bookamrk with the given tags.
But when the url is parsed by del.icio.us the tags disappear.
Do you know if it is a del.icio.us known behaviour (in the apis docs it’s stated that you can send the &tags flag).
Thanks

Comment by arne

Posted on March 27, 2006

Hi,

I’ve read in several interviews with Joshua Schachter (founder of del.icio.us) that it’s not possible to suggest tags. Can you give me a link where you’ve seen this?

Best regards,

Arne

Comment by frank

Posted on April 17, 2006

Hi there I’m looking for a cloud kinda plugin to display my delicious bookmarks. someone knows where to go for that?
thxs in advance

cheers
~frank

Comment by Dodo

Posted on May 9, 2006

Helllo,
nice plugin. I’d have two questions:
1) Is it possible to open the del.icio.us page in a new window? I tried to add target=\”_blank\” in lined 116/134, but this doesn’t seem to have any impact.

2) The page does validate properly, but there are 2 “warnings”:
# Warning Line 101 column 18: character “&” is the first character of a delimiter but occurred as data.

if(targetURL && targetURL.length>0) loc = targetURL;

This message may appear in several cases:

* You tried to include the “0) loc = targetURL;

This message may appear in several cases:

* You tried to include the “, the warnings disappear, but then the plugin doesn’t work anymore, i.e. the link doesn’t go to del.icio.us anymore.

Thanks.

Comment by Lautreamont

Posted on May 27, 2006

Again, thanks for the plugin. You dudes keep WordPress community high. :o)

Comment by craig bellamy

Posted on June 6, 2006

thanks very much for your contribution to the wordpress world of plugins mate. i will try it out and give your some feedback.

best,

Craig

Comment by miklb

Posted on June 8, 2006

I tried your plugin, and on two different installs (one running 2.1a, another 2.0.2) it didn’t work. Might have been a conflict with another plugin, but haven’t tested yet. Are you familiar with any conflicts?

Comment by Terry

Posted on July 8, 2006

THanks for the plugin Arne…

Slid you a donation……

-Terry

Comment by Dustin

Posted on July 18, 2006

I installed the plugin and insert the code however its not showing up. It should show up after the amount of comments but for some reason its not.

Comment by Jeanne

Posted on July 19, 2006

Is there a way to pass the post’s title to the dbt_the_LinkTag function?
This way if the link is shown after each of a series of posts on the main page, the title in delicious would be the title of the post, not the title of the page.

Thanks so much!

Comment by Ray

Posted on July 25, 2006

Hi,

Thanks for this great plug-in.

Great instructions. I got it to work first time – not bad for a relatively inexperienced coder.

Regards,

Ray

55 Trackbacks (30 random links are shown)

Sorry, the comment form is closed at this time.