Quote:
Originally Posted by Mattwhf
Thanks Dave for the codes,
Btw, it is possible to change your codes to close all threads with 1 post or they are old posts with 1 post (I mean it has no answer on its thread)?
|
The thread table also stores the lastpost timestamp and the amount of replies in the thread.
For example, the following SQL query will close all threads that are older than 1 week and have no replies:
HTML Code:
UPDATE thread SET open = 0 WHERE replycount = 0 AND lastpost < UNIX_TIMESTAMP(NOW() - INTERVAL 1 WEEK)