PDA

View Full Version : Miscellaneous Hacks - Automatically close threads after X replies


Marco
09-14-2008, 10:00 PM
Product name:
Automatically close threads after X replies

Product description:
As the name implies, this product will allow you to automatically close threads when a certain number of replies (set in the Admin CP) has been reached. Each time a post is made, the plugin checks if the reply limit has been reached, and if so, the topic is closed. Sticky threads may be excluded from this limit.

Product installation:
Just import the product and set the options under vBulletin options, that's all there is to it.

Version compatibility:
Has been tested on vBulletin 3.7.x. May or may not work with earlier versions.

Version history:

1.0.1 -- 09/15/2008
- [Added] Ability to exclude individual threads
- [Added] Version check

1.0.0 -- 09/15/2008
- Initial release

Ascor
09-15-2008, 10:42 AM
Taged for futur use, thank you Marco :)

Masiello
09-15-2008, 10:46 AM
It would be fantastic to see a mod like this that allows to close the thread automatically after a tot of days, with the user mandatory choice for certain forum of who opening the thread. For my forum would be a windfall!

Nordinho
09-15-2008, 11:00 AM
I could have a real use for this, if it would create a new thread (continuing the old thread) automatically

Marco
09-15-2008, 11:28 AM
It would be fantastic to see a mod like this that allows to close the thread automatically after a tot of days, with the user mandatory choice for certain forum of who opening the thread. For my forum would be a windfall!

I think a mod like that already exists (https://vborg.vbsupport.ru/showthread.php?t=130738). :)

Forum Lover
09-15-2008, 12:30 PM
Marco, got any plan to put thread ids too?

Marco
09-15-2008, 01:19 PM
You mean thread id's of threads you would like to remain open? That sounds doable, I might add that when I have some time.

Masiello
09-15-2008, 02:04 PM
I think a mod like that already exists (https://vborg.vbsupport.ru/showthread.php?t=130738). :)
This allow Admin choice and not user choice
This product will automatically close threads. Administrators have the option of setting the number of days until a thread closes, including or excluding sticky threads, and including or excluding forums by ID.

Threads can be closed X days after the thread was created or X days after the last post.

Marco
09-15-2008, 02:37 PM
You mean thread id's of threads you would like to remain open? That sounds doable, I might add that when I have some time.

I had some time just now. ;)

Updated to version 1.0.1, which adds this feature.

This allow Admin choice and not user choice

I see. Well, my plugin is never going to do that, sorry.

Forum Lover
09-15-2008, 06:27 PM
You mean thread id's of threads you would like to remain open? That sounds doable, I might add that when I have some time.


Not really, as I don't want all of my threads got close. I want certain threads.

Marco
09-15-2008, 10:03 PM
Right. Don't see myself adding that too, but you can easily modify the plugin to do that. Install the product, go to Plugin Manager, find the plugin that belongs to the product, and find the following line:

if ($threadinfo['replycount'] >= $vbulletin->options['auto_close_amount'] AND !in_array($threadinfo['threadid'], $exclude))

Change to:

if ($threadinfo['replycount'] >= $vbulletin->options['auto_close_amount'] AND in_array($threadinfo['threadid'], $exclude))

So all you need to do is remove the exclamation mark before in_array.

Forum Lover
09-16-2008, 07:12 AM
Copy that chief. :)

Right. Don't see myself adding that too, but you can easily modify the plugin to do that. Install the product, go to Plugin Manager, find the plugin that belongs to the product, and find the following line:

if ($threadinfo['replycount'] >= $vbulletin->options['auto_close_amount'] AND !in_array($threadinfo['threadid'], $exclude))

Change to:

if ($threadinfo['replycount'] >= $vbulletin->options['auto_close_amount'] AND in_array($threadinfo['threadid'], $exclude))

So all you need to do is remove the exclamation mark before in_array.

Jaxel
09-16-2008, 07:14 AM
THANK GOD!

I've been looking for this mod since Ralle's version disappeared last year.

Aren
09-16-2008, 08:04 AM
My apologies if it is a dumb question, but I have to make it...

What's the point on closing a thread when it reaches X replies? Performance? And if it is, is there somewhere were I could read about this limit (and others that may apply)?

Thanks a lot in advance.

Marco
09-16-2008, 10:31 AM
Performance not so much, I think, but in my opinion limiting the amount of replies in a thread makes threads a little easier to manage. Sometimes you get these really huge threads and no one really knows what they're about anymore.

Aren
09-16-2008, 11:00 AM
Thanks for the answer, Marco :)

I see your point now, even if I prefer to manually handle that kind of threads. Anyway, keep up the good work! :)

Jaxel
09-16-2008, 12:50 PM
In an older version of vb we have running... vb235... we noticed that our server is so crappy that if a thread gets too large, and for some reason the thread needs to be updated (moved, deleted, reindexed), the server would crapy out simply because the thread was too large. Then the posts.myi would go haywire and the entire forums would go down. Keeping the post counts down in threads helped fix this problem.

lostgirl815
12-10-2008, 07:38 PM
Would I need to put in all the IDs of the forums I wish to exclude, or would I just need to specifify which forum to include? (Are forums excluded by default?)

GaiLoan
02-27-2009, 06:24 AM
hi, this is nice, can we choose the forum to set this option ?

aquila125
03-23-2009, 10:52 AM
Does this also work on 3.8.1?

Coleccromos
04-13-2009, 07:47 AM
hi, this is nice, can we choose the forum to set this option ?

This would not be bad idea to select the sub forums

Can I include?

Mike08
10-14-2009, 10:12 PM
Working on 3.8.2

Thanks!!!

thunderclap82
06-12-2011, 10:33 PM
Can this be modified to exclude certain forums instead of threads?

charlesr
12-06-2012, 01:03 PM
Anyone know if there is a 4.x version of this mod?

flirtsnfriends
12-28-2012, 05:31 AM
I was just searching for the same thing for 4.2. Hopefully, there is a hack for it but I searched and could not find it

charlesr
12-28-2012, 06:15 PM
Actually I've just tried to install this on my 4.2 test instance and it appears to work fine. :) Are there any tech dudes that could have a nose in the code and see if there's any reason I should be scared of using it on a live instance? Cheers!

justicechick
07-24-2013, 05:39 AM
Actually I've just tried to install this on my 4.2 test instance and it appears to work fine. :) Are there any tech dudes that could have a nose in the code and see if there's any reason I should be scared of using it on a live instance? Cheers!

Ive looked at the XML and tested it in both 4.2.0 and 4.2.1 and there is no reason that you cant use it. Works fine in both.