How to force post pending-approval in posting.php

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
deepkar
Registered User
Posts: 42
Joined: Thu Nov 30, 2006 3:47 am

How to force post pending-approval in posting.php

Post by deepkar »

Hi,
I'm trying to detect spam via a logic inside posting.php and then force that specific post to be submitted pending approval. Can someone please help me with a variable or setting I can trigger? Thanks.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: How to force post pending-approval in posting.php

Post by david63 »

deepkar wrote:Can someone please help me with a variable or setting I can trigger?
From what you have posted - no.

Which event are you you using?
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
RMcGirr83
Former Team Member
Posts: 22011
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: How to force post pending-approval in posting.php

Post by RMcGirr83 »

and how are you trying to "detect spam".
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
deepkar
Registered User
Posts: 42
Joined: Thu Nov 30, 2006 3:47 am

Re: How to force post pending-approval in posting.php

Post by deepkar »

david63 wrote:
deepkar wrote:Can someone please help me with a variable or setting I can trigger?
From what you have posted - no.

Which event are you you using?
Not sure of the question. However, I'm looking at data inside "$message_parser->message" on submit and then applying my logic.
RMcGirr83 wrote:and how are you trying to "detect spam".
As mentioned above, I'm looking for a specific pattern in what's there in the message. (the pattern is based on what I see in most of the spam posts)
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: How to force post pending-approval in posting.php

Post by david63 »

deepkar wrote:Not sure of the question.
If you don't understand the question then how are you doing this?

In phpBB 3.1 you use events within extensions to manipulate your data there fore the question is - which event are you using. Once we know that then we will be in a better place to be able to answer your original question.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
RMcGirr83
Former Team Member
Posts: 22011
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: How to force post pending-approval in posting.php

Post by RMcGirr83 »

Op probably wants to use the core.message_parser_check_message event but that's a guess.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
deepkar
Registered User
Posts: 42
Joined: Thu Nov 30, 2006 3:47 am

Re: How to force post pending-approval in posting.php

Post by deepkar »

Well, I think I don't understand much about extensions. I'm manually editing the code inside posting.php, after these lines:

Code: Select all

if ($submit || $preview || $refresh)
{
	$post_data['topic_cur_post_id']	= request_var('topic_cur_post_id', 0);
	$post_data['post_subject']		= utf8_normalize_nfc(request_var('subject', '', true));
	$message_parser->message		= utf8_normalize_nfc(request_var('message', '', true));
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: How to force post pending-approval in posting.php

Post by david63 »

The whole point of phpBB 3.1 is that you do not edit core code but use extensions
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
deepkar
Registered User
Posts: 42
Joined: Thu Nov 30, 2006 3:47 am

Re: How to force post pending-approval in posting.php

Post by deepkar »

david63 wrote:The whole point of phpBB 3.1 is that you do not edit core code but use extensions
I ended up editing code because that seemed to be the only way to have a customized way of preventing SPAM. And I did not find a solid anti-spam extension that would fit my needs. (And I'm tackling human spammers)
User avatar
RMcGirr83
Former Team Member
Posts: 22011
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: How to force post pending-approval in posting.php

Post by RMcGirr83 »

Take a look at this extension which checks posts and signatures (needs an event for signatures which is why it is stated for 3.1.10-RC1 in ext file...if testing on 3.1.9 change the version in the ext.php file of the extension) on TLD's within the post. If found triggers an error.

Similar to what you are trying to accomplish only you would change the check_text function of the class.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52767
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: How to force post pending-approval in posting.php

Post by stevemaury »

Lots easier to just stop spam registrants before they post.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
deepkar
Registered User
Posts: 42
Joined: Thu Nov 30, 2006 3:47 am

Re: How to force post pending-approval in posting.php

Post by deepkar »

Thanks all of you! After looking at your replies and some extensions (thanks again to RMcGirr83), I'm inclined towards using/modifying extensions. May be I will share what I edited once I see results.

Question @RMcGirr83,
Is it okay to edit the code in an existing extension and use it? Does it call home and detect a code change and complain about it?
deepkar
Registered User
Posts: 42
Joined: Thu Nov 30, 2006 3:47 am

Re: How to force post pending-approval in posting.php

Post by deepkar »

RMcGirr83 wrote: Fri Jul 22, 2016 1:39 pm Take a look at this extension which checks posts and signatures (needs an event for signatures which is why it is stated for 3.1.10-RC1 in ext file...if testing on 3.1.9 change the version in the ext.php file of the extension) on TLD's within the post. If found triggers an error.

Similar to what you are trying to accomplish only you would change the check_text function of the class.
Now that I'm trying to modify this extension, I'm trying to figure out how to let them submit the post and mark the post as waiting for approval (and not just throw an error preventing submission). Probably a small flag somewhere? Appreciate any pointers.
Post Reply

Return to “Extension Writers Discussion”