WordPress.org

Support

Support » Plugins and Hacks » “Send 2 friend” function

“Send 2 friend” function

  • Hi,

    for a while i have been looking for a simple way to add a “send 2 friend” functionality to my posts.

    I saw one that i liked at a friend’s blog (which is implemented in Movable Type, though: http://vowe.net).

    After looking at the page source i thought i could do that myself and just hacked the index.php in my theme dir with this code for the loop (in the <p class="postmetadata"> section):

    <a title="Mail this to someone else" href="mailto:?subject=<?php bloginfo('name'); ?>: <?php the_title(); ?>&amp;body=You might consider reading this: <?php the_permalink() ?>">Send 2 friend</a> <strong>|</strong>

    As you can see, this basically just adds a mailto: link which calls the blog and post title for the subject line and adds a little body – everything else is left to the default mail client on the system. I think that’s no bad idea at all. You can see it action on my site http://www.teezeh.info

    Since i am all but a PHP or WP wizard, i just wonderes whether this could be done as a plug-in as well? After some browsing through he Codex i found that i neither have the time nor the skills to do this. Maybe someone else wants to try?

Viewing 8 replies - 1 through 8 (of 8 total)
  • It doesn’t look like that code would work if implimented, although I am myself looking to emulate your idea.

    I would like to find a plugin (one that works in 1.5) that has this same function, but uses a popup making it unnecessary to have configured email program.

    Any suggestions?

    So far i am not able to paste the code here correctly – the backtick thing does not work. Still trying – and you can see it working on my site…

    Update: Code should be legible now…

    I’ll be making my mail-a-link form available at some point, once I get through with all my other plugins. Haven’t decided whether/how I will make it a plugin — at the moment it’s more hard-coded to work. Also, it uses secondary scripts, but I could probably make it use the php mail function, or see if WP has standardized on mail-message code finally… 😉

    -d

    what would be cool would be to also have a check as to see how many times the link was clicked on to send an e-mail, or a way to figure out who’s sending the e-mails.

    My mail-a-link thing does that — it keeps a database table for each link-email sent out… I just need time to get through other stuff to clean it up nice for other folks to use! 😉

    -d

    I’m a nice folk! And clean!

    tcloer – worked perfectly. So simple and elegant. Thanks. Where would I add it to have it show up on archives pages.

    Never mind. Figured it out.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘“Send 2 friend” function’ is closed to new replies.