[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.
henmedia
Registered User
Posts: 140
Joined: Wed Dec 19, 2007 9:31 am
Location: Germany

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

Post by henmedia »

New version beta 8 released:
  • Added feature to monitor individual forums by different recipients. This is useful if you don't want to monitor all forums or if you want to let moderators monitor their forums. See newpost2mail.config.php for details about how to do that.
  • Added new configuration switch $n2m_MAILTO_BOARDCONTACT. If this is set to 1 an email to the board contact address is sent on every new post. This is the default setting.
  • Optimized encoding of subject line for supporting international characters. We now use the phpBB function mail_encode() for that.

// CONFIGURING RECIPIENTS FOR INDIVIDUAL FORUMS:
//
// If you want to send mails to indivdiual recipients depending on the forum, this
// can be configured here. This may be useful if you do not want to monitor all
// forums or if you have different moderators for your forums and all or some of them
// should receive only mails for their forum(s).
//
// You need the numerical forum ID for that, which can be found in the URL of the
// forum in question. Just open a forum and look at its URL. You'll get something
// like http://your-forum.com/viewtopic.php?f=18&t=789
// In the example above we have "f=18" which means the forum ID is 18
//
// Now we add $n2m_MONITOR_FORUM[ID][] = "[email protected]" for each forum and recipent.
//
// If you want to have mails for forum ID 3 to [email protected] and
// [email protected] and mails for forum ID 7 to [email protected], you'll have
// to add the following lines:
//
// $n2m_MONITOR_FORUM[3][] = "[email protected]";
// $n2m_MONITOR_FORUM[3][] = "[email protected]";
// $n2m_MONITOR_FORUM[7][] = "[email protected]";


Donwload: http://henmedia.de

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

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

Post by mtrs »

In posting.php we add,

Code: Select all

include($phpbb_root_path . 'newpost2mail.php');
after,

Code: Select all

$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
I wonder, if I can add an if clause to skip include(mail if the poster is (admin or ..., ...,)) or the $mode is edit, reply, etc... Thus, I will not mail to myself.
Sorry I don't know any php, but I will try to tell what I want sort of..

if (username == admin or mode == edit)
skip mail

Also, this cancel mail option may be given to admin with a check box while posting or editing..
I abandoned all of my mods.
henmedia
Registered User
Posts: 140
Joined: Wed Dec 19, 2007 9:31 am
Location: Germany

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

Post by henmedia »

This can be done in general, but the drawback would be that if you have configured additional recipients, they also will get no mail in this case.

If you can live with that, the code would be:

Code: Select all

if (($user->data['username'] != "admin") and ($mode != "edit")) include $phpbb_root_path . 'newpost2mail.php');
This means if the user name is not admin AND the mode is not edit then newpost2mail is called.

But you also could edit the config file and set $n2m_MAILTO_BOARDCONTACT = 0 with the same IF clause as above. This would insure that additional recipients are not touched in this case.
Also, this cancel mail option may be given to admin with a check box while posting or editing..
This would be too much work to implement, sorry.

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

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

Post by mtrs »

That drawback of additional recipients wouldn't effect me, since I have a small board..

I added this code, thus I receive fewer mails now.. Actually, by changing this code, I can even monitor some certain members. However, It could be nice to be able exclude a user group activities generating mails on the board. Thank you :)
I abandoned all of my mods.
henmedia
Registered User
Posts: 140
Joined: Wed Dec 19, 2007 9:31 am
Location: Germany

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

Post by henmedia »

New version beta 9 released:
  • Multi language support and german translations added. Additional languages can simply be defined now by the admin in newpost2mail.config.php to match your needs. The board default language defined in phpBB3 is used by default, but this can be overwritten in the configuration. See config file for details about adding and selecting your own language. If your board default language is other than german or english and no translation for your language can be found in the config file, english will be used. In this case newpost2mail will run out of the box as it did before beta 9 and you can add your own translation later if needed.
  • newpost2mail.css has been updated for some smaller format and layout enhancements.
Download: http://henmedia.de

If you made translations for other popular languages such as IT, ES or FR, feel free to send them to me or post it here so I will include them for the next beta.

And now it's time to have fun with your loacalized version of n2m :)

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
Kerrith
Registered User
Posts: 490
Joined: Mon Mar 28, 2005 10:16 am
Location: Pahoa, Hawaii

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

Post by Kerrith »

Did I do this right?

The unzipped contents are in my /phpBB/ directory, however once uploaded all the files changed sizes: newpostmail.config.php from 6281 to 6091, newpost2mail.css from 3532 to 3526 and newpost2mail.php from 9084 to 8836. It looks like everything was not uploaded. Is this normal?


Please check for accuracy,
$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');
$post_need_approval = (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? true : false;
These end up as three separate lines.

I ran a test by registering as a new person and authenticated my registration and then posted my first post but didn't receive email notification. As Admin I replied to an existing post and didn't receive email notification. I must be doing something wrong.

I have one other Mod installed named AntiBotQuestion-1.1.0

Thanks,

Kerry
phpBB3.0
newpost2mail_beta9
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

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

Post by mtrs »

Kerrith wrote:I ran a test by registering as a new person and authenticated my registration and then posted my first post but didn't receive email notification. As Admin I replied to an existing post and didn't receive email notification. I must be doing something wrong.
After copying files you should edit,
posting.php
http://www.phpbb.com/community/viewtopi ... 5#p3966665
I abandoned all of my mods.
henmedia
Registered User
Posts: 140
Joined: Wed Dec 19, 2007 9:31 am
Location: Germany

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

Post by henmedia »

For the file sizes this is ok. The sizes differ on a windows machine and a linux machine (your webserver might be one), this normal for text files.

The code is inserted correct.

eMails are sent to the board contact address by default, this is what you can configure in your boards preferences. If you want to override that, see config file for details. Please check that first.

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
Kerrith
Registered User
Posts: 490
Joined: Mon Mar 28, 2005 10:16 am
Location: Pahoa, Hawaii

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

Post by Kerrith »

Thanks Stefan,

I checked my board's contact address and it correctly reads [[email protected]] but I'm not getting email notifications.

I went into newpost2mail.config.php and
// You can configure any additional addresses by changing the following line:
//
// $n2m_MAILTO[] = "";
// to
// $n2m_MAILTO[] = "[email protected]";
//
is this what you mean?

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

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

Post by henmedia »

In your phpBB configuartion a board contact address is set. This is what n2m uses by default.

If you want to override this, see config file for details, this is all explained there.

What you did does not wok, because it's a remark. Everything behind "//" is ignored.

To ignore the board contact address, change the line

$n2m_MAILTO_BOARDCONTACT = 1;

to

$n2m_MAILTO_BOARDCONTACT = 0;

and change

$n2m_MAILTO[] = "";

to

$n2m_MAILTO[] = "[email protected]";

Please try this and tell me if it works.

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
Kerrith
Registered User
Posts: 490
Joined: Mon Mar 28, 2005 10:16 am
Location: Pahoa, Hawaii

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

Post by Kerrith »

Thanks for pointing out my error, trying to edit the remarks.

I did as you said and posted a new post and still nada.

I dbl checked my Thunderbird and sent myself an email and it worked fine :)

I'm thinking it must be some phpBB3.0 setting I have wrong.

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

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

Post by henmedia »

The first thing to check is if phpBB3 can send emails in general. Try to contact a user by email using your phpBB3 installation and see if it works.

Also check your spam folder and/or antispam settings ... who knows :)

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
henmedia
Registered User
Posts: 140
Joined: Wed Dec 19, 2007 9:31 am
Location: Germany

newpost2mail beta10 released

Post by henmedia »

New version beta 10 released:
  • Order of informational table has been changed for better readability.
  • Enhanced support and bugfixes for 3rd party edits.
  • newpost2mail.css has been changed!
  • newpost2mail.config.php has been changed, added new phrases for 3rd party edits: $n2m_TEXT[en][edited_by] and $n2m_TEXT[en][edit_reason].
  • New variable $post_EDITOR available in newpost2mail.config.php for use in subject line if needed.
Dowload: http://henmedia.de

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
henmedia
Registered User
Posts: 140
Joined: Wed Dec 19, 2007 9:31 am
Location: Germany

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

Post by henmedia »

New version beta 11 released:
  • Fixed bug showing wrong user data. Only newpost2mail.php has been updated for that.
Dowload: http://henmedia.de
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
pacop2
Registered User
Posts: 31
Joined: Sat Sep 02, 2006 7:04 pm

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

Post by pacop2 »

Thank you for your mod. I was using "Notify Moderators" mod, but your's is very much simple to install (this is important to me, in ordern to install new versions of phpbb with the minimum work), and very very useful.

Keep it simple and useful, and thank you.

Return to “[3.0.x] Abandoned MODs”