Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
sqzdog
Involved
Involved



Joined: Sep 22, 2003
Posts: 252

PostPosted: Sat Aug 27, 2005 8:42 pm Reply with quote

I found this script by Raven but no readme to go with it. I've had it saved on my computer for sometime. I think it notifies newsletter subscribers each time a new story is posted. Unfortunately, I don't know how where to place it or how to activate it. Here it is:

Quote:
<?
/******************************************************************************************/
/* Author : J.B. Jones, (jamdung92@yahoo.com, based heavily on commentNotification hack */
/* by Gaylen Frayley (aka Raven) at http://www.ravenphpscripts.com; */
/* 'While' loop code for sending email copied from newsletter module */
/* in PHP-Nuke 6.5 */
/* Date : February 5, 2004 */
/* Purpose : When an admin posts a new news item, an email will be sent to all users who */
/* have subscribed to the newsletter. This may be useful for family sites and */
/* other sites where people aren't in the habit of checking the site on a */
/* daily basis and would therefore appreciate an email telling them that the */
/* site has been updated with new news. */
/* Warranty: None - use at your own risk Laughing (Tested on Nuke 6.5 and 6.9 only) */
/* */
/* Thanks to Raven and to Nukecops for helping out with this */
/******************************************************************************************/

/* Change the values of the following variables to reflect what you want in the email */

/* Don't change the emailMsgPreTxt2 variable unless you DO NOT want the title of the */
/* newly posted article included in the email */

$emailFromTitle = 'Your site Updates'; //Message displayed in the 'From' field
$emailSubject = 'Your site Has Been Updated!'; //Subject displayed in the email
$emailMsgPreTxt = ''.$author.' has posted a news article entitled:'; //First paragraph of email-who submitted the news item
$emailMsgPreTxt2 = $subject; //Title of the submitted news item that was just posted
$emailMsgPreTxt3 = 'on Your Site.com.'; //Last line of the email message
$viewTheArticle = "---------\n\nView the Article:"; //Link to the news module of the website (not to a specific article)

/* Change the next 5 lines only if you want to change the email format */

global $user_prefix, $sitename, $dbi, $nukeurl, $adminmail;
$msg = "\n\n$emailMsgPreTxt\n\n$emailMsgPreTxt2\n\n$emailMsgPreTxt3";
$msg .= "\n\n$viewTheArticle\n$nukeurl/modules.php?name=News";
$headers = "From: $emailFromTitle <$adminmail>\n";
$headers .= "Reply-To: $adminmail\n";

/* You should not need to change any of the following lines */

$result = sql_query("select user_email from ".$user_prefix."_users where newsletter='1'", $dbi);
while(list($user_email) = sql_fetch_row($result, $dbi)) {
mail($user_email, $emailSubject, $msg, $headers);
}

?>


All responses appreciated! I intend to use this with nuke 7.6. Would it work?
 
View user's profile Send private message Send e-mail
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Aug 28, 2005 1:00 am Reply with quote

That's not my script but appears to be based on a script I wrote. I'd try contacting the author.
 
View user's profile Send private message
jamdung92
New Member
New Member



Joined: Oct 22, 2003
Posts: 10

PostPosted: Sun Aug 28, 2005 8:55 pm Reply with quote

I 'wrote' this hack and have been using it on 6.5. I installed it on a friend's 6.9 site and it seemed to work fine. The only difference was the line number of where to call the hack. I've never upgraded beyone 6.5, so I don't know for sure if it will work on 7.0+, but I'll be interested to hear if it does.

I'm sorry you didn't get the install file. PM me an email address and I'll send it to you.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©