Notification when 'new article' posted

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-28-2007, 11:27 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 168
How would I create a notification to the Pligg site owner when an article is posted?

The email would say something like, "New Article posted" and contain details about the article similar to the 'Tell-a-friend' feature.

Any ideas?

Thx

Last edited by aaronpais; 05-28-2007 at 07:01 PM.
Reply With Quote
  #2 (permalink)  
Old 05-28-2007, 01:25 PM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,961
Are you sure you want to have this? If your site is gonna get more traffic then it will be a nightmare to you.

if so add php's mail() before the last redirect statement in do_submit3() in submit.php
Reply With Quote
  #3 (permalink)  
Old 05-28-2007, 02:54 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 168
I must be blind. I looked in submit.php for a redirect statement and cannot find it.

I want to send an email using the same variables as recommend.php, so the email is sent to me with the link to the new article and details about the article.

I am not a developer. Can you please help me write a mail() statement? Can I just copy something from recommend.php?
Reply With Quote
  #4 (permalink)  
Old 05-28-2007, 04:25 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
A useful related feature would be to alert users to stories that are related to their saved list - in the form of a daily or weekly digest.

For the instant admin notification, try:

Above:

Code:
header("Location: " . getmyurl('upcoming'));
Add:

Code:
    $to = 'email@domain.com';
    $from = 'email@domain.com';
    $subject = 'New Article Posted!';
    $message = $linkres->url;
    mail($to, $from, $subject, $message);
Reply With Quote
  #5 (permalink)  
Old 05-28-2007, 04:38 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 168
Thx so much.... I have another question ->

I collect an email address in my submit form. The email address is stored in the 'extra-field-8'. I want to use this email address as the 'to' email address. How do I link the email address in 'extra-field-8' to the 'to' email address?

Thx so much

Last edited by aaronpais; 05-29-2007 at 04:03 PM.
Reply With Quote
  #6 (permalink)  
Old 05-29-2007, 12:45 PM
cent's Avatar
Constant Pligger
 
Join Date: Jan 2007
Location: New York, NY
Posts: 180
Be careful when using the mail() function without cleansing the input for the extra field. It's quite possible for someone to send spam through it regardless if the from, subject, and other fields are hard-coded.

See: http://www.securephpwiki.com/index.php/Email_Injection

Best,
Cent
Reply With Quote
  #7 (permalink)  
Old 05-29-2007, 01:35 PM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,961
That is why I warned before I posted the mail() code - it is always danger and unwanted burden to the admin. best is to just check for the post very often.
Reply With Quote
  #8 (permalink)  
Old 05-29-2007, 07:57 PM
cent's Avatar
Constant Pligger
 
Join Date: Jan 2007
Location: New York, NY
Posts: 180
I remember using the mail() tag early on when I was learning PHP. Some spammer had used a contact webform i made to spam people and it "appeared" to come from my admin email account. I had some many bounced emails back I had to ssh into the server and kill the entire mail file for that account.

Best,
Cent
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email notification when a story is submitted federrer Questions and Comments 0 05-02-2008 07:31 AM
[SOLVED] article links out fail from imported RSS feeds asapcustoms Questions and Comments 2 10-26-2007 01:09 AM
I have two article whose URLs don't post correctly AshMCairo Questions and Comments 0 06-08-2007 03:44 PM
Duplicate article URL - Error - Bug? DailyResearch Questions and Comments 3 05-14-2007 01:36 PM
Artile Title doesn't link to the actual article mryder Questions and Comments 2 04-02-2007 08:38 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development