Moodle Tell a Friend Script

Moodle Tell a Friend Script

by N Hansen -
Number of replies: 11
As promised, here it is. This allows site visitors to send an email to their friends about your site-this is particularly useful for business users. Instructions on how to configure and use it are included in the readme file. It validates the form content, but it would be nice if someone could make it so that it sends a blind carbon copy of the email to the site admin so that one can track one's marketing efforts. Also, it would be nice if someone were to integrate this as an activity (I'd prefer this to a block) on the site front page, and one that could be used by any site visitor, not just registered ones.
Average of ratings: -
In reply to N Hansen

Re: Moodle Tell a Friend Script

by N Hansen -
Oops. Not quite ready for prime time-don't use it. I'll repost in a few minutes. 
In reply to N Hansen

Re: Moodle Tell a Friend Script

by N Hansen -
OK, well, it needs a modification that I don't know how to perform myself. I'd gotten confused because I had been playing with another taf script before this one that could do what I want, but the syntax is so different I can't figure out how to implement it in this script. Perhaps someone else knows how to code this?

What I want it to do is to check if someone has entered the optional message or not, and if not, to just send the default recommendation line. I want it to only say "Here is their personal message to you: $message" if they actually entered something in the message field.

Also, if someone does work on this, please correct the line "YOu can send an email to another friend if you want" to read "You can send an e-mail to another friend if you want."

In any case, I'll just leave the original file up and anyone who wants to take this one up can do so.
In reply to N Hansen

Re: Moodle Tell a Friend Script

by N Hansen -
Ignore all the previous messages entirely. I'm ditching this script altogether. There was another one from the same site I got the site feedback script from that I originally wanted to use but I was having problems with it. I wrote to the developer and I just got an email back from him saying that one of the files needed to be renamed. I've got it running now and it is a better script and so I am going to configure that one instead and post it.
In reply to N Hansen

Re: Moodle Tell a Friend Script

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
In future it might be better to keep the software on a site somewhere and just link to it. If you (or anyone developing Moodle plugins!) would like CVS access to the cvs:/contrib folder then just let me know.
In reply to Martin Dougiamas

Re: Moodle Tell a Friend Script

by N Hansen -
Sure, let me know what I need to do. I'm about to write the readme file for the new and improved tell a friend script right now so if you let me know where I can upload it I can put it there instead.
In reply to N Hansen

Re: Moodle Tell a Friend Script

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The CVS docs explain the process with full instructions ... the basics are easier than they might look at first, and there is plenty of payoff for getting CVS all set up properly.

Otherwise, just set up a page for your code on your site, much like Hannes recently did for a patch of his.
In reply to Martin Dougiamas

Re: Moodle Tell a Friend Script

by N Hansen -

I've created my account, but I'm at a loss regarding the following isntruction: "Take special note of the sourceforge instructions to create your CVS home directory - something you have to do with every new account to "enable" it for CVS. Basically you just have to use ssh to interactively connect to cvs.sourceforge.net."
In reply to N Hansen

Re: Moodle Tell a Friend Script (new script, ignore previous)

by N Hansen -
Here it is. Please ignore previous version. This is a totally different script with better features. If someone knows how to add it to cvs, go ahead and do so.
In reply to N Hansen

Re: Moodle Tell a Friend Script (new script, ignore previous)

by Jan Dierckx -

Hi N,

Thanks for your efforts on providing this script. Be warned though, PHP can get highly addictive smile

I installed it on a testserver to try it out. It seems you can bypass the form and automatically send emails by appending the data to the scriptname

Type in  http://www.nameofserver.com/tellfriend/tellfriendscript.php?friend_name=xxx&friend_email=xxx&recipient=xxx&message=xxx directly in the location bar of your browser and an email is on it's way.

A student with too much spare time could (as far as I know) use a script to loop through a list of email addresses and send lots of anonymous mails using your webserver.

Maybe you want to look further into this before using it on a production server. Have you removed parts of the code from the original?

In reply to Jan Dierckx

Re: Moodle Tell a Friend Script (new script, ignore previous)

by N Hansen -
I'm not worried about addiction. It's just I've had a very clear vision about what my site can do for a couple years now and I wasn't ready to rest until it could do those things. I really don't have an interest in programming, everything I know is learned by necessity.

I don't remember removing code-if anything, I added code. I added the function whereby it will also send a copy of the email to the admin, so if someone started doing this the admin would know fairly quickly at least. Even if they were anonymous emails, they would be anonymous emails recommending my site. It's not like it could easily be used to send emails with subject lines like "Cialis" and "Next of Kin in Nigeria."

I tried reading up on the vulnerability of php mail and it seems that it isn't really designed for spammers anyway because it has to send each email individually.

But perhaps if someone is able to integrate it more closely into Moodle, this problem could be avoided?

In reply to Jan Dierckx

Re: Moodle Tell a Friend Script (new script, ignore previous)

by N Hansen -
Jan-When I first woke up this morning I had an inspiration as to how to at least stop some stupid spammers from hijacking the page. This won't work if they have Javascript disabled in their browser, but it would probably foil some people from attempting to use the page in the manner you describe. I created some head tags in the tellafriend.php file (because I think it needs head tags to work), put my css link in there, and also added the Javascript in the attached files (sorry, I've got this crazy keyboard that doesn't let me type pointy brackets at all so it is easiest for me to provide it to you in an attached text file).

The "http://www.mysite.com/mod/resource/view.php?id=75" in the attached file is the path to the frames page that includes the tellafriend.php. Once I uploaded this, I tried accessing my page as you did, and it simply loaded the whole frames page, without the automatically filled in values.