Forum losing topic watch settings
Posted: Thu Oct 06, 2005 6:56 am
On at least one thread (Themesongfight 2005), the forum keeps on misplacing my topic watch settings. There's probably a bunch of other topics and users which are simply getting their "watch this topic for replies" setting lost.
It's possible that maybe the phpbb_topics_watch table is getting too big. One thing you can do to mitigate this is to install my "expiring notifications" <a href="http://trikuare.cx/code/phpbb/">phpBB mod</a>, and then every month or so run this SQL command (assuming the server is running mysql):
which will remove all topic watch information for topics which haven't been posted to in the last 60 days.
You can also see how big the topic watch table is with this command:
and you can see how much of it is obsolete by adding everything from the WHERE to the ; in the DELETE line above to the SELECT line below.
Another cute SQL/phpBB trick is you can see who is watching which threads with this command:
It's possible that maybe the phpbb_topics_watch table is getting too big. One thing you can do to mitigate this is to install my "expiring notifications" <a href="http://trikuare.cx/code/phpbb/">phpBB mod</a>, and then every month or so run this SQL command (assuming the server is running mysql):
Code: Select all
DELETE FROM phpbb_topics_watch WHERE notify_status > 1 AND notify_status < UNIX_TIMESTAMP(NOW()) - 5184000;
You can also see how big the topic watch table is with this command:
Code: Select all
SELECT COUNT(*) FROM phpbb_topics_watch;
Another cute SQL/phpBB trick is you can see who is watching which threads with this command:
Code: Select all
select u.username, t.topic_title from phpbb_topics_watch as tw left join phpbb_topics as t on (t.topic_id = tw.topic_id) left join phpbb_users as u on (u.user_id = tw.user_id) order by tw.topic_id desc;