HOW TO DELETE OLD THREADS AUTOMATICALLY AFTER 6 MONTHS

Add this to any CUSTOM ISLAND. Using an island with a static graphic works good.
Set the Island "Cache Time" to 1440. That way it will only run the query once a day.

Code
/* PHP CODE HERE, IF NECESSARY */

$sql = "DELETE FROM ubbt_TOPICS
WHERE forum_id = 44
AND TOPIC_LAST_REPLY_TIME < (unix_timestamp(now()) - 15552000)";

$dbh->do_query($sql);

/* DO NOT CHANGE THE LINE BELOW */
$body = <<<EOF

<img src="http://abc.org/forum/images/some-image.jpg" width="108" height="25" align=center alt="Good times!">Some Text Message

EOF;
/* DO NOT CHANGE THE LINE ABOVE */
You can change the "age" of the files that it deletes by modifying seconds (15552000) for the Unix calculation. (Example: Three months would be half of this number.)

---WARNING: DO NOT ADD THIS CODE UNTIL YOU READ THE FOLLOWING POSTING FIRST--- IT MAY NOT BE ADVISABLE TO DO IT TO LARGE, OR ACTIVE FORUMS---
Warning this code could break your site and may not be recoverable without data backups prior to running.
The user that created this is well aware of the risks involved

Last edited by Ruben; 02/12/2013 6:13 PM. Reason: Added comment by Ruben

--BIll B