I have a Tell A Friend Block, that send up to three email, to tell a friend about your site. If anyone is intered in the code. You have to have custom mod installed for this to work. A member on my forum showed this to me.
You can see it work here Forum (http://www.rebelrosenetworks.com/forum/index.php)
That looked really nice, i love the image you use in the tell a friend block :)
Thank you Mrs G6
Very nice, do you have the code you can share?
This is how it works:
First you have to download and install the "custom actions" mod
then after that you go and create a javascript/html bloc telling people about it
the code I use for it is this:
<div align="center"><a href="http://yoursite.com/forum/index.php?action=tellafriend"><img
src="http://yoursite.com/forum/Themes/yourtheme/images/friends.gif" width="125" height="125"
border="0" /></a></div>
then you go into the admin and custom actions and create 2 pages - both are HTML
first the "tell a friend" page:
<html>
<head>
<title>tell a friend</title>
<script language="javascript">
<!--
function reset() {
document.tellafriend.name.value="";
document.tellafriend.email.value="";
document.tellafriend.friendmail1.value="";
document.tellafriend.friendmail2.value="";
document.tellafriend.friendmail3.value="";
}
function validate() {
if (document.tellafriend.friendmail1.value.length==0) {
alert("please enter your friend's email address");
return false;
}
if (document.tellafriend.email.value.length==0) {
alert("please enter your email address");
return false;
}
if (document.tellafriend.name.value.length==0) {
alert("please enter your name");
return false;
}
document.tellafriend.submit()
return true;
}
//-->
</script>
</head>
<body onload="reset()" topmargin="0" leftmargin="0">
<center>
</center>
<table width="500" cellpadding="0" cellspacing="0" align="center">
<tr valign="top">
<td valign="middle" align="center"><img
src="http://www.yoursite.com/forum/Themes/yourtheme/images/tell.gif" width="500" height="100"></td>
</tr>
<tr valign="top">
<td valign="middle" align="center"> <p><font color="#000099" size="4" face="Arial">Complete
the details below to send our link to your friends.</font></p>
<form name="tellafriend"
action="http://www.yoursite.com/forum/Themes/yourtheme/tellafriend.php" method="post"
onsubmit="return checkfields()">
<div align="center">
<center>
<table width="500" border="0" cellpadding="10" cellspacing="0">
<tr>
<td><strong><font color="#000099" size="2" face="Arial"> *your
name:</font></strong></td>
<td> <strong><font color="#000099" size="2" face="Arial">
<input size="30" name="name" maxlength="45">
</font></strong></td>
</tr>
<tr>
<td><strong><font color="#000099" size="2" face="Arial">*your
email:</font></strong></td>
<td> <strong><font color="#000099" size="2" face="Arial">
<input size="30" name="email" maxlength="45">
</font></strong></td>
</tr>
<tr>
<td colspan="2"> <p align="center"><font color="#000099"><strong><font size="2"
face="Arial">please
enter your friend's email addresses:</font></strong></font></td>
</tr>
<tr>
<td><strong><font color="#000099" size="2" face="Arial">*email
1:</font></strong></td>
<td> <strong><font color="#000099" size="2" face="Arial">
<input size="30" name="friendmail1" maxlength="45">
</font></strong></td>
</tr>
<tr>
<td><strong><font color="#000099" size="2" face="Arial">email
2:</font></strong></td>
<td> <strong><font color="#000099" size="2" face="Arial">
<input size="30" name="friendmail2" maxlength="45">
</font></strong></td>
</tr>
<tr>
<td><strong><font color="#000099" size="2" face="Arial">email
3:</font></strong></td>
<td> <strong><font color="#000099" size="2" face="Arial">
<input size="30" name="friendmail3" maxlength="45">
</font></strong></td>
</tr>
<tr>
<td colspan="2"> <p align="center"><font color="#000099"><strong><font size="2"
face="Arial">
The email that will be sent will contain your name and email
address. <br>
<input onclick="validate();" type="button" value="click here to send">
</font></strong></font></td>
</tr>
</table>
</center>
</div>
</form></td>
</tr>
<tr valign="top">
<td valign="middle" align="center"> </td>
</tr>
</table>
</body>
</html>
then the thank you page:
<html>
<head>
</head>
<body onload="reset()" topmargin="0" leftmargin="0">
<center>
</center>
<table width="500" cellpadding="0" cellspacing="0" align="center">
<tr valign="top">
<td valign="middle" align="center"> </td>
</tr>
<tr valign="top">
<td valign="middle" align="center"><img src="http://yoursite.com/myimages/thankyou.gif" width="400"
height="300"></td>
</tr>
<tr valign="top">
<td valign="middle" align="center"> </td>
</tr>
</table>
</body>
</html>
NOW you need to create a php file for the whole thing to work and name it "tellafriend.php"
you load this to your theme folder
the file should contain this info:
<?PHP
// This following statement must be left intact.
// Taming The Beast Tell-A-Friend script V 1.2
// Taming the Beast.net - http://www.tamingthebeast.net
// Free Web Marketing and Ecommerce Resources
// By using this code you agree to indemnify
// Taming the Beast from from any liability that might arise
// from it's use.
// This following statement must be left intact.
# This section removes any nasty tags that the user may
# have input into any of the form fields
strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($friendmail3);
strip_tags($email);
strip_tags($name);
# This section sends you a notification email when
# the form is used
// Your email address (for copies to be sent to you)
$emailto = "you@yoursite.com";
// Your email subject text
$esubject = "a page has been sent";
// The email text for copies sent to you
$emailtext = "
".$name." has used the tell-a-friend form. Their email address is ".$email."
The people they have recommended are:
".$friendmail1."
".$friendmail2."
".$friendmail3."
";
# Send the email to you
@mail("$emailto", $esubject, $emailtext, "From: $email");
## This section sends to the recipients
// Target page after successful submission
$thankyoupage = "http://yoursite.com/forum/index.php?action=thankyou";
// Change the subject text below to suit
$tsubject = "Come join me at the your Forum";
// Change the text below for the email
$ttext = "
Hi,
A friend yours, ".$name.", whose email address is ".$email." thought you may like to visit our forum!! ".$name." has used our Tell-a-Friend form to send you this
email.
http://yoursite.com/forum/
";
# This sends the email to the addresses entered
@mail("$friendmail1,$friendmail2,$friendmail3", $tsubject, $ttext, "FROM: $email");
# After submission, the target URL
header("Location: $thankyoupage");
exit;
?>
Just be sure to change any image, url and information to your own.
We work on all kind of modification on our Tiny Portals, I love Tiny Portal
Quote from: RebelRose on August 29, 2006, 07:49:44 PM
We work on all kind of modification on our Tiny Portals, I love Tiny Portal
Very cool, thanks!
your welcome
Question, I installed the custom action mod, but do not see this in the admin area, what should I be looking for?
To create the 2 pages for this snippet.
Cheers,
GB
Quote from: Greenbug on August 31, 2006, 04:15:39 AM
Question, I installed the custom action mod, but do not see this in the admin area, what should I be looking for?
I don't understand what you mean by what you should be looking for?
If you mean the area to do custom mods then look in the control panel under features and options and you will see custom actions.
I gotcha, thanks.
I wasnt sure where I should be looking.
GB
Glad to help, let me know if you need more help.
Well Im not sure why but its loads so slowly since I did this, any ideas why?
It will load though but it takes 30 secs to load front page.
And of course as soon as I say something it works fine.
Thanks your thought process has fixed my site. WOW incredible.
GB
http://www.americasforum.org/index.php
how about a link for a look see
I spoke to soon, I have checked the code and I do not see www.yoursite.com?action=thankyou anywhere but I end up on yoursite.com none the less
When would this be on the closing post statement?
again I found it,
"come join me at the smurf talk forum" LMAO!!!
Did you create the thank you page?
Yes check the code really well and make sure you put all your site information in.
So if I use the theme chooser option then I will need to do this to every theme I have, right?
Hmm looks like maybe 2 themes for my site.
This is a Tiny Portal add on Block, It should be fine when you change themes as should all the other TP Blocks
The reason I ask is I remember seeing the action="http://www.americasforum.org/**Themes/amber/**tellafriend.php" method="post"
I removed the Theme/amber and put theÃ, tellafriend.php in the root?
Ahhh it doesnt matter the file will still be in that directory regardless of the theme its currently in.
All I did was exactly what I posted and it works great.
I did visit your site and choose different themes and it still showed up as I knew it would. But just to let you know.
I dont really understand completely what I am doing and was confused about the path being wrong because I had used the Themes/themname/tellafriend.php but even if I was in another them that link would be correct since that file is really there. That had me going there for a minute.
I chenged what I needed to and it also works great for me,
Thanks!
GB
lol, glad you got it figured out. The link will work with whatever theme you have on there.
Nice work...Works perfectly!
Thank You
hrm... isnt there a easier way of doing this... :/ im a noob at code :/
ok i have it set up but its not working when i send a email to some one they never get it.
but i do but this this is all i get
Quotehas used the tell-a-friend form. Their email address is
The people they have recommended are:
Did you change all the information in the code to point to your site? For example:
<form name="tellafriend" action="http://www.yoursite.com/forum/Themes/yourtheme/tellafriend.php" method="post"
yes i did all that.
but i did find out that I'm getting a mailer demon on my sever say that there was a email address add even tho there was.
greetings,
it looks really nice, but i can't make it work on my site; it doesn't send the message.
but it shows the thankyoupage and sends me an email as an administrator (a copy of the message) but it's empty '(unknown sender)'.
thank you in advance.
Quote from: ©RebelRose on August 29, 2006, 07:11:25 PM
I have a Tell A Friend Block, that send up to three email, to tell a friend about your site. If anyone is intered in the code. You have to have custom mod installed for this to work. A member on my forum showed this to me.
You can see it work here Forum (http://www.rebelrosenetworks.com/forum/index.php)
I know this is an old topic but I seem to be having the same problem, I went through everything line by line to no avail.
I get the E-mail saying it was used, but the people I sent it to does not receive the e-mail.
I get this in the E-mail.
"has used the tell-a-friend form. Their email address is
The people they have recommended are:"
Any ideas?
Hi,
Can anyone help me?
Hi have made all the steps in the first post, but give me an error:
QuoteWarning: Cannot modify header information - headers already sent by (output started at /home/techtuga/public_html/forum/tellafriend.php:1) in /home/techtuga/public_html/forum/tellafriend.php on line 67
Thank´s
I tink that the error it´s a conflict whith the thank you mod.
Because the last html page, call the function thankyou.
Heya Im pretty sure ive entered all information required, everything works included the confirmation email to myself when someone sends an invitation, the only problem is that no invitation seems to get sent!
If someone could take the time to look at the following do double check for me, would appreciate that alot!
Quote<?PHP
// This following statement must be left intact.
// Taming The Beast Tell-A-Friend script V 1.2
// Taming the Beast.net - http://www.tamingthebeast.net
// Free Web Marketing and Ecommerce Resources
// By using this code you agree to indemnify
// Taming the Beast from from any liability that might arise
// from it's use.
// This following statement must be left intact.
# This section removes any nasty tags that the user may
# have input into any of the form fields
strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($friendmail3);
strip_tags($email);
strip_tags($name);
# This section sends you a notification email when
# the form is used
// Your email address (for copies to be sent to you)
$emailto = "mail.final@virgin.net";
// Your email subject text
$esubject = "a page has been sent";
// The email text for copies sent to you
$emailtext = "
".$name." has used the tell-a-friend form. Their email address is ".$email."
The people they have recommended are:
".$friendmail1."
".$friendmail2."
".$friendmail3."
";
# Send the email to you
@mail("$emailto", $esubject, $emailtext, "From: $email");
## This section sends to the recipients
// Target page after successful submission
$thankyoupage = "http://www.dcpryzom.co.uk/forum/index.php?action=Thank%20You";
// Change the subject text below to suit
$tsubject = "Invitation to join DCP!!!";
// Change the text below for the email
$ttext = "
Hi,
A friend of yours, ".$name.", whose email address is ".$email." thought you may like to visit our forum!! ".$name." has used our Tell-a-Friend form to send you this
email.
Join us in Ryzom, World of Warcraft and many other games on multiple platforms.
Visit our site for more info.
www.dcpryzom.co.uk/forum";
# This sends the email to the addresses entered
@mail("$friendmail1,$friendmail2,$friendmail3", $tsubject, $ttext, "FROM: $email");
# After submission, the target URL
header("Location: $thankyoupage");
exit;
?>
Tell a friend page:
Quote<title>tell a friend</title>
<script language="javascript">
<!--
function reset() {
document.tellafriend.name.value="";
document.tellafriend.email.value="";
document.tellafriend.friendmail1.value="";
document.tellafriend.friendmail2.value="";
document.tellafriend.friendmail3.value="";
}
function validate() {
if (document.tellafriend.friendmail1.value.length==0) {
alert("please enter your friend's email address");
return false;
}
if (document.tellafriend.email.value.length==0) {
alert("please enter your email address");
return false;
}
if (document.tellafriend.name.value.length==0) {
alert("please enter your name");
return false;
}
document.tellafriend.submit()
return true;
}
//-->
</script>
</head>
<body onload="reset()" topmargin="0" leftmargin="0">
<center>
</center>
<table width="500" cellpadding="0" cellspacing="0" align="center">
<tr valign="top">
<td valign="middle" align="center"><img
src="http://www.finalonline.co.uk/mypics/ryzom/recruit.gif" width="468" height="85"></td>
</tr>
<tr valign="top">
<td valign="middle" align="center"> <p><font color="#666666" size="4" face="Arial">Complete
the details below to send our link to your friends.</font></p>
<form name="tellafriend"
action="http://www.dcpryzom.co.uk/forum/Themes/df_tp/tellafriend.php" method="post"
onsubmit="return checkfields()">
<div align="center">
<center>
<table width="500" border="0" cellpadding="10" cellspacing="0">
<tr>
<td><font color="#666666" size="2" face="Arial"> *your
name:</font></td>
<td> <font color="#666666" size="2" face="Arial">
<input size="30" name="name" maxlength="45">
</font></td>
</tr>
<tr>
<td><font color="#666666" size="2" face="Arial">*your
email:</font></td>
<td> <font color="#666666" size="2" face="Arial">
<input size="30" name="email" maxlength="45">
</font></td>
</tr>
<tr>
<td colspan="2"> <p align="center"><font color="#666666"><font size="2"
face="Arial">please
enter your friend's email addresses:</font></font></td>
</tr>
<tr>
<td><font color="#666666" size="2" face="Arial">*email
1:</font></td>
<td> <font color="#666666" size="2" face="Arial">
<input size="30" name="friendmail1" maxlength="45">
</font></td>
</tr>
<tr>
<td><font color="#666666" size="2" face="Arial">email
2:</font></td>
<td> <font color="#666666" size="2" face="Arial">
<input size="30" name="friendmail2" maxlength="45">
</font></td>
</tr>
<tr>
<td><font color="#666666" size="2" face="Arial">email
3:</font></td>
<td> <font color="#666666" size="2" face="Arial">
<input size="30" name="friendmail3" maxlength="45">
</font></td>
</tr>
<tr>
<td colspan="2"> <p align="center"><font color="#666666"><font size="2"
face="Arial">
The email that will be sent will contain your name and email
address.
<input onclick="validate();" type="button" value="click here to send">
</font></font></td>
</tr>
</table>
</center>
</div>
</form></td>
</tr>
<tr valign="top">
<td valign="middle" align="center"> </td>
</tr>
</table>
</body>
</html>
Thank you page
Quote<html>
<head>
</head>
<body onload="reset()" topmargin="0" leftmargin="0">
<center>
</center>
<table width="500" cellpadding="0" cellspacing="0" align="center">
<tr valign="top">
<td valign="middle" align="center"> </td>
</tr>
<tr valign="top">
<td valign="middle" align="center"><img src="http://www.finalonline.co.uk/mypics/ryzom/thankyou.gif" width="250"
height="250"></td>
</tr>
<tr valign="top">
<td valign="middle" align="center"> </td>
</tr>
</table>
</body>
</html>
Hi, i have the same problem as whocares.. I do receive an mail that someone has recoomended the site.. but in not in detail.. i get the same message :
"has used the tell-a-friend form. Their email address is
The people they have recommended are:"
also i have send a test e-mail.. i do not seem to receive the recommendation.
does anybody know what could be wrong?
I would check with your host to see if they have disabled the PHP mail function.
oke.. i run my own server.. :D how should i check this?
Look at your PHP configuration and see. This isn't a PHP server site. You should be able to find everything you need with a google search. You can start with this page that might help you.
www.php.net/phpinfo
Otherwise, you need to look in your php.ini file.
oke.. thank you :) i will do that
hi... the hosting company who i rent the connection from has checked every setting and made php test mails. Al these settings seme to be correct, so in there eyes it has to do something with the script
Take the @ sign off of this line and see if it gives you any error when submitting the form again.
@mail("$friendmail1,$friendmail2,$friendmail3", $tsubject, $ttext, "FROM: $email");
nope.. did not work :(
Looks like you'll have to skip using this scrip then.
yes.. i guess so.. thank you for helping out though :D
hello... A friend helpt me with this problem, since i really wanted this feature.... he told me to do this:
Find:
strip_tags($friendmail1);
Replace:
if (!empty($_POST['friendmail1']))
$friendmail1 = $_POST['friendmail1'];
if (!empty($_POST['friendmail2']))
$friendmail2 = $_POST['friendmail2'];
if (!empty($_POST['friendmail3']))
$friendmail3 = $_POST['friendmail3'];
if (!empty($_POST['email']))
$email = $_POST['email'];
if (!empty($_POST['name']))
$name = $_POST['name'];
strip_tags($friendmail1);
and it works like a charm!!
So.. thanks Sinan!
Nice Lafemme.
Bit late but it now works for me. Thanks
Your welcome :)
... but... better late then never ;)
Old thread I know, but all information is here.
More out of curiosity as mine is being used for spam. The name is a title, the from email is the one it is going to..and the friends emails are the same.
Example:
Quotebuy dirt cheap airline tickets has used the tell-a-friend form. Their email address is ewrwrw-3323@gmail.com
The people they have recommended are:
ewrwrw-3323@gmail.com
ewrwrw-3323@gmail.com
ewrwrw-3323@gmail.com
So what I want to know is there any security for it or is that it... remove?
With this code, it looks like the only thing you could do is make the pages viewable only by members, which would probably help.
Ahh right..yeah thank you. I had to do that with my contact page a long time ago.
Cheers