Posts: 254
Threads: 11
Joined: Nov 2012
Reputation:
8
2013-11-29, 08:33 PM
(This post was last modified: 2013-11-29, 08:38 PM by Init.)
(2013-11-29, 08:02 PM)brad-t Wrote: This seems to be for posts, not threads? Not sure I understand it.
It works for both. As long as they have reached their limit, they won't be able to post replies or create new threads within the forum category.
I read what you required wrong the first time, so I might need to update some of the descriptions, but it limits posts within threads as well as the creation of new threads.
Posts: 9,351
Threads: 266
Joined: Oct 2007
Reputation:
232
Unfortunately, it seems nobody understood my request  I don't want to limit the number of posts, only the number of threads one can create in a specific forum in a day.
Posts: 254
Threads: 11
Joined: Nov 2012
Reputation:
8
(2013-11-30, 03:44 AM)brad-t Wrote: Unfortunately, it seems nobody understood my request I don't want to limit the number of posts, only the number of threads one can create in a specific forum in a day.
Try deactivating, updating, and reactivating.
I added a extra setting to allow to choose between Just Posts, Just Threads, or Both.
Commit: https://github.com/Ziloi/MyBB-DailyMaxim...55c8c76594
Posts: 9,351
Threads: 266
Joined: Oct 2007
Reputation:
232
2013-12-06, 05:28 AM
(This post was last modified: 2013-12-06, 05:31 AM by brad-t.)
Just set it up and it is working, thank you!
A suggestion: it would be better to show the warning as soon as the user clicks the "new thread" button rather than letting them go through the trouble of writing a new thread only to find out they can't post it ...
Still, won't complain about a free plugin but I think it could be useful for others ^^
Also, where can I change the message?
Posts: 4,386
Threads: 162
Joined: Jul 2010
Reputation:
138
2013-12-06, 06:39 AM
(This post was last modified: 2013-12-06, 06:43 AM by crazy4cs.)
 This user has been denied support.
(2013-12-06, 05:28 AM)brad-t Wrote: Just set it up and it is working, thank you!
A suggestion: it would be better to show the warning as soon as the user clicks the "new thread" button rather than letting them go through the trouble of writing a new thread only to find out they can't post it ...
Still, won't complain about a free plugin but I think it could be useful for others ^^ Just shooting a wild solution. Open the plugin file and see if he is running the hook at (or in laymen's terms, find something like this, if any):
newthread_do_newthread_start
and replace it with:
newthread_start
and it'd display the error right when trying to post a thread instead of while submitting it.
Another wild guess for changing the message, he may have hard coded it in the plugin or language file itself (if any), so search for the message over there and replace it.
-----------
edit: Alright, saw his file over at GitHub, replace these:
$plugins->add_hook('newreply_do_newreply_start', 'dailymaximum_start');
$plugins->add_hook('newthread_do_newthread_start', 'dailymaximum_start');
with:
$plugins->add_hook('newreply_start', 'dailymaximum_start');
$plugins->add_hook('newthread_start', 'dailymaximum_start');
Posts: 254
Threads: 11
Joined: Nov 2012
Reputation:
8
2013-12-06, 03:17 PM
(This post was last modified: 2013-12-06, 03:21 PM by Init.)
(2013-12-06, 06:39 AM)crazy4cs Wrote: ---
and replace it with:
newthread_start
and it'd display the error right when trying to post a thread instead of while submitting it.
Another wild guess for changing the message, he may have hard coded it in the plugin or language file itself (if any), so search for the message over there and replace it.
-----------
edit: Alright, saw his file over at GitHub, replace these:
$plugins->add_hook('newreply_do_newreply_start', 'dailymaximum_start');
$plugins->add_hook('newthread_do_newthread_start', 'dailymaximum_start');
with:
$plugins->add_hook('newreply_start', 'dailymaximum_start');
$plugins->add_hook('newthread_start', 'dailymaximum_start');
Sorry I have been a bit on hiatus.
I'll do an edit now. Thanks (1+). First plugin I've done for MyBB, so I was sure there were going to be better ways than those hooks.
I apologize.
Posts: 9,351
Threads: 266
Joined: Oct 2007
Reputation:
232
I'm still really appreciative, thank you everyone.
Posts: 4,386
Threads: 162
Joined: Jul 2010
Reputation:
138
 This user has been denied support.
(2013-12-06, 03:17 PM)Init Wrote: (2013-12-06, 06:39 AM)crazy4cs Wrote: ---
and replace it with:
newthread_start
and it'd display the error right when trying to post a thread instead of while submitting it.
Another wild guess for changing the message, he may have hard coded it in the plugin or language file itself (if any), so search for the message over there and replace it.
-----------
edit: Alright, saw his file over at GitHub, replace these:
$plugins->add_hook('newreply_do_newreply_start', 'dailymaximum_start');
$plugins->add_hook('newthread_do_newthread_start', 'dailymaximum_start');
with:
$plugins->add_hook('newreply_start', 'dailymaximum_start');
$plugins->add_hook('newthread_start', 'dailymaximum_start');
Sorry I have been a bit on hiatus.
I'll do an edit now. Thanks (1+). First plugin I've done for MyBB, so I was sure there were going to be better ways than those hooks.
I apologize. Not a problem at all. From a skim look, your code is fantastic, didn't looked at all like some new comer was writing it. Nice work.
Posts: 254
Threads: 11
Joined: Nov 2012
Reputation:
8
2013-12-06, 04:13 PM
(This post was last modified: 2013-12-06, 04:14 PM by Init.)
(2013-12-06, 04:02 PM)crazy4cs Wrote: Not a problem at all. From a skim look, your code is fantastic, didn't looked at all like some new comer was writing it. Nice work. 
Appreciated!
I've been developing for a while, just have never actually attempted a plugin for some reason until now. The only thing I hadn't really dealt with in that was the regexs so they may be a bit messy.
None the less, Thanks!
PS: I might be clean up the plugin later. A lot of it was done under rush to get it out (probably a mistake) as you might be able to tell considering half of it doesn't follow DRY.
Posts: 9,351
Threads: 266
Joined: Oct 2007
Reputation:
232
Yeah, if there's a demand for this it might be worth fleshing out more. Maybe make a thread in dev? Thanks a bunch!
|