Send to a friend WordPress plugin

This is my first WordPress plugin, StaF or ‘Send to a Friend’.

StaF will add some viral-mailmarketing functionality to your WordPress blog. It allows users to send the page they’re looking at to a friend, colleague or someone special. The current release is in it’s development stage but it works, and uses AJAX for quick access and sending the mail.

Current Features:
- AJAX for quick sending without leaving the page
- Admin Panel for some text and colours
- Simple install only a few words of code
- E-mail check

Very near future plans (could be today or tommorrow):
- Admin option for the e-mail.

Future plans:
- Spam Blocking (via ip and mail addresses)
- non javascript support

Download
sendtoafriend_v0.4.3.zip

Installation :
- extract the zip file
- upload the complete folder sendtoafriend to your wp-content/plugins/ folder
- activate the plugin in your admin panel
- add <?php StaF_html(); ?> somewhere in your sidebar or template(s)

*note there shouldn’t be a space between the < , ? and php or the ? and > and should only be included once per page !!

Upgrade to v0.4.x
Remove the <?php StaF_html(); ?> from your sidebar or template(s)
Disable the plugin via the admin-panel
Delete the sendtoafriend directory in your wp-content/plugins/ folder
Upload the new sendtoafriend directory to your wp-content/plugins/ folder
Activate the plugin in the admin-panel
Add <?php StaF_html(); ?> back in your sidebar or template(s)

Quick and dirty upgrade
Disable the plugin
Delete the sendtoafriend directory in your wp-content/plugins/ folder
Upload the new sendtoafriend directory to your wp-content/plugins/ folder
Activate the plugin

For previous releases and their upgrade instructions visit page 2

Pages: 1 2

67 Responses to “Send to a friend WordPress plugin”

  1. Steve Garfield Says:

    Ok

    I figured it out. There is an extra space in front of the first ? jsut after the some where in your sidebar and try it”

    But it should be this:
    “add some where in your sidebar and try it”

  2. Sebastiaan Says:

    Hey I’ve noticed the problem before I tried removing it but wordpress keeps putting a space between the < and ? but i’ve put a notice the install text.

  3. Degtyarev Pekhotny Says:

    Most excellent plugin. I implemented it on http://www.sargasso.nl. When you click on an title to go to the post it shows a mail icon on the bottom of the post.

    The email check however is very important coz I now receive the emailaddress of my provider or something when I test the plugin without having the sender of the “mail to a friend” a valid email. Very strange.

    I would very much appreciate it if you would let me know when the mailcheck is added.

    This is the most beautiful “send to a friend” plugin I have seen in years.

  4. Degtyarev Pekhotny Says:

    and perhaps you have a solution for this ; when you have a very long post such as this

    http://www.sargasso.nl/archief/2006/01/02/prelude-nieuwe-energie-verhoudingen/

    and click on the mail icon on the bottom of the post, the form is shown outside of the screen; you have to scroll up.

    If you remove the position absolute bit from the style sheet the form is shown nicely but then my layout gets screwed up. It acts like the form is always there, even when the mail icon has not been clicked on.

    In my opinion, after clicking on “send to a friend” the mailform should always be visible on the screen, also with long pages like my example. I think I could fix this myself but it is more likely that you after reading this already know what the CSS should be.

    Thanks

  5. Sebastiaan Says:

    @ Dagtyarev

    True the email check is really important I’m already working on it the backend code is already done but i’m working on the frontend bit. I hope i can find some few spare hours and add this functionality within a couple of days.

    I agree there is a major flaw in the positioning of the mailform, my current idea is to position the mailform in the center of the screen after pressing send to a friend.

  6. Degtyarev Pekhotny Says:

    that would be really great. For the time being i have now my “send to a friend” link on the top of item pages so the form is always visible.

    Thanks again for the great work. I’ll be checking back for the rest of it.

  7. Degtyarev Pekhotny Says:

    I’ve installed version 3 and the e-mailcheck works fine with me. Thanks !

  8. Degtyarev Pekhotny Says:

    any progress on the positioning of the mailform ? just checking :P

  9. Knut Nägele Says:

    Exellent plugin. Is there anyway I can may it work outside of the blogs root? Like PHP-scripts that I can call with include(’blog/wp-blog-header.php’). Because it does’t seem to work outside. The form is not hidden, and it does not work.

  10. Sebastiaan Says:

    I’m a bit confused by your question but when the form shows up and doesn’t work means the javascript isn’t included.

    I don’t know if this will fix your problem but now I am including the javascript in the header of the page when a template (header.php) calls < ?php wp_head(); ?> I will remove this and output the javascript when you call < ?php StaF_html(); ?>. This will remove the javascript from the <head> but it will only be loaded when needed. it could reduce some loading on other pages where the script is not included :)

    Version 0.4 will include:
    - correct positioning
    - admin panel, these options can be set : background-, border- and font colour, the englisch text can be replaced with something in your own language.

    Hopefully I’ll find extra time to code this week and release it within a week

    Sorry for the lack of updates but i’m really busy, at work working on a few big-time projects, and renovating my new house.

  11. Knut Nägele Says:

    Sorry for not beeing very clear in my question. I have my blog in a folder like this http://domain.com/blog, and the plugin is working fine here. But I would like to use the plugin directly on the main site http://domain.com. Here it doesn’t seem to work. The form is open even though I havent pressed on the link “send to a friend”. Probably because the ajax-stuff and the mailing-stuff only works for things in http://domain.com/blog and not in http://domain.com. As I said, with the PHP I sloved this with putting in the beginning of the pages. But meybe it is more complicated with your script.

  12. saylow Says:

    How to changes the pop-up form position on the screen? I put in my blog but the form come up away outside to the right of my blog pages.

    thanks.

  13. Sebastiaan Says:

    @Saylow i’ve seen your problem and I’ve reproduced the wrong placement.

    It has someting do with css position:relative, I’ll try to fix it this week.

  14. Knut Nägele Says:

    Exellent job, Sebastiaan. Now it works for me also. Also outside the blog folder. I just have the same problem as saylow. The form appears to the right of the link “Send to a friend”. I hope it is not to big a problem to solve, because I intend to place the link in the right side of my link. So it would be nice if the form would appear left to the link. I tried diffenernt things in the CSS-code, but I couldn’t solve it.

  15. Sebastiaan Says:

    It was indeed the css position property, just check the javascript to see how it’s fixed :P

  16. Knut Nägele Says:

    Thanks for the new version. I love your plugin - thanks for sharing.

  17. Brian Says:

    Thanks for this. Great script!!!!

  18. Adam Says:

    BUG
    After activating the plugin, all H2 headers on the page had their styles changed.

    FIX
    In sendtoafriend.php, change this:
    #stafForm input,label,2

    to:
    #stafForm input, #stafForm label, #stafForm h2

  19. Sebastiaan Says:

    Thanx I’ll fix this as soon as possible !!

  20. Dan Says:

    Great plugin, we can customise the css right? If so prehaps thats a feature you might want to advertise.

  21. Sebastiaan Says:

    Adam I’ve updated the css.. sorry it took so long i’ve been very busy the last couple of weeks (as usual)

  22. Mark Wegner Says:

    This plugin is not xhtml compatible. You have to put the style code in the part of html, and this is in the header template. Also, you cannot capitlize attribute names and you have to close all your tags.

    /*In header*/

    #stafBlock { position: absolute !important; z-index: 100000; display: none; width: 200px; }
    #stafForm { background-color: ; border: 1px solid ; padding: 5px; margin:0; }
    #stafForm h2 { margin: 0; }

    #stafForm input, #stafForm label, #stafForm h2 { font-family: ‘Lucida Grande’, Verdana, Arial, Sans-Serif; font-size: 1em; color: #222222; }
    #stafForm input { width: 90px; height: 15px; margin-top: 5px; border: 1px solid #ccc; }
    #stafForm label { float: left; display: block; width: 90px; line-height: 16px; }
    #stafClose { float: right; margin-right: 5px; }

    /* Normal Plugin */

  23. Sebastiaan Says:

    Thanx Mark

    I’ll take a look at it, btw I took the liberty of editting your reaction since it totally broke below /* Normal Plugin */

    If there was more usefull information below /* Normal Plugin */ please send a e-mail to sebastiaan.smid[place the at sign here]gmail.com

  24. kat chan Says:

    I have this script running on another site, and it works perfectly. So I copied the plugin over and installed it on my new site, it didn’t work. I’m on the same v. of wp on both. So started from scratch and downloaded a new one and reuploaded it… It’s still not working. When I click on it, it just jumps to the top of the page, and the pop up doesn’t show up…

    Does anyone have any idea where the problem is coming from?

  25. Sebastiaan Says:

    I Could think of some problems e.g. javascript turned off, bad doctype/ not XHTML, or just a wierd bug… :)

    I would like to know more like webbrowser and version and prefferably a url we can take a look at.

  26. Murk Says:

    Hi Sebastiaan,

    Thanks for the plugin! I think I’ve found a bug in sendtofriend.php. The option ’squ_staf_linktext’ is missing from function squ_install() and function staf_options_subpanel().

    Cheers, Murk

  27. Byron Sanchez Says:

    Great plugin! I used it on my site:
    http://www.crypticuniverse.com

    I’m jsut having a bit of trouble changing labels (Ex: Your Name, Friend Name, Etc.)

    If we can do that, how? I can’t seem to find the text in the php file.

    Great plugin though. Works great.

  28. Sebastiaan Says:

    the labels can be changed in wordpress under Options -> Send to a friend, the data is saved in the database that wordpress is uses that’s probably why you didn’t find the labels in the php code..

    i hope this solves your problem..

  29. » Looking For Add-Ons - Webfeed Central Says:

    […] I’ve also been looking at adding some other WordPress plugins to this site. I’m already using “subscribe to comments“, “Kramer” (highly suggested), “Akismet“, “Simple tags“, Send to a friend (highly suggested) and “Google sitemaps“. If you have some plugins that you’ve been using, and would highly suggest, I’m all ears. Technorati Tags: Joomla, Mambo, template, slideshow, WordPress, plugins […]

  30. potaje.net Says:

    Hi all.

    I’ve installed staf plugin ( http://www.potaje.net/ ). It’s sending mails OK but I have a problem with the link sended.

    When clicked from inside a post page the link sent in the mail it’s OK, but when clicked from the main page (index.php) it sends the main blog url (www.potaje.net).

    I guess has something to do with the $_POST [ ‘ url `].

    Is there a way to fix this?

    Thanks.

  31. Sebastiaan Says:

    Well it sends the url of the page you’re watching so when you’re watching your homepage it will send something like “http://www.yourdomain.com/” when you’re on a post it will send something like “http://www.yourdomain.com/category/post/” etc…

    So the current version of the script doesn’t send the post-page on your homepage, so placing links in every post is irrelavant since all of them will send the url of your homepage and not the post-page self..

    I will take a look at in the near future since it’s more of a new feature then a bug, any tips or ideas on how to implement this are welcome !

  32. enrico Says:

    hi

    it does not work when i click over it and i am on the home page.
    it results www.mysite.com/#

    in all the subpages it works good showing its popup.

    the home page title is set as the blogtitle.

    any idea?
    thnx
    enrico

  33. enrico Says:

    in IE if you click send without filling any fields appear and error on the browser status bar (row 49, char 2) and does not show the regular alert like in firefox.

    hope you may fix it.
    thnx
    enrico

  34. הבלוג של אח“י דקר » שליחה לחבר - תוסף Says:

    […] זמין להורדה תרגום לעברית של תוסף ajax ”שליחת דף זה לחבר“. […]

  35. dakar Says:

    Hi,
    Thanks for the great plugin.
    I’ve translated your plugin to hebrew (see the trackback above).
    I’va also modified it so STaF_html may get a url parameter (optional), this way I can place calls to the plugin from within index.php, so that each call sends the apropriate page/post (place a call per post).

    Let me know if you want to have the changed code.
    Hannit

  36. Ty Says:

    Great plugins for wordpress.. you can see it at my website http://www.tyic.com

    I did change the css around a little bit…

  37. Blogging Web 2.0 Web Design | Social Networking | CSS | Ajax | Wordpress Tips | Fresh Gear | SEO | Tyic » Send Link to a friend WordPress plugin Says:

    […] http://www.lostpixels.nl/staf/1/ +trackback url | +del.icio.us | +digg it | +stumbleupon […]

  38. Scoutleader Says:

    “”

    I can only see the upper half of the word “send” on the submitbutton.
    It’s probably my theme “blix”, any suggestions?

    check it out @ http://blog.buzzscout.com

    thnx
    scoutleader

  39. JUST GOOD DESIGN | BLOG » Just Starting A Blog Says:

    […] Email To A Friend http://www.lostpixels.nl/staf/ […]

  40. Tino Says:

    Thank you for this wonderfull plugin. I’m using it on www.denquer.de now. Is it possible to include a textarea for personal messages, sent with the mail?

  41. Inicios » Mejoras en Inicios Says:

    […] También puedes encontrar al pie de cada entrada un enlace que te permitirá mandarle aquella que te parezca interesante a quien quieras en menos de un minuto. Nos gusta mucho el plugin que utilizamos porque es muy sencillo y eficaz (gracias Sebastian). […]

  42. Paul M. Says:

    Thanks a lot for the plugin! We’re using it in Spanish.

    And we’d also appreciate the improvement “potaje.net” was asking for. It has a lot of sense when using StaF in blogs.

    Cheers!

  43. lynn Says:

    Not sure what I’m doing wrong here. It works fine if I call the php like this:

    But if I try to use it with an icon, like:

    ” title=”Send “>

    I get:

    var staf_confirmtext = ‘’ ” title=”Send Bammer Found Guilty, Investigation Pending”>[Icon}

    I’ve tried it a bunch of different ways and I still get the ‘var staf_confirmtext’ no matter what…

    Ideas? Help??

    Thanks :)

  44. lynn Says:

    Blah. Your comment form pulled out my php!! Basically, I just need proper code to use it with an icon or graphic. Otherwise it’s working fine.

    Thanks

  45. Sebastiaan Says:

    Lynn you could edit line 81 in the file sendtoafriend.php and add your image there

    Or even better download version 0.4.3 and use the link text field for some nice html  (make sure your image path is correct !!)

  46. Proyecto XIRTAM » Enviar a un amigo Says:

    […] http://www.lostpixels.nl/staf/ […]

  47. Rod Says:

    Good plugin but one request : how is it possible to show directly on the page #stafBlock without clicking ??? I would like to put the inputs next to comments ; guy puts datas, it loads itself without become hidden. Any help ?

  48. eirin Says:

    Hi there, Could you please explain where exactly to paste the line of php?

    You said somewhere in your sidebar or template(s), could you please be a bit more specific?

    Your feature looks fantastic, I would very much appreciate your help!!

    Thanks!

  49. Gavin Atkin Says:

    I’m sorry to say I can’t seem to work with this at all - I can’t see to successfully put it into a widget, or to edit it into my sidebars.

    It’s a shame - I’d very much like to be able to use this viral marketing feature.

    Gavin

  50. Chris Says:

    Any plans to upgrade to Wordpress 2.2.1?

  51. videoke man Says:

    thank you very much for this lovely plugin, i hope in the future version we can set an email cap for the number of StaF mail that can be sent per user, it might used/abused for spam flooding…. 2cents

  52. Sebastiaan Says:

    Rod -> Nice idea…. i’ll take a look into it

    Eirin -> you should put the code into the file sidebar.php

    Gavin -> Sorry could you be more specific ?

    Chris -> I will upgrade my wordpress to 2.2.2 soon

    Videoke -> if people will use it for spamflooding it will be spamming your page this is not very attractive for spammers but they idea is still on my mind

  53. Edie Says:

    Hello Sebastiaan,

    I have activated your plugin, but it does not go right :(

    I test plugin… I click at send a friend, new window is opened and i fill every details, when I click to send it shows me successfully send. But I have nothing in my mail box :(

    Can you help me?

  54. Josef Reznicek Says:

    Hi I installed plugin on my sites, it works great. but when someone receive an email with link on my sites, in the mail isn\’t mailer\’s (sender\’s) name, but email of my hosting provider ( www-data ). Try it. link to friend is bellow the header.

  55. 2 Pass-It-On Wordpress Plugins | Sassafrass Says:

    […] There’s a few different ways to do this, but my favorite (and the one on this site) is Send to a Friend. Clicking the e-mail link brings up the popup window you see here–simple and effective. You can even change the “Your Name:” and other prompts (and the colors) in the Options menu. […]

  56. Bred Says:

    Hello,

    I have problem, because I need not fromname and how can I delete it? I now how delete it from table but not from code :( (When I delete fromname only from table this plugin does not send any mail.)

    How can I modify css attribut at (because it destroy my div style)

    Thank you for reply!

    Bred

  57. Waqas Says:

    Wonderfull Plugin

    I’ve enjoyed using it …! I’ve uploaded it on www.shockpill.com, it works cool!

  58. Andrea Brugnolo Says:

    Hi Sebastiaan! first of all thanks for the plugin!

    there is a Js bug with Internet Explore 6, Enrico in an old post wrote the request of correction

    the mystake it’s the propriety of labels tags into staf_Error function inside js.php.
    Need replace the value inherit with a exadecimal color like #000

    function staf_Error(stafErrorArr)
    {
    document.getElementById(’stafLblFromName’).style.color = ‘#000′;
    document.getElementById(’stafLblFromMail’).style.color = ‘#000′;
    document.getElementById(’stafLblToName’).style.color = ‘#000′;
    document.getElementById(’stafLblToMail’).style.color = ‘#000′;

    for(i = 0; i

  59. Angela Says:

    Thanks for the plugin! I’ve uploaded it to a new site I’m making, at http://ecoseugene.org . I had to go in and reduce the font size to 80% for this site, but the send button is still not right. Would you mind telling me where to go to fix that? I’d enjoy making the background colored too, if you can give me pointers.

    I really like how simple the plug-in is. Thanks again.
    Angela

  60. Tony Scotta Says:

    I am having two problems, If anyone has a suggestion that would be AWESOME!
    when I download this file Version: 0.4.3 and then open up sendtoafriend.php it still says Version: 0.4.2

    Also, when a user clicks on the link in my website (www.cheapestpcrepair.com) , the box is all mis-shaped, like there is not enough room in it.

    where can I get the new STAF 0.4.3? thanks.

    I would sure love a suggestion, thanks evryone!

  61. Jim Royal Says:

    Terrific plugin, which I am using here:

    http://stc-montreal.org/en/

    One question… Any hope of a version that works with Wordpress 2.5?

  62. Frisbee Fodder Says:

    Great plugin. Easy to customise. Works very well. Thanks!

  63. Will Fealey Says:

    This plugin is exactly what I have been looking for. I thank everyone who is involved.

    Is there anywhere I can vote for this within Wordpress because it took me ages to find it!

    I am using this on http://FastStudentCash.com, check it out for working example.

    Thanks again

  64. Plugin Wordpress Send to a Friend - Enviar email sem sair da página | Wordpress Love - Themes, Plugins e tudo para Wordpress, em Português Says:

    […] Nome Plugin: Send to a Friend URL Original: Send to a Friend Autor: Sebastiaan Smid Tradução: Paulo Faustino […]

  65. John Says:

    So, I finally got the plugin working…but, this thing with the positioning?
    Is there a quick hack or something to get it nicely positioned?
    position: absolute doesn´t work (it gets trapped to the right under an “image show” plugin. Tried position: fixed. Beautiful! IF you are on the top of the page when you click the link. If you´re already scrolled down a bit and click the link, the window shows up outside the browser and is unusable :(

    Thnx!

  66. Renann Says:

    i put the code like that :

    Por:

    but it does’t appear, any idea how to fix it?

    Thanks

  67. Shery Says:

    Works like a champ! I tried to put the code on the sidebar template -but- it didn’t work. So I just added “PHP Code Widget” and then I was able to place the code on that widget… easier! get the code here: http://wordpress.org/extend/plugins/php-code-widget/

    Oh! and I’m running WP 2.7 ;)

Laat een reactie achter

 
 

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

Om te kunnen reageren moet je eerst de 5 karakters tussen 0..9 en A..F lezen en invoeren. Vervolgens klik je op verzenden.

  

Getver.., Ik kan dit niet lezen. Genereer a.u.b. een