Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Tell a friend
Goto page 1, 2, 3  Next
 
Reply to topic    Forum Index » Suggestions View previous topic
View next topic
Tell a friend
Author Message
Miro



Joined: 05 Apr 2006
Posts: 43

Post Tell a friend Reply with quote
I wonder if it's possible to send an article to someone (Tell a friend)?
Thu Apr 13, 2006 12:29 am View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
What exactly do you have in mind? What should it be like? Do you want it to send a link to the story or the story itself to the friend?
Thu Apr 13, 2006 1:38 pm View user's profile Send private message
Miro



Joined: 05 Apr 2006
Posts: 43

Post Reply with quote
a link to the story will be nice Smile
Thu Apr 13, 2006 2:34 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
1. Put a file mail_to_friend.php in your main CuteNews.Ru directory and put this in:

Code:
<?php

if($_POST['dosend'] == "yes"){



//Config subject

$subject = "Interesting article.";

//Config message

$message = "Hello {friend},\n\n";

$message .= "I found an interesting article:\n";

$message .= "Please check it out yourself: {url}\n\n";

$message .= "Best regards,\nYour name";

//Config mail

$mail_from = "yourmail@yourdomain.com";

//



   $friend = $_POST['friend'];

   $mail = $_POST['mail'];

   $url = $_GET['url'];

   $error = false;

   if($friend == "" or $mail == ""){

      $error = "Error! At least one field is empty. Please go back and fill out all the fields.";

   }



   $message = str_replace("{friend}", $friend, $message);

   $message = str_replace("{url}", $url, $message);



   $headers = 'From: '.$mail_from."\n";

   $headers .= 'Reply-to: '.$mail_from."\n";

   $headers .= 'Return-Path: '.$mail_from."\n";

   $headers .= 'Message-ID: <'.md5(uniqid(time())).'@'.$_SERVER['SERVER_NAME'].">\n";

   $headers .= 'MIME-Version: 1.0'."\n";

   $headers .= 'Content-type: text/plain'."\n";

   $headers .= 'Content-transfer-encoding: 7bit'."\n";

   $headers .= 'Date: '.gmdate('D, d M Y H:i:s', time())."\n";

   $headers .= 'X-Priority: 3'."\n";

   $headers .= 'X-MSMail-Priority: Normal'."\n";



   if(!$error){

   mail($mail, $subject, $message, $headers);

   echo "Thank you.<br />";

   echo "The message was sent to ".$friend." (".$mail.")<br /><br />";

   echo '<a href="javascript:window.close();">Close window</a>';

   }

   else echo $error;

}



else{

?>

<form action="" method="post">

<table>

<tr><td>Name:</td><td><input type="text" name="friend"></td></tr>

<tr><td>E-mail:</td><td><input type="text" name="mail"></td></tr>

<tr><td colspan="2"><input type="submit" value="Tell-a-Friend"></td></tr>

<input type="hidden" name="dosend" value="yes">

</table>

</form>

<?

}



?>




2. Change the configuration at the top of this file.



3. Add this to your template:

Code:
<a onclick="window.open('{cutepath}/mail_to_friend.php?url={link=home/post}','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,width=370,height=285')" href="javascript:void(0);" title="Tell_a_Friend."><b>Mail to friend</b></a>




Hope it works - I didn't really test it.


Last edited by FI-DD on Wed Apr 25, 2007 6:22 pm; edited 2 times in total
Thu Apr 13, 2006 4:15 pm View user's profile Send private message
Miro



Joined: 05 Apr 2006
Posts: 43

Post Reply with quote
Thank you FI-DI

but why I get this message after clicking the link:



Code:
Warning: Cannot modify header information - headers already sent by

(output started at /usr/home/web/mail_to_friend.php:2)

in /usr/home/web/mail_to_friend.php on line 34




and the message will not be sent.
Fri Apr 14, 2006 5:34 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Did you add something to the code of mail_to_friend.php?
Sat Apr 15, 2006 3:41 pm View user's profile Send private message
Miro



Joined: 05 Apr 2006
Posts: 43

Post Reply with quote
nothing in the php codes. Only style sheets in the form.
Sat Apr 15, 2006 4:45 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
I changed the code above. Please try again.
Sun Apr 16, 2006 5:54 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Wow Shocked that's a lot fancier than I do that. I just use <textarea>'s for that and put the code between the textarea commands.. like:



Link to this: <textarea><a href="{home=link/post}" target="_blank">{title}</a></textarea>



Well I use that in the full story and then it fills itself out accordingly to the viewers when they go to the full story. That seems good enough for me. Is there a way to have it display JUST the URL in a textarea? If I put {home=link/post} do you think it would show just the URL? I haven't tried. I've only used {home=link/post} in an href... I'm not even sure if I'm writing that command right.. going from memory.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Jun 09, 2006 12:51 pm View user's profile Send private message Visit poster's website AIM Address
Falconer



Joined: 01 Feb 2006
Posts: 50

Post Reply with quote
Works fine but it would be even better if the person who sends it, can add his name to it too, and perhaps give a small comment. Smile



Ah, it's not so hard to add that. Works great now.
Sat Jun 17, 2006 7:11 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
You can add all sorts of ways to have 'tell your friends' things in your full story template. If you'd like I can find my code for aol IM and it would generate a message automatically so when you typed a screen name and hit send it would send a message to that person and say "Come check a href="{link=home/post}" target="_blank" this post /a out! You know what I mean? I had it in a textarea. Usually now though I just make textareas in the full story that say



Link to full story:

Text Link:



<textarea><a href="{link=home/post}" target="_blank">{title}</a></textarea>



I do lots of media sites so my full story is always just some embed code to some flash, video, or picture element.. so that's easy to make a copy and pastable textarea for:



Embed Link:

<textarea><a href="{link=home/post}" target="_blank">{title}</a><br>{full-story}<br><a href="http://www.yoursite.com" target="_blank">I got this from www.yoursite.com!</a></textarea>



The person would copy and paste that and it would obviously show the title on top of the embedded file with a link to the full story on your site, then show underneath the embedded element perfectly and then underneath give you credit and show a link back to the main page of your site. Fun things like that.



I'll see if I can work a mailer too so you could automatically mail things to people with the click of a button. That would be real nice... oh looks like there is the source above for that one. I'm gonna try that out.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Sun Jul 16, 2006 2:18 pm View user's profile Send private message Visit poster's website AIM Address
ksen



Joined: 04 Jun 2006
Posts: 142

Post Reply with quote
hi dere,

did anyone try the code above?? for some reason it doesnt seem towork on mine!! the only change made was to change the senders email!!

Thanx
Fri Aug 25, 2006 5:17 pm View user's profile Send private message
ksen



Joined: 04 Jun 2006
Posts: 142

Post Reply with quote
i dont get any error messages as uch, instead i get a msg saying the message was successfully sent to the email address i specified. But the problem is i dont get a email with the url!!!



Any ideas pls??



thanx
Fri Aug 25, 2006 6:51 pm View user's profile Send private message
ksen



Joined: 04 Jun 2006
Posts: 142

Post Reply with quote
Hi, any help pls?? i tryd my best cudnt figure out any error...

Pls?? Thanx so much
Sun Aug 27, 2006 4:35 am View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
ksen wrote:
i dont get any error messages as uch, instead i get a msg saying the message was successfully sent to the email address i specified. But the problem is i dont get a email with the url!!!


I guess it's in the spam folder then.
Tue Aug 29, 2006 7:47 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Suggestions All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.