![]() |
Automatically Lock Old Threads (Via vB Cron)
This vB cron allows you to define a certain period of time for threads to be automatically locked.
PHP Code:
|
I love the concept however this needs to be revised for last post activity as a lot of members use the same thread as an update thread which can go on for a long time.
|
Is the time based on when the thread is created, or when the last reply was?
|
I wrote something similar for my board a while back.
What I would do is change the query to: Code:
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET open=0 WHERE forumid IN(". FORUM_IDS .") AND open <> 0 AND FROM_UNIXTIME(lastpost) < DATE_SUB(CURDATE(),INTERVAL ". TIME_SPAN .")"); 1) Only locking threads that aren't already locked (saves re-locking already locked threads) 2) Basing it on the lastpost in the thread, so you don't lock active threads that are created within your timespan What I also do is hard delete any that are locked and within another timeframe using the same cron job. Regards, Delphy |
Thanks for that...... So when are the sims coming out to psp?
|
Something like this has already been released. https://vborg.vbsupport.ru/showthrea...threadid=70302 and it goes by the last post date.
|
All times are GMT. The time now is 10:51 AM. |
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:
|