vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - Automatically close threads after X replies (https://vborg.vbsupport.ru/showthread.php?t=190969)

Marco 09-14-2008 10:00 PM

Automatically close threads after X replies
 
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

Quote:

Originally Posted by Masiello (Post 1622541)
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. :)

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

Quote:

Originally Posted by Marco (Post 1622558)
I think a mod like that already exists. :)

This allow Admin choice and not user choice
Quote:

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

Quote:

Originally Posted by Marco (Post 1622609)
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.

Quote:

Originally Posted by Masiello (Post 1622621)
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

Quote:

Originally Posted by Marco (Post 1622609)
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:

PHP Code:

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

Change to:

PHP Code:

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. :)

Quote:

Originally Posted by Marco (Post 1622921)
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:

PHP Code:

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

Change to:

PHP Code:

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

Quote:

Originally Posted by GaiLoan (Post 1755782)
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

Quote:

Originally Posted by charlesr (Post 2393240)
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.


All times are GMT. The time now is 06:18 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01509 seconds
  • Memory Usage 1,782KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete