[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.
ofir1978
Registered User
Posts: 11
Joined: Wed Jan 16, 2008 9:03 am

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

Post by ofir1978 »

So if I have the forum name, I need just to retrive from the DB the admin(s) that runs it and put in $n2m_MAILTO[] their mail address.

Am I correct?
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 »

Yes, this can be done this way. But you should use the forum_id which you can find in $data[forum_id].

Good luck :)
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 »

Can this mod be configured to e-mail only when a user or a user group posted messages?
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 »

mtrs wrote:Can this mod be configured to e-mail only when a user or a user group posted messages?
You mean only if a special user you want to monitor has posted a message? Actually no and there a no plans to support this at this time, sorry. n2m is meant to be a mod for fully monitoring your board.

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 »

henmedia wrote:You mean only if a special user you want to monitor has posted a message?
Yes, I meant that.
henmedia wrote:Actually no and there a no plans to support this at this time.
Nevetheless, if mail subject contains poster's name, I may create an e-mail filter at mail client, then distinguish and keep that posters' mail and dump other mails to trash.. Thanks..
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 6 released:
  • Before beta 6, theme prosilver was used for formatting the email if configured. This gave a large overhead, because the mail client had to load all the style information from your webserver (~60kb), but only a very small part of this stylesheet was needed to display the posted message.
    Now only the required style data is included in the mail body. We read this from the new file newpost2mail.css and insert this to the html header in the mail body. The result is a layout close to the one the original prosilver theme provides, but the stripped down code now is only ~2kb, this means much less traffic and higher speed to display the mail. You can change this layout by editing the file if you want. The prosilver theme is not used or needed anymore by newpost2mail.
  • In newpost2mail.config.php the setting $n2m_USE_PROSILVER has been dropped, it's not used anymore.
  • If the hostname for the posting IP could not be retrieved, the IP was shown instead, so it was shown twice. Now n/a is displayed for the hostname if it's not available.
Download: http://henmedia.de

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
Geisthund
Registered User
Posts: 352
Joined: Fri Jul 01, 2005 1:23 pm

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

Post by Geisthund »

Hi

Where do you want newpost2mail.css to go root or styles/prosilver/themes/ ???
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 »

All files are expected to be in your phpBB root directory. As the newpost2mail.css is not a theme, it should not be held in the theme directory.
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 7 released:
  • Attachment handling has been optimized, now it works the same way phpBB3 does, including display of attachments within the posted text (inline attachments).
  • newpost2mail.css has been updatet for attachment handling.
  • Before beta 7, the php built in mail() function has been used for sending out the emails. Now we use whatever you have configured for your phpBB3 installation, so SMTP servers can be used if needed.
Download: http://henmedia.de

So far, I'm done. All the features I thought to implement are ready. Now it's up to you to test that all. I'm running this in a production environment with no problems at all.

Stefan
Last edited by henmedia on Fri Jan 18, 2008 2:24 pm, edited 1 time in total.
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
Gizmokid2005
Registered User
Posts: 33
Joined: Mon Oct 08, 2007 11:42 pm
Location: 192.168.10.100

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

Post by Gizmokid2005 »

I have updated to beta7 and all seems well. I will be sure to post any problems I run into.
ofir1978
Registered User
Posts: 11
Joined: Wed Jan 16, 2008 9:03 am

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

Post by ofir1978 »

I did a slight modification for the mod:

Now it will send an email only the the forum's administrator.
This is good incase you have several forums and in each one of them you have different administrators.
fill free to fix my code because this is my first day in PHP coding.... :D

This code goes after:
include($phpbb_root_path . 'newpost2mail.config.php');


//Sending the mail only the the forum's admin in which the post was made on

/*
if ((empty($n2m_MAILTO)) or (empty($n2m_MAILTO[0]))) {
$n2m_MAILTO = "";
$n2m_MAILTO[] = $config[board_contact];
} */



global $auth,$db;

$admin_ary = $auth->acl_get_list(false, 'm_', $data[forum_id]);
$admin_ary = (!empty($admin_ary['3']['m_'])) ? $admin_ary['3']['m_'] : array();

$n2m_MAILTO = "";

if (sizeof($admin_ary))
{
$where_sql = 'Where ' . $db->sql_in_set('user_id', $admin_ary);

$sql = 'SELECT user_email,username
FROM ' . USERS_TABLE . ' ' .
$where_sql;

$result = $db->sql_query($sql);

$email = "";
$n2m_MAILTO = array();
while ($row = $db->sql_fetchrow($result))
{
if ($post_USERNAME != $row['username'])
$n2m_MAILTO[] = $row['user_email'];
}
}


//End sending the mail only the the forum's admin in which the post was made on
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 »

ofir1978 wrote:I did a slight modification for the mod:

Now it will send an email only the the forum's administrator.
This is good incase you have several forums and in each one of them you have different administrators.
fill free to fix my code because this is my first day in PHP coding.... :D
Looks ok so far ;). If you like, I'll put this into the script for the next beta and add a configuration switch for that in newpost2mail.config.

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
ofir1978
Registered User
Posts: 11
Joined: Wed Jan 16, 2008 9:03 am

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

Post by ofir1978 »

Yes please.

Thanks :D
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 »

$admin_ary = $auth->acl_get_list(false, 'm_', $data[forum_id]);
$admin_ary = (!empty($admin_ary['3']['m_'])) ? $admin_ary['3']['m_'] : array();
This does not work for my installation. After these lines, $admin_ary is empty.

If I got you right, this should detect, if the group "administrator" is linked to the forum. This is true in my case.

Any idea?

In my opinion it would make sense do give the user the option to select if an email is sent to forum adminstrators and to forum moderators. But I have no idea yet how to make this work :)

Stefan
Get the latest version of newpost2mail for phpBB3 at http://henmedia.de | [donate USD] [donate EUR]
ofir1978
Registered User
Posts: 11
Joined: Wed Jan 16, 2008 9:03 am

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

Post by ofir1978 »

I have also run these line in my production environment and I got the same result as you did.
I'm trying to debug this and see whehre is the problem.

Return to “[3.0.x] Abandoned MODs”