ElkArte Community

Extending Elk => Addons => Topic started by: live627 on March 17, 2017, 05:55:14 am

Title: [ADDON] Double Post Stopper
Post by: live627 on March 17, 2017, 05:55:14 am
Double Post Stopper 1.0

(https://camo.githubusercontent.com/d7b0ca6383644d5ac81e234f8d2249b731a1407b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d3030393939392e737667) (http://opensource.org/licenses/MIT) (https://camo.githubusercontent.com/c958fe4ade96cfef4c63cd601a2f8466414ebf30/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6c6976653632372f656c6b2d6470732e737667) (https://github.com/live627/elk-dps/issues) (https://camo.githubusercontent.com/4e509500a0ea2ceb2fbfd9627b8a42ff344feff7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6c6976653632372f656c6b2d6470732e737667) (https://github.com/live627/elk-dps/releases) (https://camo.githubusercontent.com/d89db1835e723831f184416e01b4c83575d7747c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f6c6976653632372f656c6b2d6470732f746f74616c2e737667) (https://github.com/live627/elk-dps/releases) (https://camo.githubusercontent.com/42369538c2c9e329a15d33929bcc9a2172dee3c4/68747470733a2f2f737570706f727465722e3630646576732e636f6d2f6170692f622f61786c736a316f386f30616d65706672723565716c636a7a61) (https://supporter.60devs.com/give/axlsj1o8o0amepfrr5eqlcjza)

Introduction:

Stop users from double posting and bumping/spamming topics.
Requires PHP 5.5 or newer to run

Please consider donating if you use this; I'd greatly appreciate it!


http://addons.elkarte.net/enhancement/Double-Post-Stopper.html
Title: Re: Double Post Stopper
Post by: Spuds on March 17, 2017, 09:16:24 am
Nice job !
Title: Re: Double Post Stopper
Post by: radu81 on March 17, 2017, 10:40:08 am
That was fast, thank you @live627‍ 
Title: Re: Double Post Stopper
Post by: live627 on March 17, 2017, 06:18:19 pm
And thank you @radu81 for the donation. :)
Title: Re: Double Post Stopper
Post by: radu81 on March 17, 2017, 07:38:34 pm
You are welcome, I was looking for a similar addon since I joined Elkarte :)
http://www.elkarte.net/community/index.php?topic=2226.0

The addon is working fine, but I am getting a lot of erors in Elkarte error log:
Guest
Type of error: General
2: min(): Array must contain at least one element
File: /sources/subs/DoublePostStopper.php
Line: 98

I set 0 hours for guests, all errors are from guests, not from users
Title: Re: Double Post Stopper
Post by: live627 on March 17, 2017, 08:35:01 pm
Does this file fix the issue? (It goes in ./sources/subs)
Title: Re: Double Post Stopper
Post by: radu81 on March 18, 2017, 03:34:15 am
Yep, no more errors. Thanks again 
Title: Re: Double Post Stopper
Post by: live627 on March 18, 2017, 08:50:33 pm
Cool.
Title: Re: Double Post Stopper
Post by: radu81 on March 20, 2017, 02:10:34 pm
I have two things to report:
Title: Re: Double Post Stopper
Post by: live627 on March 23, 2017, 02:56:25 am
QuoteI don't set a time for guests the addon is not stopping double posting for members
I can't reproduce that. Definitely a bug though.

Quoteit also hides the "Quick Edit" button
@Spuds does disabling quick reply also disable quick edit?
Title: Re: Double Post Stopper
Post by: Daemon on September 04, 2017, 10:37:04 am
Just one question:

what do I need to set at "max time to edit a post" in Posts & Topics settings?

Or is this irrelevant with this mod?
Title: Re: Double Post Stopper
Post by: ahrasis on September 04, 2017, 06:56:03 pm
I don't think its relevant to this topic. I may move it to support later.

Anyway, you should set your preferred edit time or enter zero to disable editing a post. To modify a post without any time limit, we have another addon for that.
Title: Re: Double Post Stopper
Post by: live627 on September 04, 2017, 11:01:21 pm
That setting does  not affect this addon.
Title: Re: Double Post Stopper
Post by: Daemon on September 05, 2017, 03:23:21 am
Why shouldn't this be relevant to this topic?

It's a question of this mod and how it should be set.

So I set edit time to 0 and in the mod 15 minutes, but they can double post within 5 seconds. So this mod isn't working.
Title: Re: Double Post Stopper
Post by: radu81 on September 21, 2017, 03:33:27 am
I just tested on 1.1 RC2, it installs without errors, but when I try to save the settings of this addon I get an error:

str_split() expects parameter 1 to be string, array given
Title: Re: [ADDON] Double Post Stopper
Post by: kucing on November 04, 2017, 02:37:00 am
i want to report a problem.

when opening any topic as guest there will be an error:
Code: [Select]
min(): Array must contain at least one element
the content is not displayed.

using elkarte 1.1.0.
Title: Re: [ADDON] Double Post Stopper
Post by: radu81 on April 15, 2018, 04:37:24 pm
Hi @live627‍ , do you have any plans to update this for elkarte 1.1?
Title: Re: [ADDON] Double Post Stopper
Post by: Spuds on May 05, 2018, 05:31:19 pm
You should open an issue on github and see if he has plans to update this :D
Title: Re: [ADDON] Double Post Stopper
Post by: radu81 on November 08, 2018, 10:42:57 am
I did that @Spuds‍ but no answer from @live627‍  :(
is there anyone interested on this add-on who can update it for elkarte 1.1?

https://github.com/live627/elk-dps

The add-on installs on elkarte 1.1, after install if I try to save the settings of this add-on I get an error:
str_split() expects parameter 1 to be string, array given

In elkarte error log i have:
Code: [Select]
Type of error: General
Warning: str_split() expects parameter 1 to be string, array given
/index.php?action=admin;area=addonsettings;save;sa=general
File: /sources/database/Db-mysql.class.php
Line: 299

If I try to add a consecutive post I get :
Code: [Select]
Type of error: Not specified
Exception: Call to undefined function fatal_lang_error()
/index.php?action=post;topic=948.75;last_msg=198652
File: /sources/subs/DoublePostStopper.php
Line: 122
Title: Re: [ADDON] Double Post Stopper
Post by: radu81 on November 08, 2018, 08:03:05 pm
I'm getting close ;D
the second error can be solved by replacing the line:
Code: [Select]
           fatal_lang_error('double_post_attempt', false); // You naughty, naughty person!
with:
Code: [Select]
            \Errors::instance()->fatal_lang_error('double_post_attempt', false);
Title: Re: [ADDON] Double Post Stopper
Post by: live627 on November 18, 2018, 09:47:27 pm
I think I figured it out. The changes made to  the settings form parser are to blame. It does not play nicely with mods that do things differently than expected. The hook for saving the settings does not pass any  objects to integrations.

To remedy this, I need to create my own $settingsForm object to save the data that way.

Also, I'm going to merge  changes made by @radu81
Title: Re: [ADDON] Double Post Stopper
Post by: live627 on November 18, 2018, 10:13:31 pm
Relevant changes in https://github.com/live627/elk-dps/commit/c45b467a686c013633920cf9122d941b99118d3c
Title: Re: [ADDON] Double Post Stopper
Post by: radu81 on November 27, 2018, 08:21:59 am
Sorry for the delay amd thanks for keeping updated this add-on. It works fine now with Elkarte 1.1
Title: Re: [ADDON] Double Post Stopper
Post by: live627 on November 28, 2018, 09:03:02 pm
Cheers :)