fraugefahr
Joined: 28 Jan 2004 Posts: 1
|
Posted: Wed Jan 28, 2004 7:37 pm Post subject: Mailto Link |
|
|
I added a mailto link so that when message are displayed to the editor, there is a link that they can click on to mail post to the email list.
I am using b2 for the owner of a business to post news about the business, specials, etc on her web site, and also set up an email list that people can sign up for if they want to get the news by email. This link allows her to write the news and then click on the "Email to List" link next to the news which pops the news up in her email cilent with the Title as the subject, conent in the body, and the email list address already in the To: field.
It's really simple.
1) In b2-include, open up b2edit.showposts.php.
2) Look for this bit of code:
echo " - <a href=\"b2edit.php?action=delete&post=".$postdata["ID"]."\" onclick=\"return confirm('You are about to delete this post \'".$row->post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete</a> ";
}
?>
]
3) Right after that bit of code, add this:
<?php
$new_content= preg_replace('/<br( )?(\/)?>/i', '%0D%0A', $postdata[Content]);
$new_content = strip_tags("$new_content");
echo " * <A HREF=\"MAILTO:[email protected]?SUBJECT=$postdata[Title]&BODY=$new_content\">Email to List</a> * ";
?>
4) Replace "[email protected]" with the email address of your mailing list.
5) Now, you will see this link next to all of the posts you have entered in your blog, so you can quickly shoot them off to your email list without tedious cutting and pasting.
-Kristen |
|