I’ll eventually write this into a modification, but phpBB moderators and administrators know that, when you move a topic, you’re given the option to create a “shadow topic”, one which will point users to the new topic. What’s not apparent is how to delete these shadow topics or how to have them expire.
It’s actually pretty simple: in phpbb_topics, there’s a field called “topic_moved_id”. When you move a topic and specify that a shadow topic be created, a new topic is added to the database. This topic then owns all the posts associated with the old topic, which becomes the “shadow topic”. The “topic_moved_id” field exists simply to let phpBB know the association between the topic and its shadow.
To remove the fields, all you have to is delete any topic_id that has a non-null topic_moved_id field. Now, the easiest way to do this would be DELETE FROM phpbb_topics WHERE topic_moved_id > 0;, but that deletes all the shadow topics. That’s decidedly not cool; I decided to leave the last 7-ish days of shadow topics.
So, I pulled up my handy-dandy UNIX timestamp converter, fed in 04 17 2005 00 00 00, and got 1113696000 as a timestamp. Working from there, the SQL query gets only marginally harder: DELETE FROM phpbb_topics WHERE topic_moved_id > 0 AND topic_time < 1113696000;. I executed that, and 748 shadow topics were gone from The Rumor Forum.
To turn this into a worthwhile phpBB modification, I just need to mimic how to put this in the Administration Panel in 2.0.x. I’ve got a couple modifications already installed that I can mimic, but for now, it’s worth just posting this go-by for anyone else to use.
I found this little bit of info very helpful and would very much like to see this feature in the admin cp. Thank you very much.
Actually what would be nice is the see the option in the
Admin CP > Forum Admin > Pruning
As a option like
Remove Shadowed older than mm/dd/yyyy
Siacono: I agree, this would be a good option. As I am not administrating phpBB anymore, I can’t help you, but you might take the idea to the phpBB community boards’ Mods Forum and see if anyone is interested in coding it up.
You can delete that from the Moderator Control Panel
You might well can now. As noted above, I haven’t administrated phpBB regularly for over a year, and really closer to two. I switched not very long after writing this entry, I believe.
Where in the moderator panel is this option to delete shadow topics??
nerver mind, I found it!