id"); foreach ($posts as $post) { $post->delete(); } $thread->delete(); } function cleanup_orphan_threads() { $threads = BoincThread::enum(""); foreach($threads as $thread) { $forum = BoincForum::lookup_id($thread->forum); if (!$forum) { cleanup_thread($thread); } } } cleanup_orphan_threads(); ?>