[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
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 » Mon Oct 20, 2008 7:12 pm

Thanks, if it is only a link, that will work
I tried attaching a small gif as a test and outlook express tried to display it as an image (but failed)

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 Nov 18, 2008 10:49 pm

Here is some code to add to use the watch lists to send out emails. It will look at the forums watch list and topics watch list and send email to those people

Add the code below somewhere after

Code: Select all

// send email to board contact address?

if ($n2m_MAILTO_BOARDCONTACT) $n2m_MAILTO[] = $config[board_contact];
but before

Code: Select all

// and finally send the mails

foreach ($n2m_MAILTO as $mailto) {
     if ($config['smtp_delivery']) { // SMTP?
Here is the code

Code: Select all

// add recipients subscribed to that forum
      if ( $n2m_MAILTO_FORUMWATCH )
      {
         $sql_stmt = array(
             'SELECT' => 'u.user_email',
             'FROM'   => array( USERS_TABLE => 'u',
                                FORUMS_WATCH_TABLE => 'w'),
             'WHERE'  => 'u.user_id = w.user_id
                          AND u.user_inactive_time = 0
                          AND w.forum_id = ' . $data[forum_id]);

         $sql = $db->sql_build_query('SELECT', $sql_stmt);
         $result = $db->sql_query($sql);
         while ($row = $db->sql_fetchrow($result)) $n2m_MAILTO[] = $row['user_email'];
         $db->sql_freeresult($result);
      }

      // add recipients watching topic
      if ( $n2m_MAILTO_TOPICWATCH )
      {
         $sql_stmt = array(
             'SELECT' => 'u.user_email',
             'FROM'   => array( USERS_TABLE => 'u',
                                TOPICS_WATCH_TABLE => 'w'),
             'WHERE'  => 'u.user_id = w.user_id
                          AND u.user_inactive_time = 0
                          AND w.topic_id = ' . $data[topic_id]);

         $sql = $db->sql_build_query('SELECT', $sql_stmt);
         $result = $db->sql_query($sql);
         while ($row = $db->sql_fetchrow($result)) $n2m_MAILTO[] = $row['user_email'];
         $db->sql_freeresult($result);
      }
You will also need to add a few items the the config. Setting these to 0 will disable the code.

Code: Select all

$n2m_MAILTO_FORUMWATCH = 1;
$n2m_MAILTO_TOPICWATCH = 1;

Patriz
Registered User
Posts: 43
Joined: Sun May 29, 2005 8:27 am

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

Post by Patriz » Wed Nov 19, 2008 7:06 am

Hi quielb!

It looks very nice!

Do you have also an idea how the program can check the permission that user are allowed to read the forum.

Regards Patriz

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 » Wed Nov 19, 2008 8:36 am

That logic is somewhat built in. If they don't have permission to read the forum then they can't subscribe to it. Granted that doesn't address the case of a someone that at one time had permission and then got it taken away.

When I wrote the code it wasn't really a concern for me because my forum is an internal forum that is visible to everybody in the intranet, but I could see how some people might want that. I think you could probably get it to work with a more complex join in the select statement. I did at least add logic so that people with deactivated accounts wouldn't get email, mostly because I didn't want to deal with the bounce messages.

I'll kick it around for a bit and see what I can come up with. If anybody else has some input, feel free to jump in.

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 » Wed Nov 19, 2008 8:54 am

Remember that n2m wasn't build to serve end users, it's just for admins. Feel free to enhance the code to suite your needs, but keep in mind that there is some information like eMail adresses sent out.

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

Patriz
Registered User
Posts: 43
Joined: Sun May 29, 2005 8:27 am

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

Post by Patriz » Wed Nov 19, 2008 9:30 am

Hi!
quielb wrote:That logic is somewhat built in. If they don't have permission to read the forum then they can't subscribe to it. Granted that doesn't address the case of a someone that at one time had permission and then got it taken away.
I see!

But there are two ways for my users to get informed about new posts.
1) the normal way with subscribing a forum or topic
2) in general in using this tool

In that it is important for me to have an increase of functionality in that way that the program check the permissions.

If it is no big issue for you it will be very kindly of you to help me. Otherwise I understand if you don't have time to support me. For me it is not possible to write some php-code because I am not able to do that.

Regards Patriz

Patriz
Registered User
Posts: 43
Joined: Sun May 29, 2005 8:27 am

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

Post by Patriz » Wed Nov 19, 2008 9:38 am

(my german answer to Stefan below mentioned)

Hi Stefan!

I know your intention when you wrote this add-on and you have done a great job!

But what said against it to follup up the development of your great add on?

Regards Patriz

Hallo Stefan!

Da hast du wirklich ein super Tool programmiert. Aber was spricht dagegen es in der Form weiter zu entwickeln, dass es auch für die Nutzer des Forums genutzt werden kann. Ich habe es in meinem Forum den Usern frei zur Verfügung gestellt, sich über einen Gruppeneitrag über jedes Posting informieren zu lassen.

Dies hat vor allem für die User einen grüßen Charme, die die Postings offline lesen möchten.

Gruß Patriz

User avatar
dan1dyoung
Registered User
Posts: 35
Joined: Sun Jun 29, 2008 5:13 pm
Location: Royston, England
Contact:

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

Post by dan1dyoung » Sun Nov 23, 2008 2:51 pm

Hi,

Does anyone have another link to download this so i can take a look as the http://henmedia.de is dead??

Thanks

Dan
My phpBB Modifications & Tips are here: http://www.dysolutions.co.uk/phpbb

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 Nov 23, 2008 4:37 pm

http://henmedia.de is working as usual ...

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

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 » Sun Nov 23, 2008 4:53 pm

On the main page the link is not obvious
Try the direct link.
http://henmedia.de/index.php?option=com ... &Itemid=35

User avatar
dan1dyoung
Registered User
Posts: 35
Joined: Sun Jun 29, 2008 5:13 pm
Location: Royston, England
Contact:

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

Post by dan1dyoung » Sun Nov 23, 2008 4:57 pm

Hi Stefan,

Just tried it on another computer and still get "Internet Explorer cannot display the webpage"/ "Server not found", tried IE6, 7 and FF on 2 different computers (Same Broadband connection) and tried pinging/tracert but all fail??

I looked in the phpbb mods area but could not see it there, also tried the phpbb.de but that failed to load aswell!!! Just tried one of our German site but that loads OK???


Is it anywhere else or can you PM it to me please.

Thanks

Dan


WizardOfZo,

Thanks but i can not even see that site!!!!
My phpBB Modifications & Tips are here: http://www.dysolutions.co.uk/phpbb

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 » Tue Nov 25, 2008 11:32 pm

this is a praise post wit a difference!
i admin a training community website, the way we use this 'mod' is as follows.
--users and visitors can search the database and sign up to the mailman mailing list but not post to the forum.
--when the site admins post latest news in the forum with training swaps, the newpost2mail will send a mail to mailman. all these mails then get sent out in digest mode to the users. :ugeek:
Simple and effective. before the poor site admin had to c&p all the posts into an email and send them to the users.. :evil:

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 » Sat Nov 29, 2008 7:25 pm

First of all, I want to thank Stefan for creating this mod. When I realized that phpBB's built-in notification system was set up so that users would not receive further notifications unless they visited the forum, I was not a happy camper. Thanks to the latest "forumwatch/topicwatch" addition, this mod resolves that problem by allowing me to use it to send notifications to users with topic and forum subscriptions.

This, unfortunately, leads to a problem, namely that any user subscribed to a forum or topic now receives two email notices, one from n2m and another from phpBB's own email notification system.

Is there a way to add a statement in n2m that would instruct phpBB not to send out an email of its own or am I going to have to make code changes somewhere else?

Again, thank you for a very useful mod.

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 » Sun Nov 30, 2008 3:24 am

Maureen - in my experience, 2 is better than none!

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 » Sun Nov 30, 2008 3:54 am

:) Yes, it is, but I doubt that the users of my board will appreciate me answering with that response when they start complaining about getting twice as many emails in their inbox as they should be. Thankfully, it won't be a big board with a lot of activity, so we're not talking about dozens of emails a day, but it may still prove to be an issue.

Locked

Return to “[3.0.x] Abandoned MODs”