![]() |
Remove old thread subscriptions
is there a query or something that could remove all thread subscriptions of users who haven't been on the forum for xxx amount of time?
|
Well, I strongly suggest that you have a backup before you try this, because I haven't tested it extensively. But first try this:
Code:
SELECT username, FROM_UNIXTIME(lastactivity) FROM user WHERE lastactivity < (UNIX_TIMESTAMP() - (86400 * X)) where you replace the red X with the number of days of inactivity. If this seems to select the right users, then you can do this: Code:
DELETE FROM subscribethread WHERE userid IN ( |
It "seems" to have worked.
186599 rows deleted. (Query took 14.3054 sec) My subscriptions are still there... So I "think" it worked. Thank you... --------------- Added [DATE]1419328510[/DATE] at [TIME]1419328510[/TIME] --------------- Is there a way to make this into a cron job so it can run automatically?? |
Quote:
Code:
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "subscribethread |
All times are GMT. The time now is 11:53 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:
|