TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

July 21, 2024, 01:53:15 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,333
  • Total Topics: 21,233
  • Online today: 103
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 74
  • Total: 75
  • @rjen

Invite A Friend Block [side block]

Started by akulion, April 12, 2007, 05:49:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

akulion

Demo: http://path-to-peace.com/forum2/

How To:

1 - Download image and php file attached

2 - Open php file and alter these lines:

<META HTTP-EQUIV=REFRESH CONTENT="6;URL=http://path-to-peace.com/community">

Replace the address with your homepage (this is where the redirect takes place after sending the email) - Also the 6 is the time in seconds it takes to redirect, you can change it if you want.

Also in the same file find:

if you are not diverted in 10 seconds please <a href='http://path-to-peace.com/community/'>

Replace the address for your own

3- Place the following code in a SCRIPT SIDE BLOCK

<form method=post action=tellck.php>
      <table  border="0" cellpadding="0" cellspacing="0" align=center>
<tr bgcolor='#96C33C'><td colspan=2 align=center><font face='Verdana' size='2' ><b>TELL A FRIEND</b></font></td></tr>

<tr><td width=120><font face='Verdana' size='2' >Your Name</font></td></tr><tr><td width=120><input type=text name=y_name></td></tr>
<tr><td><font face='Verdana' size='2' >Your Email</font></td></tr><tr><td><input type=text name=y_email></td></tr>
<tr ><td><font face='Verdana' size='2' >Your Friend's Name</font></td></tr><tr><td><input type=text name=f_name></td></tr>
<tr><td><font face='Verdana' size='2' >Friend's Email</font></td></tr><tr><td><input type=text name=f_email></td></tr>
<tr ><td><font face='Verdana' size='2' >Your Message</font></td></tr><tr><td><textarea name=y_msg rows=5 cols=20></textarea></td></tr>

<tr bgcolor='#96C33C'><td colspan=2 align=center><font face='Verdana' size='2' ><input type=submit value='Send'></font></td></tr>
</table>
</form>


4 - Recommended settings for block: Use frame but not title.

5 - Upload both files (1 image and 1 php file) attached to this post to your forum root (directory where your forum is installed)

6 - Activate the block and enjoy.


akulion

oh i nearly forgot...

in the PHP file this line defines what message to send

$header_message = "Peace $f_name \n Your friend $y_name has sent you the following message and requested you to visit the page at \n $ref \n";

Dont touch the variables starting with the $ sign, the rest u can change

rebelrose


madagascar

#3
I already implemented this feature but why i've got this error on my page before it will show my homepage?

Thanks.

ERROR:
"; $status= "NOTOK";} if (strlen($y_name) <2 ) { // checking your name $msg .="Please enter your name
"; $status= "NOTOK";} if (!stristr($f_email,"@") OR !stristr($f_email,".")) { // checking friends email $msg .="Your Friends address is not correct
"; $status= "NOTOK";} if (strlen($f_name) <2 ) { // checking freinds name $msg .="Please enter your friend's name
"; $status= "NOTOK";} if (strlen($y_msg) <2 ) { // checking Message details $msg .="Please enter your message details
"; $status= "NOTOK";} if($status=="OK"){ // all validation passed /////////// Sending the message starts here ////////////// $ref=@$HTTP_REFERER; /////Message at the top of the page showing the url//// $header_message = "Peace $f_name \n Your friend $y_name has sent you the following message and requested you to visit the page at \n $ref \n"; /// Body message prepared with the message entered by the user //// $body_message =$header_message."\n".$y_msg."\n"; $body_message .="\n "; //// Mail posting part starts here ///////// $headers=""; //$headers = "Content-Type: text/html; charset=iso-8859-1\n".$headers; // Un comment the above line to send mail in html format $headers4=$y_email; // Change this to change from address $headers.="Reply-to: $headers4\n"; $headers .= "From: $headers4\n"; $headers .= "Errors-to: $headers4\n"; $subject="Request to visit URL"; mail($f_email,$subject,$body_message,$headers); ////// Mail posting ends here /////////// echo "

Thank You, Your message has been emailed to $f_name
"; echo "
You are being redirected back to the main page, if you are not diverted in 10 seconds please click here

Or Click the back button on your browser to return to the previous page
"; //////////// Sending the message ends here ///////////// }else{// display the error message echo "
$msg
"; } ?>

GP

The script is not recognizing the form inputs when I try it.  Each time I get.....


Your email address is not correct
Please enter your name
Your Friends address is not correct
Please enter your friend's name


It works like a charm on Gobo's site.  What am I overlooking?  :-\

rebelrose


GP


rebelrose


jiminoregon

Quote from: GP on July 04, 2007, 04:05:54 AM
The script is not recognizing the form inputs when I try it.  Each time I get.....


Your email address is not correct
Please enter your name
Your Friends address is not correct
Please enter your friend's name


It works like a charm on Gobo's site.  What am I overlooking?  :-\


I'm getting the same result...have you come up with an answer Gobo?

Thanks,

Jim

arrisje

I tried this one to and did not work for me neither. My forum is using gmail. Is there a possibility to use that somewhere in this code?
Thanks for all the great help I have been getting on this board. :)
B.T.W. Here is my forum http://arrisje.110mb.com/Forum/index.php

jiminoregon

Quote from: arrisje on July 11, 2007, 11:53:44 PM
I tried this one to and did not work for me neither. My forum is using gmail. Is there a possibility to use that somewhere in this code?
Thanks for all the great help I have been getting on this board. :)
B.T.W. Here is my forum http://arrisje.110mb.com/Forum/index.php

Try this tellck.php...it worked for me...I put in your ip.

Jim

arrisje

Thanks Jim for the effort it still doesn't work. Still get that parse error ;(. Well it just have to go by word of mouth :0)

arrisje

Before I installed tiny portal I had invite mod installed on smf. For some odd reason the invite seem to have vanished. When I tried to uninstall it it would not let me it kept telling me errors. Anyways I downloaded it again from smf mods and reiinstalled ( mind you it did tell me that there are errors.) I figured well I am going to try it anyways. Everything or nothing lol. Installed it again and it works again. ;)

jiminoregon

Quote from: arrisje on July 13, 2007, 12:19:45 AM
Before I installed tiny portal I had invite mod installed on smf. For some odd reason the invite seem to have vanished. When I tried to uninstall it it would not let me it kept telling me errors. Anyways I downloaded it again from smf mods and reiinstalled ( mind you it did tell me that there are errors.) I figured well I am going to try it anyways. Everything or nothing lol. Installed it again and it works again. ;)

Cool...now check your error log...bet it's filling up with errors related to the mod...if it's the same error over and over...you might just need to chmod that file to 777...uninstall and reinstall.  Or you could just ignore them if they're not causing a problem...

Good Luck,

Jim

Polymath

I know this is old, But I am making another website using another script. This works/instals apart from the validating

Your email address is not correct
Please enter your name
Your Friends address is not correct
Please enter your friend's name
Please enter your message details

Anybody fix this at all?

IchBin

Did you look at the other script that was posted in this topic?

Polymath

#16
Yep. There was nothing different in it from the first. I looked for this IP part that they added but didn't see it. Also all that was trying to fix was the page URL I think, not validating that the form was filled out.

And hello IchBin. Good to see others still here too from a long time ago.

Polymath

This is fixed rewrote some of it from bits and pieces from the net

darkacex

I tried inviting myself and it didn't work o_o

Skb

I used this snippet to create a Tell a Friend Block. I've managed the display & send mail. After sending the mail the thank you page appears, and redirects the member to the site index, but as logged out. However, if the "click here" link is clicked, the member is able to go back to forum index as logged in. ////// Mail posting ends here ///////////
echo "<center><font face='Verdana' size='2' ><img src='Email024.gif'><br>Thank You, Your message has been emailed to $f_name</font></center>";
echo "<br><center>You are being redirected back to the main page, if you are not diverted in 10 seconds please <a href='http://www.diabetic.pub/forum/index.php'>click here</a></center><br><center>Or Click the back button on your browser to return to the previous page</center>";
//////////// Sending the message ends here /////////////
}else{// display the error message
echo "<center><font face='Verdana' size='2' color=red>$msg</font></center>";

Anything I can do to make this work ?

SMF 2.1 RC4 (default theme) / TP 2.1.0

Skb

I solved the problem, by editing the tellck.php file. For anyone else who might need the solution.
META HTTP-EQUIV=REFRESH CONTENT="6;URL=http://www.diabetic.pub/forum//index.php?
Just remove the "?" at the end of the code. I don't know how it got inserted there in the first place. It led to the user getting logged out of the forum, though being redirected to the index page.

SMF 2.1 RC4 (default theme) / TP 2.1.0

VladTepes

Does this work now, and is the script attached to the OP the current / correct one?