![]() |
Auto close thread after x days.
Requested by Skyline_GT
This is a simple script that will close all threads where the last post is 30 days or older Edited script with KirbyDE's code I got it this time :) ... and tested and works Tnx :) only 1 variable to edit here .... default is 30 days but you can change it to whatever you want ;) Please click Install |
Seems to be complicated, and might/will issue a lot of UPDATEs
I think this could also be done in 1 line ;) |
Sorry if i steped on you toes KirbyDE
if updates are required ... its just the code |
Quote:
What do you mean? I just wanted to point out that this can be done with just one UPDATE, instead of querying the table for outdated threads to get the threadis and then issue a query for each thread to close it. Imagine the script is run for the first time and there are 10.000 outdated threads. This would mean 10.001 queries are being executed ... |
I think Kirby was refering to this easier way
|
hmm ... i see where you are comming from ....
can i use your 1 liner? |
Sure :)
I must admit that I didn't test it, but as the query is pretty simple I am 99,75% sure that it does the job. |
Tnx Co-authour ;)
|
I fear that this version will close no threads ...
Let's say TIMENOW is 1106274310 Then $deletedate will be 1103682310 So (TIMENOW - $deletedate) will be 2592000, which is the timestamp of 1970-01-31 01:00:00. I don't think you'll find threads that old anywhere ;) |
oh crap ... i forgot about that the line should be
PHP Code:
|
All times are GMT. The time now is 02:42 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|