WordPress.org

Ready to get started?Download WordPress

Forums

"Send 2 friend" function (9 posts)

  1. tcloer
    Member
    Posted 9 years ago #

    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?

  2. freshpolitics
    Member
    Posted 9 years ago #

    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?

  3. tcloer
    Member
    Posted 9 years ago #

    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...

  4. davidchait
    Member
    Posted 9 years ago #

    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

  5. lawtai
    Member
    Posted 9 years ago #

    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.

  6. davidchait
    Member
    Posted 9 years ago #

    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

  7. freshpolitics
    Member
    Posted 9 years ago #

    I'm a nice folk! And clean!

  8. dickrichards
    Member
    Posted 9 years ago #

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

  9. dickrichards
    Member
    Posted 9 years ago #

    Never mind. Figured it out.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.