[ABD] newpost2mail: Send new posts as email to admin

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
quielb
Registered User
Posts: 4
Joined: Tue Nov 18, 2008 10:43 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by quielb » Mon Dec 01, 2008 5:37 pm

somewhere in posting.php is the trigger to send an email. Find it comment it out.. and no more double messages. Let me know when you find it so I can comment it out.

MaureenT
Registered User
Posts: 10
Joined: Tue Nov 18, 2008 11:03 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by MaureenT » Mon Dec 01, 2008 8:02 pm

I already looked and was unable to find any such code in that file. The only reference I found to email notifications is the following code, which I really don't think would be what you'd comment out.

Code: Select all

// If the user is replying or posting and not already watching this topic but set to always being notified we need to overwrite this setting
$notify_set			= ($mode != 'edit' && $config['allow_topic_notify'] && $user->data['is_registered'] && !$post_data['notify_set']) ? $user->data['user_notify'] : $post_data['notify_set'];
$notify_checked		= (isset($notify)) ? $notify : (($mode == 'post') ? $user->data['user_notify'] : $notify_set);
Now, in includes/functions_posting.php, there is code that has to do with notifications and sending email, but I don't know nearly enough PHP (virtually none) to tell which part I should comment out. I am curious about something, however. According to ktuk.net, a way to bypass the issue of phpBB not sending any more emails until a user visits a forum is to delete in includes/functions_posting.php the following two lines of code (found in different places):

AND w.notify_status = 0

AND fw.notify_status = 0

If I recall, I tried that before I found n2m, and it didn't seem to work, but I'm wondering if it could be used in another way. Am I wrong in thinking that this code is saying that phpBB only sends a notification if the notify count for that user is at zero? If I'm right, then I'm assuming that every time a person goes to a forum after they've gotten a notification, the count gets reset to zero. So, what if these were changed from zero to a really large number, like say 50000, a bigger number than any user would ever reach with notifications. Would that make it so that phpBB wouldn't send out notifications until that number was reached? I might have to try this on the test board I've set up and see if it works.

MaureenT
Registered User
Posts: 10
Joined: Tue Nov 18, 2008 11:03 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by MaureenT » Mon Dec 01, 2008 9:23 pm

Eureka! I've got it! :D I tested the idea I had, and it seems to be working like a charm. Email notifications are coming through from n2m, but not from phpBB's own notification system.

Okay, so for everyone who has n2m set up to send notifications to people with forum and topic subscriptions and wants to block phpBB from also sending notifications (meaning that people get two notices), here's what you do:

In includes/functions_posting.php, find:

Code: Select all

    AND w.notify_status = 0
and

Code: Select all

    AND fw.notify_status = 0
Change the 0 in both of them to a very high number, one way higher than any individual user could possibly get notifications (I have mine set to 50000). What this does is tells phpBB not to send a forum or topic notification until a particular user has already received at least that many notifications.

I'm sure that there are other ways to completely turn off phpBB's own forum/topic notification without affecting n2m, but, until someone says how, this is working for me and should work for others, and it's easy to do (and undo).

quielb
Registered User
Posts: 4
Joined: Tue Nov 18, 2008 10:43 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by quielb » Tue Dec 02, 2008 12:49 am

To disable the phpBB default emails you need to edit functions_posting.php in the includes directory. On or about line 2431 ( depending on your version ) there is a function call to user_notification:

Code: Select all

// Send Notifications
if ($mode != 'edit' && $mode != 'delete' && ($auth->acl_get('f_noapprove', $data['forum_id']) ||  auth->acl_get('m_approve', $data['forum_id'])))
{
   user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'],   data['topic_id'], $data['post_id']);
}
Your best bet is to comment out the whole thing, from the if statement through the curly braces.

lfaragon
Registered User
Posts: 7
Joined: Sun Mar 30, 2008 9:08 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by lfaragon » Tue Jan 27, 2009 1:18 am

We have used this MOD for a while now and it works great!

Today I tried to implement it to our end users (we only have 35 users) utilizing the configuration for individual forums, however it didn't work at all unfortunately.

The only reason that I think it didn't work is that I configured it to the forum ID which in reality is a category, would that be the problem? Even though if you hover over the category it links to a forum. (for example: "f=451")

Or the MOD has to include the lower level forum IDs?

Any help would be appreciated.

Thanks in advance.

User avatar
WizardOfZo
Registered User
Posts: 14
Joined: Wed Oct 08, 2008 5:12 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by WizardOfZo » Wed Feb 25, 2009 2:00 pm

I have a request for a modification to this MOD.
There is a function to allow for specific forums to go to specific emails.

I am using the $n2m_MAILTO_GROUP for sending emails
I need a method to exclude emails generated by a specific forum from being sent to everyone in the group set in $n2m_MAILTO_GROUP.

Can anyone help me with this?
Thanks in advance

amoun
Registered User
Posts: 251
Joined: Mon Sep 29, 2003 1:15 pm
Location: Cornwall, UK SX45036904
Contact:

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by amoun » Sun Mar 08, 2009 11:21 pm

Just to say a) thanks very much for this mod my old version was for phpBB2, so this is great.

What I have done, for convenience, is place the files in a root folder mymods/notify_admin and updated the calling path in posting.php to newpost2mail.php and the paths in newpost2mail.php to newpost2mail.css and newpost2mail.config.php
facts invariably distort the truth

User avatar
caeos
Registered User
Posts: 52
Joined: Fri Nov 12, 2004 4:36 am
Location: Uk
Contact:

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by caeos » Fri Apr 17, 2009 11:47 pm

when i get a cop of the email it shows the link as

Code: Select all

../../../../forum/
i know its getting the base url but is there away to hard code the url to the link. so it shows as url/forum?

amoun
Registered User
Posts: 251
Joined: Mon Sep 29, 2003 1:15 pm
Location: Cornwall, UK SX45036904
Contact:

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by amoun » Sat Apr 18, 2009 7:07 am

hi caeos

Have a look at the file newpost2mail.php and you will see

Code: Select all

 // set variables for later use

      $board_url      = generate_board_url();
      if (substr($board_url, -1) != "/") $board_url .= "/";

      $forum_url      = $board_url . "viewforum.php?f=$data[forum_id]";
      $thread_url     = $board_url . "viewtopic.php?f=$data[forum_id]&t=$data[topic_id]";
      $post_url       = $board_url . "viewtopic.php?f=$data[forum_id]&t=$data[topic_id]&p=$data[post_id]#p$data[post_id]";
      $u_profile_url  = $board_url . "memberlist.php?mode=viewprofile&u=$post_data[poster_id]";
      $e_profile_url  = $board_url . "memberlist.php?mode=viewprofile&u=$post_data[post_edit_user]";
      $reply_url      = $board_url . "posting.php?mode=reply&f=$data[forum_id]&t=$data[topic_id]";
      $edit_url       = $board_url . "posting.php?mode=edit&f=$data[forum_id]&p=$data[post_id]";
      $quote_url      = $board_url . "posting.php?mode=quote&f=$data[forum_id]&p=$data[post_id]";
      $delete_url     = $board_url . "posting.php?mode=delete&f=$data[forum_id]&p=$data[post_id]";
      $info_url       = $board_url . "mcp.php?i=main&mode=post_details&f=$data[forum_id]&p=$data[post_id]";
      $pm_url         = $board_url . "ucp.php?i=pm&mode=compose&action=quotepost&p=$data[post_id]";
      $email_url      = $board_url . "memberlist.php?mode=email&u=$post_data[poster_id]";
It looks like you can set the board url in the above line:
$board_url = generate_board_url();
facts invariably distort the truth

User avatar
caeos
Registered User
Posts: 52
Joined: Fri Nov 12, 2004 4:36 am
Location: Uk
Contact:

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by caeos » Sat Apr 18, 2009 1:23 pm

which i assume /guess would be in the similar format to

Code: Select all

 $board_url      = "http://www.iam.me/";
it just trying to integrate it into mailman

woss
Registered User
Posts: 1
Joined: Wed Feb 11, 2009 10:28 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by woss » Thu Apr 23, 2009 8:12 pm

This is a great MOD!

I'm already using it and it works great for me. It should be amazing if could be possible to monitor forums by group and not just by user, I hope this come in a new release.

Thanks!

henmedia
Registered User
Posts: 140
Joined: Wed Dec 19, 2007 9:31 am
Location: Germany
Contact:

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by henmedia » Fri Apr 24, 2009 9:05 am

Sending emails to groups is already supported.

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]

Joe_Joe
Registered User
Posts: 52
Joined: Sun Apr 26, 2009 8:16 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by Joe_Joe » Sun Apr 26, 2009 8:32 pm

Thank you for what would be exactly what I am looking for, "Here comes the but"

I have been unable to fet it to work. No errors, I didn't change any thing but "posting.php" as instructed and nothing.

I see from other post that it works, but I'm at a complete loss. Below is the change I made, I think just as the instructions say to.

Code: Select all

was -- 			$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
                        
is--                                        $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
include($phpbb_root_path . 'newpost2mail.php');

I did not change anything else. Is there a place I should look that may or may not be turned off.

All I want is a copy of each post sent to me, nothing special.

Thank you for any help.

Pure Novise
Joe Joe
Last edited by camm15h on Sun Apr 26, 2009 9:00 pm, edited 1 time in total.
Reason: Removed bold formatting.

henmedia
Registered User
Posts: 140
Joined: Wed Dec 19, 2007 9:31 am
Location: Germany
Contact:

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by henmedia » Sun Apr 26, 2009 11:52 pm

The changes to posting.php are correct - but I've no idea what could cause your problem, sorry.

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]

Joe_Joe
Registered User
Posts: 52
Joined: Sun Apr 26, 2009 8:16 pm

Re: [BETA] newpost2mail: Send new posts as email to admin

Post by Joe_Joe » Mon Apr 27, 2009 3:08 pm

Thank you for your reply.

This will be an other one that bites the dust.

Again thanks for the support.
JJ

Locked

Return to “[3.0.x] Abandoned MODs”