Dax

Link A Dink

July 25th, 2006 · 55 Comments

fuck-up.GIFThis plugin replaces words in your posts with anything you want. I use it to replace words with links. For example, if you see my sister’s name, Ashley, anywhere on the site, it will link to a picture of her.

Upload it, install it, then go into the Link A Dink settings page in your Options.

Alright cool.

DOWNLOAD v 1.8

UPDATE v1.8

Fixed for WP 2.1.

UPDATE v1.7

Plugin now adds hyperlinks to comments.

UPDATE v1.6

Oops! Link A Dink was messing up images. I reconfigured it to strip out all tags before replacing words.

UPDATE v1.5

If a word is already in a hyperlink, Link a Dink will no longer butcher your link. For example. In this link: Ashley is already linked, but in this one, Ashley is not. Link a Dink should have ignored the first.

UPDATE v1.1

Okay, the plugin was a bit fucked up there. I pulled the limiter out so it replaces all occurrances of a word. I also made the plugin only effect whole words. If you put in “it” in to get replaced, it will only replace “it” — capitalized or not. There’s a boolean variable at the top of the file you can set to false if you want to replace any occurrance of your word.

Just set $lad_single_words = false; if you want

Tags: Wordpress Plugins

55 responses so far ↓

  • 1 Phantombookman // Jul 27, 2006 at 4:27 am

    Dax,
    that’s fantastic, just installed it, easy to use and works beautifully.
    This coding is a complete mystery to me - so well played sir and thanks for sharing.

    I’ll blog it and toss a backlink (proper not sheathed!) to you
    Cheers

  • 2 Phantombookman // Jul 27, 2006 at 6:55 am

    Hi Dax,
    just to let you know, without wishing to be critical.
    Have been adding words but found that it picks up and links words in url’s rendering them useless.

    If a keyword is in the post title it also picks up the word in the ‘read more’ tag making the word live but the more link dead etc.

    Also if it finds a keyword that is already hyperlinked it tries to double link it

    Hope this helps a little
    Regards

  • 3 Phantombookman // Jul 27, 2006 at 7:15 am

    PS:
    Still playing Dax and it looks to me as though;
    if it ignored any word in a url or any word already hyperlinked it would be spot on.

    Easy to say but god knows how that translates into code, if indeed it does.

    PPS, one thing that helps is that it is case sensitive, so names etc that start with capital letters escape the problem in urls

    Slainte

  • 4 hammer // Jul 28, 2006 at 9:35 am

    Shit. I knew there was a reason I hadn’t put it on the site yet.

    I will exclude hyperlinks somehow.

  • 5 estyles // Aug 1, 2006 at 8:51 am

    you could make it hyperintelligent, but then it might revolt, launch a bunch of nukes, and take over the planet.

    probably easier to turn it off when you read ““.

    that might end up stupidly when combined with php pages, if you support those, and depending on what your program does. I didn’t read the original post or any of the comments, including this one.

  • 6 estyles // Aug 1, 2006 at 8:53 am

    obviously your comments support html, which makes my comment above useless. I’m not gonna retype it with escape characters and shit, since you probably figured it out anyway.

  • 7 hammer // Aug 1, 2006 at 11:40 am

    Of course my comments support html. What do you think this is, some kind of bullshit?

    Always a pleasure, Bergsalergs.

  • 8 hammer // Aug 1, 2006 at 11:47 am

    The way it’s coded now, it would be difficult to ignore hyperlinks. I’ll think about it some more.

    A temporary solution might be to put trailing spaces in the words you’re trying to replace.

    For instance, don’t replace “thisword” replace ” thisword” or “thisword “.

  • 9 Phantombookman // Aug 2, 2006 at 12:29 am

    Cheers Dax,
    I am still using it but just for names as the capital letter issue solves the problem.

    It would be great if there was a way through as it’s potentially a superb piece of kit.
    Thanks again for taking the time Dax

    Regards from England

  • 10 hammer // Aug 3, 2006 at 12:36 pm

    Yea I’ll definitely scoup out the hyperlinks. Maybe I can find some time later today.

  • 11 bcyde // Aug 4, 2006 at 8:43 am

    So I tried this out. It seems to only replace the first occurrence of the word with your replace word, is that intended?

  • 12 hammer // Aug 4, 2006 at 10:36 am

    bcyde, thanks for checking it out. Yea, I had some testing stuff still in there. My bad.

    Phantom, I changed it so the replacer only effects whole words. That will keep it from changing links.

  • 13 phantombookman // Aug 5, 2006 at 12:28 am

    Hi Dax
    thanks for that, much appreciated. Tried out the new version. It is picking up the words in the
    “read rest of entry” link created by the “more” feature, which obviously stops them working.

    As to the one occurence word linking, I quite like that.
    Too many links the same could look a bit ridiculous.

    Plus, I use it to link words to categories, it would then have potentially dozens of links on the category page all pointing the page they are on ….

    Thanks again for all the work Dax and enjoy the weekend
    Regards

  • 14 bcyde.com // Aug 5, 2006 at 8:17 am

    WordPress…

    I installed WordPress on my devel machine because I was interested in looking at the plugins Dax has been creating. The system seems really clean and extending it seems pretty easy from my initial impressions. The only reason I’m not using it (so th…

  • 15 hammer // Aug 5, 2006 at 9:49 am

    phantom, I’ll look at the more feature. Maybe I’ll put something in that prevents it from replacing words that are already hyperlinked.

    Also, you can set it back to single replace by finding
    $ncon = preg_split(”/\b”.$fwords[0].”\b/i”, $content);
    and changing it to
    $ncon = preg_split(”/\b”.$fwords[0].”\b/i”, $content, 2);

  • 16 Phantombookman // Aug 5, 2006 at 10:31 am

    Dax,
    thanks for the info, much appreciated as before
    It actually picks up the extension as well
    i.e

    mysitedotcom/blog/daz-herrera-link-a-dink”>

    It would pick up link a dink in the actual URI for the more link
    Try adding link a dink to your plugin you’ll see what I mean lest I am being unclear due to ignorance and being a 10 year vet’ of hand-coding html only, i.e. dinosaur

    Cheers Mate!

  • 17 hammer // Aug 5, 2006 at 10:45 am

    I don’t think I’m understanding you right. Some of your example code might have gotten eaten by the comment poster.

    And I do hand coded html only too.

    I’ll definitely make the plugin ignore words that are already inside hyperlinks.

  • 18 Phantombookman // Aug 6, 2006 at 1:15 am

    Hi Dax
    sorry if I’m unclear - when I read it it makes sense to me but that may be even more worrying. The last post was because you said

    “prevents it from replacing words that are already hyperlinked”

    Which is why I mentioned that it picks up words that make up the link as well as the anchor text when using the “more” feature.

    I have just tried it again and if the keyword (let’s say it’s: link) is used in the post title then when using the more-read rest of entry feature you get this link:

    mysitedotcom/blog/dax-herrera-link-a-dink#more-123″>read rest of entry

    It will pick up the word ‘link’ and autolink it

    Thanks again Dax
    All the best

  • 19 hammer // Aug 22, 2006 at 10:00 am

    Hey phantombookman, I finally went in and put that whole Ignore Already Hyperlinked words thing. Try it out.

  • 20 phantombookman // Aug 23, 2006 at 12:39 am

    Dax
    beautiful - works a treat !
    This really is a bonus plugin.
    I realy should learn some programming skills, if only to feel less ignorant at times.

    Thanks again for the time and effort Dax and I recommend this plugin to all.

    One day, when they have an SES Lincolnshire :) I’ll stand you a big night out
    Cheers Mate

  • 21 hammer // Aug 23, 2006 at 12:52 pm

    Awesome! Yea it’s a cool plugin. I made it because I wanted to link certain people’s names to pictures of them.

    Then I realized it’s probably a good way to sell sneaky links that don’t leave footprints, so why not put it up.

  • 22 Combat Hair Loss // Nov 28, 2006 at 3:37 pm

    Cool plugin - I’m just setting up the blog so I am testing stuff out. Does this only work with the posts - not the comments?

    Great plugin though hammer - nice work!

  • 23 hammer // Dec 20, 2006 at 3:47 pm

    Yea, it doesn’t work on the comments. I guess I’ll put that in now.

    testing Ashley

  • 24 nadin // Feb 23, 2007 at 12:31 am

    testing…Ashley

  • 25 Tim Fehlman // Jun 7, 2007 at 7:04 am

    Dax,

    I am in the process of writing a small howto article about Link A Dink and I just had a quick question about capitalization. It appears that Link A Dink is not case sensitive. So, as example, if I replaced Foo with Bar, it would replace both foo and Foo with Bar, regardless of case. Does this sound correct to you?

    Also, how does order work within Link A Dink? If I have two replacement, foo with bar and foo foo with barbie, will the results, when it finds foo foo be bar bar or barbie? Or would it depend on the order that I entered the replacements?

    Any insight into these would be greatly appreciated.

    Tim

  • 26 Aouni // Jun 22, 2007 at 4:18 pm

    Heyz everybody,
    I just installed the plugin on my 2.1 wordpress and it worked fine with english words but when I come to replace the Arabic words it doesn’t work! My blog has windows-1256 encoding, could it be the reason? and how to solve that?
    Thanxz.

  • 27 Mark // Aug 19, 2007 at 1:01 pm

    Is there a way to replace links with other links?

    for example every post that has the url cnn.com to replace it with bbc.com

  • 28 hammer // Aug 20, 2007 at 11:05 am

    Nope. Sorry, Mark. I strip out all links before scanning.

  • 29 Bjorn Solstad // Sep 18, 2007 at 3:23 pm

    Hi Dax.

    Would it be hard for you to make it possible to enable/disable it for comments? My commenters got pretty pissed off when they got MY links in their comments ;) I wonder why hehe?

  • 30 Shawn // Sep 26, 2007 at 10:00 pm

    I’m having a problem with the plugin. I’ve installed it and activated it. But when I insert a keyword, instead of creating a hyperlink in the post, it looks like this

    “http://shawnsweekly.com/blog/index.php?tag=halo3 3 has been lauded as the single biggest release in entertainment to date.”

    It inserts the URL, and it’s not clickable. Am I missing something or doesn’t it work with WordPress 2.2 ?

    I’m wanting to upgrade to wordpress 2.3 but I’m not sure if it will work there.

    Your help is appreciated.

  • 31 High Return Investing with Dax // Sep 27, 2007 at 7:22 pm

    I have the same problem as Shawn. When I
    add my feed url to replace

    “RSS feed” to “http://feeds.feedburner.com/DaxDesai”

    Instead of creating a hyperlink it replaces the entire text with the hyperlink.

    Any ideas? I’m running Wordpress 2.2

  • 32 High Return Investing with Dax // Sep 27, 2007 at 7:36 pm

    ok… I’m an idiot.

    I figured it out. You need to enter it as below:

    “RSS feed” points to
    Full Feed RSS

    So you basically enter your replacement text as you would in code view.

  • 33 hammer // Sep 28, 2007 at 10:46 am

    Ah yea. You do. I guess I should make it work for either.

  • 34 Kelly // Sep 30, 2007 at 4:08 am

    Thanks for this great plugin! It’s way better than the commercial AdsDx (or whatever it’s called) where you can only choose 10 words to link and thereafter you pay for the 11th word onwards. (and it isn’t cheap!)

    I didn’t buy it cos it could not choose a cluster of a few words to link to. For a price of more than US$100 I expected the plugin to do much more!

    I will try it out in a few days (busy with work) and let you know if it works ok (it should - judging from the “testimonials” I get).

    P.S. I have a graphical avatar of me biting flowers but your header is hilarious! :)

  • 35 hammer // Oct 1, 2007 at 9:57 am

    $100 bucks!? For links? That’s bullshit.

    Your blog is all fucked up for me, Kelly.

  • 36 Andrew // Oct 8, 2007 at 3:17 pm

    Great idea, but for some reason it does not work at all of my website. Doesnt replace words with the words specified, doesnt make links or anything!

    :(

  • 37 Tariq Bamadhaj // Oct 14, 2007 at 1:25 pm

    This is a great plugin but I am having some problems with it. Basically I am using 2 words X500 and X500+. Each points to a different URL. However, when I use the word X500+ in my post, it always points to X500’s URL. When I use X500, it works as expected and points to its own URL.

    It seems that it is ignoring the + and is there a way around this?

  • 38 Zi // Oct 16, 2007 at 8:44 pm

    Hey Dax am using wordpress 2.2 with a utf-8 encoding for my arabic website. The plugin unfortunately shows nothing! I just add words to replace them by certain links and nothing happens? a reason? Maybe a new update and you’d have done it!

  • 39 vipvoy // Nov 12, 2007 at 11:57 am

    It something worth trying out one day

  • 40 Stuart // Nov 20, 2007 at 10:38 pm

    I’ve been using SH-Autolink for about a year, it butchers the links though so I could be tempted to change now :D

  • 41 Bong // Nov 28, 2007 at 10:53 pm

    Dax

    Your heart is bigger than your nuts. :D Thank you for making and sharing this plugin. Mighty useful.

  • 42 Pandas // Dec 9, 2007 at 6:09 am

    Yea I’ll definitely scoup out the hyperlinks. Maybe I can find some time later today.

  • 43 James // Dec 21, 2007 at 9:25 am

    Hello, how does this plug ins compare to http://adambrown.info/b/widgets/kb-linker/ ? Thank you.

  • 44 Vlad - Small Business and Web Design // Jan 25, 2008 at 8:42 pm

    Ah, just what I needed :) Thank you!

    Now if it only could pick links at random… or pick words at random!

  • 45 Everett // Feb 13, 2008 at 9:32 am

    I tried it but the plugin doesn’t work for me. I tried replacing the text with html including an href, and then I tried just replacing one word with another word. I also tried just replacing text with a url without the html. No results on all three attempts.

    Are you still working on this plugin or is it dead in the water? There are similar plugins out there that you have to pay for, but I don’t know how well those work either.

    Thanks!

  • 46 PPC // Feb 24, 2008 at 9:57 am

    Great plugin!

    Is it possibly to upload a list of words to be changes.

    It would save a lot of time ;-)

    Ashley does look good.

  • 47 2046 // Mar 3, 2008 at 5:06 am

    hello
    I have a small problem with every contact forms I have tried.
    When someone make an mistake,(forget the email, or name or whatever) the for sends him back, but the textarea is over writtnen by the link-dlink. The text in this area is affected by the script, so you can see the code(links what ever you choose in the link-dlink sett.) as a text, not as a link as anywhere else. Is it possible modify the script that will not touch textarea fields?
    thx 2046

  • 48 2046 // Mar 3, 2008 at 5:24 am

    sorry, but the solution could be if we have a chance to exlude certain pages ;)
    thx

  • 49 Selif // Mar 4, 2008 at 2:10 pm

    This looks like it’s got a lot of potential. Has anyone successfully used it to sell links in context kontera style?

  • 50 Kyle // Mar 27, 2008 at 1:05 pm

    This is great! Do you have a plug-in for Gallery that works like this?

  • 51 uk gambling forums // Mar 31, 2008 at 12:35 am

    looks like it works a treat on pages as well as posts. cheers sir!

  • 52 ScorpAL // Apr 11, 2008 at 12:41 pm

    Hi. Nice plugin.
    Does it work with wordpress 2.5?

    I have some idea…
    How about auto replace words witch compare with tag names with tags and links to tag page.

  • 53 av // Apr 12, 2008 at 7:41 pm

    Nice plugin!Goold!

  • 54 TY // Apr 17, 2008 at 10:37 am

    is it possible to limit the amount of the links per page? like if i had the word DVD in an article mentioned dozens of times…it wouldn’t look too good if my entire page was linked up every other sentence. haha.

  • 55 Chris // May 15, 2008 at 7:51 am

    Wow! Thanks, this is a great plugin. Only one thing I’d love to see … when we try to link words with special characters such as brackets () it can’t find them.

Leave a Comment