Quote:
Originally Posted by joeychgo
Is there a way to make this into a cron job so it can run automatically??
|
You could create a plugin using hook location cron_script_cleanup_daily and this code:
Code:
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "subscribethread
WHERE userid IN (
SELECT userid FROM " . TABLE_PREFIX . "user
WHERE lastactivity < (UNIX_TIMESTAMP() - (86400 * X))
)");
remember to change the X again. And you should probably test it by going to the scheduled task manager and pressing "Run Now" for the Daily Cleanup task. If it says "Daily Cleanup Done" with no error messages then you're good.