Maximum number of threads per day in X forum
#11
(11-29-2013, 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.
Reply
#12
Unfortunately, it seems nobody understood my request Sad 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.
Reply
#13
(11-30-2013, 03:44 AM)brad-t Wrote: Unfortunately, it seems nobody understood my request Sad 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
Reply
#14
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?
Reply
#15
This user has been denied support. This user has been denied support.
(12-06-2013, 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');
Reply
#16
(12-06-2013, 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.
Reply
#17
I'm still really appreciative, thank you everyone.
Reply
#18
This user has been denied support. This user has been denied support.
(12-06-2013, 03:17 PM)Init Wrote:
(12-06-2013, 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. Smile
Reply
#19
(12-06-2013, 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. Smile

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! Smile

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.
Reply
#20
Yeah, if there's a demand for this it might be worth fleshing out more. Maybe make a thread in dev? Thanks a bunch!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)