Send to Friend Module/Script
Send to Friend Module/Script
Hi,
I had look in the Development area for a Send to Friend module but could not find one. Does anyone know of a module or script that sends the current page URL to a specified email address, perhaps with a small message, using CMSMS?
Thank you
I had look in the Development area for a Send to Friend module but could not find one. Does anyone know of a module or script that sends the current page URL to a specified email address, perhaps with a small message, using CMSMS?
Thank you
Re: Send to Friend Module/Script
Hi,
It seems that this TAG needs to be included on every page for it to capture the URL, however I use an "Email" icon on top of each page which reads "Send to Friend" - how do I use the TAG so that it is not apparent on each page until the user clicks on the "Send to Friend" icon and then perhaps the form opens in a new window or even a new page but caputring the URL of the page they just came from - does that make sense?
Here is my site: www.jenniemarshtrust.org
Thanks
It seems that this TAG needs to be included on every page for it to capture the URL, however I use an "Email" icon on top of each page which reads "Send to Friend" - how do I use the TAG so that it is not apparent on each page until the user clicks on the "Send to Friend" icon and then perhaps the form opens in a new window or even a new page but caputring the URL of the page they just came from - does that make sense?
Here is my site: www.jenniemarshtrust.org
Thanks
Re: Send to Friend Module/Script
I put it next to the print-icon in the template, so I don't need to repeat it on every page. I also tweaked it to give back the referring instead of the current page.
Check:
http://forum.cmsmadesimple.org/index.ph ... l#msg54035
Ronny
Check:
http://forum.cmsmadesimple.org/index.ph ... l#msg54035
Ronny
Re: Send to Friend Module/Script
Hey RonnyK,
Much appreciated and very helpful post. However, I tried to change my PHP but it broke the entire TAG, I think I may have not changed the PHP correctly. Would it be possible to post your TAG/PHP here so that I can copy into mine? I understand the icon thing, thats exactly what I want to do, but I can not get the PHP working, any help would be great!
Thank you.
Much appreciated and very helpful post. However, I tried to change my PHP but it broke the entire TAG, I think I may have not changed the PHP correctly. Would it be possible to post your TAG/PHP here so that I can copy into mine? I understand the icon thing, thats exactly what I want to do, but I can not get the PHP working, any help would be great!
Thank you.
Last edited by asim on Thu May 10, 2007 11:47 am, edited 1 time in total.
Re: Send to Friend Module/Script
I'll post it later, as I'm on a location right now, where I don't have access to the FTP, so I can't check the scripts-folder.
Ronny
Ronny
Re: Send to Friend Module/Script
Thanks matey. Just so I can make sure I was doing the correct thing. According to your original post,
http://forum.cmsmadesimple.org/index.php/topic,8698.msg54035.html#msg54035
Do I change all mention "REQUEST_URI" to
OR is it just a specifc tag I change?
Thanks
http://forum.cmsmadesimple.org/index.php/topic,8698.msg54035.html#msg54035
Do I change all mention "REQUEST_URI" to
Code: Select all
$pageURL .= $_SERVER["HTTP_REFERER"];
Thanks
Re: Send to Friend Module/Script
I added the line after the original piece of code, to switch it to the reffering page, it should work if you put this single line just below the four/five lines concerning the original logic.
I left the original lines there, just added this line, to switch the "variable" from current to referring page.
Ronny
I left the original lines there, just added this line, to switch the "variable" from current to referring page.
Ronny
Re: Send to Friend Module/Script
Hi Ronny,
I still can not get it to work, below I have copied my code, I have also put in the comment "// RONNYK's SUGGESSTION:" this where I putted your code change, is this corrcect?
I still can not get it to work, below I have copied my code, I have also put in the comment "// RONNYK's SUGGESSTION:" this where I putted your code change, is this corrcect?
Code: Select all
$errors=$to=$name=$email=$message = '';
$pageURL = "\r\n\r\nhttp";
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
// RONNYK's SUGGESSTION:
$pageURL .= $_SERVER["HTTP_REFERER"];
$message = $canned . $pageURL ;
if($_SERVER['REQUEST_METHOD']=='POST'){
if (!empty($_POST['subject'])) $subject = tafsanitize($_POST['subject']);
if (!empty($_POST['to'])) $to = tafsanitize($_POST['to']);
if (!empty($_POST['name'])) $name = tafsanitize($_POST['name']);
if (!empty($_POST['email'])) $email = tafsanitize($_POST['email']);
if (!empty($_POST['canned'])) $canned = $_POST['canned'];
if (!empty($_POST['message'])) $message = $_POST['message'];
if (FALSE == empty($params['captcha']) && $params['captcha'] && isset($gCms->modules['Captcha']))
{
if (!empty($_POST['captcha_resp'])) { $captcha_resp = $_POST['captcha_resp']; }
}
//Mail headers
Re: Send to Friend Module/Script
The snippet of my code:
The part with "#" was the original, which I commented out, to be replaced with the referring page.
Ronny
Code: Select all
# $pageURL = "\r\n\r\nhttp";
# if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
# $pageURL .= "://";
# if ($_SERVER["SERVER_PORT"] != "80") {
# $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
# } else {
# $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
# }
$pageURL .= $_SERVER["HTTP_REFERER"];
Ronny