Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: mnn2 on December 01, 2020, 01:25:22 AM

Title: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 01, 2020, 01:25:22 AM
Hello guys, I am looking into a mod or functionality that can do this:

Instant email notification if there is pending post/topic need approval

If there is no mod for this, please let me know which table(s) in the database to look at so that I can program my own php page to do this. I need a lot googling though in order to achieve this.

As far as my experience is, in smf there is daily summary about the pending post/topic need approval. It's not real time or instant notification. I want to filter spam and troll posts/topics but also want to ensure legitimate new user posts/topics will be published as soon as possible.

Thanks in advance.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: Aleksi "Lex" Kilpinen on December 01, 2020, 02:01:12 AM
No mod needed as far as I know. You just need to check your profile settings, and moderation preferences.
Though, any email sent by SMF isn't really guaranteed to be instant.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 01, 2020, 02:10:22 AM
I am looking for instant notification for any pending post/topic that need approval.

As I am not a pro in this, I was thinking about using pooling method to check every minute if there is pending post/topic that need approval.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: Kindred on December 01, 2020, 09:49:18 AM
there is no such thing as "instant notification" in SMF.

and, if you set a polling to check "every minute" you will kill your server.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: shadav on December 01, 2020, 09:58:25 AM
not exactly what you want but you can try these modifications

for a notification system: https://custom.simplemachines.org/mods/index.php?mod=2198

show Number of unapproved posts and topics in your forum in the header: https://custom.simplemachines.org/mods/index.php?mod=2952

a counter to Moderate button about the number of the unapproved posts: https://custom.simplemachines.org/mods/index.php?mod=2909
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 01, 2020, 10:13:54 AM
Quote from: Kindred on December 01, 2020, 09:49:18 AM
there is no such thing as "instant notification" in SMF.



that is why I am looking for one/building one ;D


Quote from: Kindred on December 01, 2020, 09:49:18 AM
and, if you set a polling to check "every minute" you will kill your server.

Actually I have little worry about the potential performance penalty. My forum is hosted on very recent hardware. Plus it seems that it's not a very busy server handling many VMs. The hosting fee is on relatively higher side vs the specs.

I appreciate any help on this.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 01, 2020, 10:15:42 AM
Quote from: shadav on December 01, 2020, 09:58:25 AM
not exactly what you want but you can try these modifications

for a notification system: https://custom.simplemachines.org/mods/index.php?mod=2198

show Number of unapproved posts and topics in your forum in the header: https://custom.simplemachines.org/mods/index.php?mod=2952

a counter to Moderate button about the number of the unapproved posts: https://custom.simplemachines.org/mods/index.php?mod=2909

I already installed one of the mod. Now looking for instant email notification.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: Kindred on December 01, 2020, 11:39:31 AM
I guess the biggest question is---  Why?


What perceived issue are you trying to solve with this?
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 01, 2020, 11:52:17 AM
Quote from: Kindred on December 01, 2020, 11:39:31 AM
I guess the biggest question is---  Why?


What perceived issue are you trying to solve with this?

To approve non-spam post/topic as soon as possible. Legitimate members are complaining their post/topic waited too long before got published.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: Kindred on December 02, 2020, 09:37:50 AM
A forum is not real-time chat....

If you want faster notification, then stay online on your forum and refresh frequently.
If you can't handle it, then get more staff/volunteers who you are willing to allow to have approval permission
or maybe just turn off the approval requirement for users who have confirmed that they are not spammers
--- improve your spam-prevention
--- give users who have made (for example) 10 good posts permission to post without requiring approval

otherwise, tell your users to take a chilll - things will get approved when you have the chance to approve them



You are trying to use technical things to fix a social problem -- and that never works.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 02, 2020, 11:50:26 AM
Thanks for the suggestion.

However that is hugely inefficient use of time. Tech exists to ease us. I see this as a technical issue. it's not different that PayPal will send us email when there is payment received from customer. In my case, send me an email when there is new post/topic.

How is that so complicated?
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: Kindred on December 02, 2020, 01:13:29 PM
because polling like you suggest will literally KILL servers.

SMF checks to perform queued actions and does a few on every page load.  If you have a busy forum, this means things will be running fairly seamlessly. If your forum is not so busy, then things may be a little slower.

As I said -- it's not a great choice to try to solve social problems with technical solutions.

I did, however, give you and existing, SIMPLE solution
--- improve your spam-prevention
--- give users who have made (for example) 10 good posts permission to post without requiring approval

Why do you feel the need to review/approve every post?
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 02, 2020, 01:20:21 PM
Not every post need to review. Only those newly registered users which tend to be those from recently banned users or spammers. When users have posted a while and we the moderation people satisfied that they are harmless then we removed them from the group that need moderation.

Anyway, as I posted my previous reply, I think I can add a line of php code to send email for those who post a new post or topic. Before that I need to check whether they belong to group that under moderation. Conceptually it is easy. But I need to find where is the page doing this.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 04, 2020, 12:07:44 PM
Here is what I did to have email notification each time there is new reply/new topic. For my usage, I only wanted the new reply or topic that needed moderation. So, I comment out the irrelevant codes.

Find this file at: /Sources/Post.php

find this line

// Notify any members who have notification turned on for this topic - only do this if it's going to be approved(!)

Add following code above that line:

// email notification
if ($becomesApproved)
{
if ($newTopic)
{
FunctionToSendEmail(); //for new topic that no needs moderation

}
elseif (empty($_REQUEST['msg']))
{
if ($topic_info['approved'])
{
FunctionToSendEmail(); //for new reply to a topic that no needs moderation
}

}
}
else
{
FunctionToSendEmail(); //for reply to a topic or new topic that needs moderation
if ($newTopic)
{
FunctionToSendEmail(); //for new topic that needs moderation
}
else
{
FunctionToSendEmail(); //for new reply to a topic that needs moderation
}
}
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: Kindred on December 04, 2020, 12:20:58 PM
this will spam any user who has signed up for notifications on a topic... not just the admin

and that logic looks wrong to me anyway...
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: efk on December 04, 2020, 02:09:23 PM
https://www.simplemachines.org/community/index.php?topic=575869.msg4074823#msg4074823

To add on what Shadav posted.
Title: Re: Instant email notification if there is pending post/topic need approval
Post by: mnn2 on December 05, 2020, 06:59:03 AM
Quote from: Kindred on December 04, 2020, 12:20:58 PM
this will spam any user who has signed up for notifications on a topic... not just the admin

and that logic looks wrong to me anyway...

Only send to email for moderator.